diff --git a/docs/architecture/knowledge-reports.md b/docs/architecture/knowledge-reports.md new file mode 100644 index 00000000000..b9c565f9017 --- /dev/null +++ b/docs/architecture/knowledge-reports.md @@ -0,0 +1,186 @@ +# Knowledge reports + +A knowledge report says that a memory claim or a document is incorrect or outdated, or +that the namespace is missing knowledge. Agents and clients file one with +`knowledge.reports.submit` when they find the problem while they work. A namespace's +admins are its maintainers: they read the queue with `knowledge.reports.list`, take a +report, ask for evidence, resolve it with the revision that corrected the target, or +dismiss it with a reason. A report never edits its target; the fix is an ordinary memory +or document write. + +```mermaid +flowchart LR + A["agent or client"] -->|"knowledge.reports.submit"| R["loom.knowledge_reports"] + R -->|"knowledge.reports.list / get"| M["maintainers (admins)"] + M -->|"knowledge.reports.update"| R + A -->|"knowledge.reports.evidence"| R +``` + +## Filing a report + +A report has a kind (`missing`, `incorrect` or `outdated`), the problem in the reporter's +words, an optional suggested correction and, except for missing knowledge, a target: + +| Target | `target_key` | `target_version` | `target_sha256` | +| ---------- | -------------- | ------------------ | ----------------------- | +| `memory` | the memory key | the memory version | the served content hash | +| `document` | the source URI | the revision | SHA-256 of its content | + +A target the reporter did not say they read is stamped with what is there at submit. A +memory version is a nanosecond timestamp above 2^53, which a JavaScript number rounds, so +`target_version` also takes a decimal string and a report carries `target_version_text`, +the same version as a string, as `memory.get` carries `version_text`. +Evidence is references only, `gap:`, `reflection:` or `run:`, at most 20 +distinct ones, never copied text. Each reference, and the report's `run_id`, is checked as +the caller would read what it points at (`server/knowledge/app/report_refs.py`): a run of +the namespace, the reflection memory at that key under the report's identity tuple, and a +gap of the latest build, which only namespace admins read. A write that cites one the +caller cannot read is refused as not found, and a read serves only those the caller can +read then. Related reports name other report ids of the namespace that the caller reads +as `get` decides it: their own, or any for a maintainer. Another reporter's report is +refused as a missing one is, so a link never says whether an id exists. The rules are in +`server/knowledge/domain/reports.py`; a broken report is a 422. + +The reporter is the person the token stands for, as knowledge gaps count askers +(`token_person` and `folded_person` in `server/knowledge/app/people.py`): the token's end +user, else its creator, folded onto one spelling per person. A token no person stands +behind, such as an agent's own account, reports under its own principal. When the +directory cannot be read the request is a 503 to retry, and a token tied to two accounts +is a 403; neither is filed or matched under another spelling, since the report id and the +reporter checks would stop matching once the person folds. Reads and evidence resolve the +caller before the report, so neither answer says whether it exists; a namespace admin whose +person cannot be folded still reads as a maintainer, unmatched as the reporter. With auth +off no token names a caller, so every caller is the reporter, as every caller is a +maintainer. + +The caller must be able to read the target: a memory key is read as `memory.get` reads it +under the body's identity tuple (`readable_version` in `server/memory/app/handlers.py`, +which serves nothing of the row), a document as `knowledge.get` reads it. A target the +caller cannot read answers 404, as a missing one does. `memory.get` falls back to the same +user's row under another agent or session, so a memory report takes the identity tuple of +the row the key was found in, and every later read of its target reads that row alone. An +`agent` of `*` reads the key across users, so only a row of the body's `user_id` counts: +another user's row answers 404, as the fallback never finds one. Any other report keeps +the body's `agent`, `user_id` and `session_id`. Neither tuple is the reporter. + +The report id is a hash of the org, namespace, reporter, kind, target and problem text +(whitespace folded), and for a memory target the found row's identity tuple. The same +reporter filing the same problem about the same target gets the same report back, with or +without an Idempotency-Key, and two agents whose reads find one row file one report. A +repeat returns the report as it stands, resolved or dismissed included: a maintainer +reopens it. A repeat after its memory target is gone finds the report only when the key was +in the row of the body's own tuple, since no read then says which row it was. + +## Reading reports + +`knowledge.reports.get` serves a report to its reporter and to the namespace's admins; +anyone else is answered not found. Each get checks the target again: `target_changed` +is true when its version or hash differs from what the report holds, or it is gone. A +caller who cannot read the target now sees the report with `target_readable` false and +without the words written about it, which may quote it: the problem, the correction and +a maintainer's reason. The reporter still reads their own problem and correction. +Evidence and related reports are served only while the caller reads what they point at. + +A mirrored document's address belongs to its readers ([document sources](document-sources.md)). +An admin who may not know of a report's document sees no `target_key`, revision or +resolution for it: `known_documents` (`server/knowledge/app/document_reads.py`) knows a +document of the namespace, deleted ones included, and a mirrored copy the caller's +access list admits now. A page's mirrored copies are checked together from their +metadata, without reading their text, and a failed check admits none. The reporter wrote +the address, so always reads it. + +`knowledge.reports.list` is the admins' queue, newest change first, filtered by state, +kind, target, assignee or reporter. Its rows carry no one's words and read no target, so +they carry no `target_changed`: both are read one report at a time. A row about a +document the admin may not know of carries no address, and a `target_key` filter finds +no report about one. + +## Maintainers' actions + +`knowledge.reports.update` (admin, audited) applies one action and may link related +reports: + +| Action | From | To | Needs | +| ------------------ | ----------------------------- | ---------------- | --------------------- | +| `take` | any but resolved or dismissed | `taken` | sets the assignee | +| `release` | `taken` | `open` | clears the assignee | +| `request_evidence` | any but resolved or dismissed | `needs_evidence` | a reason | +| `resolve` | any but resolved or dismissed | `resolved` | `resolution_revision` | +| `dismiss` | any but resolved or dismissed | `dismissed` | a reason | +| `reopen` | `resolved` or `dismissed` | `open` | a reason | + +`resolution_revision` names the published revision that corrected the target, not a +draft or a recommendation: for a report about a memory claim or a document, the revision +number readers are served now, which must be newer than the reported one. Memory versions +come from the clock, so a number between the two may never have been published. An +unchanged or gone target is not resolved (dismiss it with a reason). A report with no +target has no revision to check, so its resolution is the maintainer's words, and +`reason_by` names who wrote them as it does a reason. `expected_version` refuses an update +made from a stale read (409). + +`knowledge.reports.evidence` lets the reporter add references to their own report; any +other caller is answered not found. A report waiting for evidence goes back to `taken` +when a maintainer holds it, else to `open`. + +## Storage + +`loom.knowledge_reports` is a `ReplacingMergeTree(version)` sorted by +`(org, namespace, report_id)`: submit writes version 1 and every change the next version +of the whole row, read with `FINAL` (`server/knowledge/store/reports.py`). Each change is +a read, then a write, under the report's claim (`leases.holding`), so two writers never +both build on the same version; the second is told to retry (503). Each version is +inserted synchronously and read with `select_sequential_consistency`, so the next read on +any replica sees it. + +Every version carries the `actor` and `source_class` of the write that made it, stamped by +the server from the token (`writer_actor`, `source_class_for(default="asserted")`), never +from the body: a maintainer's change names the maintainer, added evidence the reporter. +`written_by` holds the person that token stands for, folded as the reporter is, so a +service account's version names its creator while its `actor` names the account. With +auth off the writer is the agent that filed the report, or `-` for an update. + +## Read scope + +A token bounded below the namespace (`read_scope` `own_user` or `own_session`) cannot call +`knowledge.reports.*` (`NARROW_REFUSED_PREFIXES` in `server/identity/domain/read_scope.py`): +the queue and a report hold other people's words. + +## Erasure + +A user erasure deletes every version of the reports the user filed, as reporter or under +their `user_id`, by the same spellings it erases knowledge gaps with. On the reports the +user maintained it clears, in every version, what names them or is their words: the +assignee, the writer's `actor` and `written_by` (matched on `written_by`, so a write +through the user's service account or as an end user is found), a `reason`, and the +resolution of a report with no target. `reason_by` names who wrote those words, since +later versions carry them forward under another writer, such as a maintainer who only +links a related report. A target's resolution is a checked revision number and stays. The +reporter's words stay +(`delete_knowledge_reports_by_user` in `server/erasure/store/steps_ledgers.py`). A +namespace erasure deletes the namespace's reports. The residue census counts both scopes. +Deleting a memory, a document or a source deletes no report: a report copies nothing from +its target, which then reads as gone, so only the reporter reads the report's words. + +Each write takes the org's durable write fence (`writer_lease_name` in +`server/knowledge/domain/reports.py`), which both report erasure steps take too. Inside it, +while an erasure is unfinished, or has finished since the request started (`erasure_since`, +as knowledge gaps use), that reaches the report's namespace, its reporter, its user, its +assignee, the author of a reason the write carries forward or the writing maintainer, +submit, update and evidence answer 409 `ERASURE_RUNNING`. An insert whose outcome is +unknown, a cancelled send included, keeps the fence until its send bound passes, so an +erasure step never runs before a version that may still land. + +## Rolling upgrades + +An older build's erasure saga has no step for `loom.knowledge_reports`, so no report is +written while such a replica serves: while any live replica of any deployment kind +sharing the database has a schema below the migration that adds the table, or no +heartbeat can be read, submit, update and evidence answer 503 +(`every_replica_stores_reports` in `server/knowledge/app/reports.py`), as knowledge gaps +do ([rolling upgrades](rolling-upgrades.md)). Before a rollback, the +operator deletes the table's rows, and again after the first older replica serves. + +## Dashboard + +No dashboard page serves reports: maintainers read and act on them through the API, the +SDKs and `loom_op` (`NOT_IN_DASHBOARD` in `server/operations/dashboard.py`). diff --git a/docs/architecture/rolling-upgrades.md b/docs/architecture/rolling-upgrades.md index 4969bb4812a..d8a4b4e7b52 100644 --- a/docs/architecture/rolling-upgrades.md +++ b/docs/architecture/rolling-upgrades.md @@ -1000,7 +1000,6 @@ See the [participant lifecycle baseline](cells.md#participant-lifecycle-baseline step leaves them until ClickHouse holds the head; an N-1 policy step that reads the old head in that window drops them, and the linker then makes them `fresh`. `renamed` is one more number in the pass outcome. No gate holds the rollout. - 68. **Code store names are reserved** (migration `118_store_names_reserved.sql`): N's gate refuses every request that names a namespace of the form `crs-` and 24 hex digits (only a platform admin's `erasure.request` may name one), with auth on or off, as @@ -1035,6 +1034,16 @@ See the [participant lifecycle baseline](cells.md#participant-lifecycle-baseline mirrored sources' [procedure](document-sources.md#rolling-upgrades) says. `tests/unit/test_crawl_fleet_migration.py` checks N's side, and the mixed-version gate does not check this rule. +70. **Knowledge reports** (`loom.knowledge_reports`, migration + `120_knowledge_reports.sql`): N-1's erasure saga has no step for the table. So while + any live replica, in every deployment sharing the database, has a schema version + below 120, or no heartbeat has been read, `knowledge.reports.submit`, `update` and + `evidence` answer 503, as knowledge gaps do under rule 48; N-1 serves no + `knowledge.reports.*` op. Before a rollback, delete the table's rows, then delete + again after the first N-1 replica serves + ([knowledge reports](knowledge-reports.md#rolling-upgrades)). + `tests/unit/test_knowledge_reports.py` checks the refusal; the mixed-version gate + does not. ## What checks them diff --git a/docs/architecture/storage-layout.md b/docs/architecture/storage-layout.md index d75215d75a6..e50216caf29 100644 --- a/docs/architecture/storage-layout.md +++ b/docs/architecture/storage-layout.md @@ -1052,6 +1052,7 @@ it holds no provider identity or credential. | `knowledge_mirrors` | RMT(version) `(org, namespace, mirror)` | Postgres `knowledge_mirrors` | SoR | step `knowledge_mirrors.forget` | 3 | the `acl-` namespaces a namespace's mirrored sources' documents live in ([document sources](document-sources.md#data-model)), read by key; no memory content; named in `server/knowledge/store/mirrors.py`, `server/identity/store/namespace_census.py` | | `knowledge_source_listings` | RMT(version) `(org, namespace, source_id)` | stays | Derived | census, `knowledge_source_listings.delete` | — | when each mirrored source's last complete listing started, under its mirror's name; read beside the lists in `loom.documents`, so it stays in ClickHouse; no memory content; named in `server/knowledge/store/mirrors.py` | | `knowledge_group_members` | RMT(version) `(org, namespace, source_id, group)` | stays | Derived | census, `knowledge_group_members.delete` | — | source-scoped directory snapshots for mirror permissions; read beside listings under sequential consistency, including with Postgres heads; no memory content; named in `server/knowledge/store/source_access.py` | +| `knowledge_reports` | RMT(version) `(org, namespace, report_id)` | stays | SoR | census, `knowledge_reports.delete`, user scope too | — | problem reports on memory claims and document passages, the reporter's words and references to gaps, reflections and runs, never copied text; a user erasure deletes the reports the user filed and clears the user as assignee of the others; named in `server/knowledge/store/reports.py`, `server/erasure/store/steps_ledgers.py` | | `conversations` | MT `(org, namespace, thread_id, ts, msg_id)`, by `toYYYYMM(ts)` | stays + Postgres `conversation_states` | SoR | census, `conversations.tombstone`, user scope too | 3 | messages, an append log read by scans; their tombstones and saved state move to Postgres `conversation_states` in wave 3 ([conversation state](#conversation-state)); named in `server/knowledge/store/conversations.py`, `server/erasure/store/exports.py` | | `conversation_threads` | RMT(updated_at) `(org, namespace, thread_id)`, by `toYYYYMM(created_at)` | stays | SoR | census, `conversations.tombstone`, user scope too | — | threads: the title, metadata and `run_id` a caller sets with `conversation.create` and `conversation.update`, and a model title for an untitled thread, with no TTL; it stays because its tombstones must reach every version of the row, as today's mutations do, and no reader needs a Postgres commit of it; an update merges onto the row it reads, so a write racing another write can lose a field, and one racing a thread delete or an erasure brings the thread back, a race of today's code that no wave changes ([conversation state](#conversation-state)); named in `server/knowledge/store/conversations.py`, `server/erasure/store/exports.py` | | `conversation_embeddings` | RMT(ts) `(org, namespace, embedding_model, thread_id, msg_id)`, by `toYYYYMM(ts)` | stays | Derived, SoR past its source's retention | census, `conversations.tombstone`, user scope too | — | message vectors, rebuildable at embedding cost while their messages are retained; it has no TTL, so past `conversations` retention its excerpt, vector and saved state are the only copy; its saved state and saver stay on its own rows as version-row inserts from wave 3 ([conversation state](#conversation-state)); named in `server/knowledge/store/conversations.py`, `server/erasure/store/mutations.py` | diff --git a/docs/features/knowledge.md b/docs/features/knowledge.md index de9abd5cd99..a1190ff957d 100644 --- a/docs/features/knowledge.md +++ b/docs/features/knowledge.md @@ -88,29 +88,34 @@ a section the unit of retrieval, and the breadcrumb tells a hit where it came fr All operations are in the [knowledge group](../reference/operations.md#knowledge) of the operations reference. -| Operation | Role | Does | -| --------------------------- | ------ | -------------------------------------------------------------------------------------- | -| `knowledge.add` | writer | Store one document and its chunks. | -| `knowledge.bulk_add` | writer | Store up to 500 documents in one call; the same per-document behaviour as `add`. | -| `knowledge.upsert` | writer | Add or replace the document at a `source_uri`; earlier chunks are superseded. | -| `knowledge.search` | viewer | Hybrid passage search (vector, BM25 and exact keys fused). | -| `knowledge.get` | viewer | One document's full text and metadata by `source_uri`. | -| `knowledge.list` | viewer | Documents of one or more namespaces in cursor pages, filterable by tag and URI prefix. | -| `knowledge.outline` | viewer | A document's table of contents, and optionally one section's assembled text. | -| `knowledge.synthesize` | viewer | Complete a task over whole documents, or calculate over datasets, with the LLM. | -| `knowledge.update_metadata` | writer | Edit `title`, `description` or `tags`; `reindex=true` rewrites the chunks' context. | -| `knowledge.delete` | writer | Supersede a document and its chunks. | -| `knowledge.bulk_delete` | writer | The same for up to 500 `source_uris`. | -| `knowledge.restore` | writer | Undo a delete: the document's last version and its chunks are live again. | -| `knowledge.reads` | viewer | How often agents opened each document over the last `days` (1–30). | -| `knowledge.inspect` | viewer | A report on the namespace's documents ([below](#inspecting-a-namespaces-documents)). | -| `knowledge.dedup_list` | admin | Documents (and, optionally, chunks) of the namespace with identical content hashes. | -| `knowledge.dedup_resolve` | admin | Supersede one side of a duplicate pair. | -| `knowledge.ingest` | writer | Extract an uploaded file and publish it as a document revision (a job). | -| `knowledge.ingest_status` | viewer | A job's state, stage, coverage, warnings, failure and published revision. | -| `knowledge.ingest_cancel` | writer | Stop a job before it publishes. | -| `knowledge.formats` | viewer | The formats an ingest reads, the names that select each, and the upload's limits. | -| `knowledge.gaps.list` | admin | Questions several users asked that nothing answered ([below](#knowledge-gaps)). | +| Operation | Role | Does | +| ---------------------------- | ------ | -------------------------------------------------------------------------------------------------------------- | +| `knowledge.add` | writer | Store one document and its chunks. | +| `knowledge.bulk_add` | writer | Store up to 500 documents in one call; the same per-document behaviour as `add`. | +| `knowledge.upsert` | writer | Add or replace the document at a `source_uri`; earlier chunks are superseded. | +| `knowledge.search` | viewer | Hybrid passage search (vector, BM25 and exact keys fused). | +| `knowledge.get` | viewer | One document's full text and metadata by `source_uri`. | +| `knowledge.list` | viewer | Documents of one or more namespaces in cursor pages, filterable by tag and URI prefix. | +| `knowledge.outline` | viewer | A document's table of contents, and optionally one section's assembled text. | +| `knowledge.synthesize` | viewer | Complete a task over whole documents, or calculate over datasets, with the LLM. | +| `knowledge.update_metadata` | writer | Edit `title`, `description` or `tags`; `reindex=true` rewrites the chunks' context. | +| `knowledge.delete` | writer | Supersede a document and its chunks. | +| `knowledge.bulk_delete` | writer | The same for up to 500 `source_uris`. | +| `knowledge.restore` | writer | Undo a delete: the document's last version and its chunks are live again. | +| `knowledge.reads` | viewer | How often agents opened each document over the last `days` (1–30). | +| `knowledge.inspect` | viewer | A report on the namespace's documents ([below](#inspecting-a-namespaces-documents)). | +| `knowledge.dedup_list` | admin | Documents (and, optionally, chunks) of the namespace with identical content hashes. | +| `knowledge.dedup_resolve` | admin | Supersede one side of a duplicate pair. | +| `knowledge.ingest` | writer | Extract an uploaded file and publish it as a document revision (a job). | +| `knowledge.ingest_status` | viewer | A job's state, stage, coverage, warnings, failure and published revision. | +| `knowledge.ingest_cancel` | writer | Stop a job before it publishes. | +| `knowledge.formats` | viewer | The formats an ingest reads, the names that select each, and the upload's limits. | +| `knowledge.gaps.list` | admin | Questions several users asked that nothing answered ([below](#knowledge-gaps)). | +| `knowledge.reports.submit` | writer | Report a memory claim or document as wrong or outdated, or knowledge as missing ([below](#knowledge-reports)). | +| `knowledge.reports.get` | viewer | One report, for its reporter or an admin. | +| `knowledge.reports.list` | admin | The namespace's report queue, without anyone's words. | +| `knowledge.reports.update` | admin | Take, release, ask for evidence on, resolve, dismiss or reopen a report. | +| `knowledge.reports.evidence` | writer | The reporter adds evidence references to their own report. | `knowledge.search` and `knowledge.reads` are hidden from MCP: neither is listed, and `loom_op` refuses them too. An agent reaches the knowledge plane through @@ -1735,6 +1740,24 @@ curl -s localhost:7777/v1/knowledge.gaps.list -H "Authorization: Bearer $LOOM_AP How misses are recorded and grouped, their erasure and their rolling-upgrade notes are in [knowledge gaps](../architecture/knowledge-gaps.md). +## Knowledge reports + +An agent or client that finds a memory claim or a document wrong or outdated, or finds +knowledge missing, files a report with `knowledge.reports.submit`. A report never edits +its target. The namespace's admins read the queue with `knowledge.reports.list`, open a +report with `knowledge.reports.get`, and take, resolve with the revision that fixed the +target, or dismiss it with `knowledge.reports.update`. A reporter adds evidence to their +own report with `knowledge.reports.evidence`. + +```bash +curl -s localhost:7777/v1/knowledge.reports.submit -H "Authorization: Bearer $LOOM_API_KEY" \ + -H 'content-type: application/json' \ + -d '{"org":"dev","namespace":"local","agent":"cli","kind":"outdated","target_kind":"memory","target_key":"pricing/plan","problem":"The plan price changed."}' +``` + +The reporter, the read checks, the states and their erasure are in +[knowledge reports](../architecture/knowledge-reports.md). + ## Settings | Setting | Effect | diff --git a/docs/reference/operations.md b/docs/reference/operations.md index 3d724eb59e9..53bd22aaf7a 100644 --- a/docs/reference/operations.md +++ b/docs/reference/operations.md @@ -123,7 +123,7 @@ python scripts/codegen/docs_reference.py --check # exit 1 when a region is stal -379 operations in 43 groups. Every op is served at `POST /v1/` and as the MCP tool `loom_` (dots become underscores). +384 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. @@ -443,6 +443,11 @@ Fields for every `knowledge` op: [operations/knowledge.md](operations/knowledge. | [`knowledge.query_history.list`](operations/knowledge.md#knowledgequery_historylist) | List the namespace's registered query-history sources. | admin | idempotent | no | | | [`knowledge.query_history.remove`](operations/knowledge.md#knowledgequery_historyremove) | Remove a query-history source registration from the namespace. | admin | idempotent | no | yes | | [`knowledge.reads`](operations/knowledge.md#knowledgereads) | How often agents opened each document over the last `days` (`knowledge.get` ledger rows; dashboard, assistant and bench traffic left out). | viewer | read | no | | +| [`knowledge.reports.evidence`](operations/knowledge.md#knowledgereportsevidence) | The reporter adds evidence to their own report, for example after a maintainer asked for it. | writer | write | no | | +| [`knowledge.reports.get`](operations/knowledge.md#knowledgereportsget) | One report, with the problem, the suggested correction and the evidence, when you can read its target. | viewer | read | no | | +| [`knowledge.reports.list`](operations/knowledge.md#knowledgereportslist) | The namespace's report queue for maintainers, newest change first. | admin | idempotent | no | | +| [`knowledge.reports.submit`](operations/knowledge.md#knowledgereportssubmit) | Report that a memory claim or a document passage is incorrect or outdated, or that knowledge is missing. | writer | idempotent | no | | +| [`knowledge.reports.update`](operations/knowledge.md#knowledgereportsupdate) | A maintainer takes, releases, asks for evidence on, resolves, dismisses or reopens a report, or links related reports. dismiss, request_evidence and reopen need a reason. resolve names the published… | admin | write | no | yes | | [`knowledge.restore`](operations/knowledge.md#knowledgerestore) | Undo a `knowledge.delete` or `knowledge.bulk_delete` of one document. | writer | idempotent | no | yes | | [`knowledge.search`](operations/knowledge.md#knowledgesearch) | Search the user's uploaded document library — bills, contracts, receipts, resumes, policies, manuals, technical docs. | viewer | read | no | | | [`knowledge.source.add`](operations/knowledge.md#knowledgesourceadd) | Register a document source on a namespace, read with a shared credential, the caller's connected account, or a delegated Workspace crawl. | writer | write | no | yes | diff --git a/docs/reference/operations/knowledge.md b/docs/reference/operations/knowledge.md index cd8519353c9..ce82b776dff 100644 --- a/docs/reference/operations/knowledge.md +++ b/docs/reference/operations/knowledge.md @@ -551,6 +551,117 @@ How often agents opened each document over the last `days` (`knowledge.get` ledg | `window_days` | `int` | The look-back window the counts cover, in days, after clamping to 1-30. | | `reads` | `list[dict[str, Any]]` | [{source_uri, reads, agents, last_read_at}], most read first | +## `knowledge.reports.evidence` + +The reporter adds evidence to their own report, for example after a maintainer asked for it. + +`POST /v1/knowledge.reports.evidence` · MCP `loom_knowledge_reports_evidence` · role `writer` · write · 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. | +| `report_id` | `str` | required | | +| `evidence` | `list[str]` | required | References only, never copied text: gap:, reflection: or run:. | + +| Output field | Type | Meaning | +| --- | --- | --- | +| `report_id` | `str` | | +| `state` | `Literal['open', 'taken', 'needs_evidence', 'resolved', 'dismissed']` | | +| `version` | `int` | | + +## `knowledge.reports.get` + +One report, with the problem, the suggested correction and the evidence, when you can read its target. + +`POST /v1/knowledge.reports.get` · MCP `loom_knowledge_reports_get` · role `viewer` · read · 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. | +| `report_id` | `str` | required | | + +| Output field | Type | Meaning | +| --- | --- | --- | +| `found` | `bool` | | +| `report` | `KnowledgeReportDetail \| None` | | + +## `knowledge.reports.list` + +The namespace's report queue for maintainers, newest change first. + +`POST /v1/knowledge.reports.list` · MCP `loom_knowledge_reports_list` · 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. | +| `states` | `list[Literal['open', 'taken', 'needs_evidence', 'resolved', 'dismissed']]` | *(computed)* | | +| `kinds` | `list[Literal['missing', 'incorrect', 'outdated']]` | *(computed)* | | +| `target_kind` | `Literal['', 'memory', 'document']` | `''` | | +| `target_key` | `str` | `''` | | +| `assignee` | `str` | `''` | | +| `reporter` | `str` | `''` | | +| `limit` | `int` | `50` | | + +| Output field | Type | Meaning | +| --- | --- | --- | +| `reports` | `list[KnowledgeReport]` | | + +## `knowledge.reports.submit` + +Report that a memory claim or a document passage is incorrect or outdated, or that knowledge is missing. + +`POST /v1/knowledge.reports.submit` · MCP `loom_knowledge_reports_submit` · role `writer` · 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. | +| `agent` | `str` | `'-'` | The writing or reading agent; `'-'` or `'*'` means any agent where the op allows it. | +| `user_id` | `str` | `'-'` | The end user the row belongs to; `'-'` for none. | +| `session_id` | `str` | `'-'` | The session or conversation the row belongs to; `'-'` for none. | +| `run_id` | `str` | `''` | The run that hit the problem. | +| `kind` | `Literal['missing', 'incorrect', 'outdated']` | required | | +| `target_kind` | `Literal['', 'memory', 'document']` | `''` | memory or document; empty for a missing-knowledge report. | +| `target_key` | `str` | `''` | The memory key, or the document's source URI. | +| `target_version` | `int \| str` | `0` | The memory version or document revision you read; a decimal string keeps a memory version exact in JavaScript. | +| `target_sha256` | `str` | `''` | Hash of the content you read, when you have it. | +| `problem` | `str` | required | What is wrong or missing. | +| `suggested_correction` | `str` | `''` | | +| `evidence` | `list[str]` | *(computed)* | References only, never copied text: gap:, reflection: or run:. | +| `related` | `list[str]` | *(computed)* | Other report ids about the same problem. | + +| Output field | Type | Meaning | +| --- | --- | --- | +| `report_id` | `str` | | +| `state` | `Literal['open', 'taken', 'needs_evidence', 'resolved', 'dismissed']` | | +| `version` | `int` | | + +## `knowledge.reports.update` + +A maintainer takes, releases, asks for evidence on, resolves, dismisses or reopens a report, or links related reports. dismiss, request_evidence and reopen need a reason. resolve names the published… + +`POST /v1/knowledge.reports.update` · MCP `loom_knowledge_reports_update` · 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. | +| `report_id` | `str` | required | | +| `action` | `Literal['take', 'release', 'request_evidence', 'resolve', 'dismiss', 'reopen'] \| None` | `None` | | +| `reason` | `str` | `''` | | +| `resolution_revision` | `str` | `''` | | +| `related` | `list[str]` | *(computed)* | Report ids to link. | +| `expected_version` | `int \| None` | `None` | Refuse when the report changed since this version. | + +| Output field | Type | Meaning | +| --- | --- | --- | +| `report_id` | `str` | | +| `state` | `Literal['open', 'taken', 'needs_evidence', 'resolved', 'dismissed']` | | +| `version` | `int` | | + ## `knowledge.restore` Undo a `knowledge.delete` or `knowledge.bulk_delete` of one document. diff --git a/docs/reference/schema.md b/docs/reference/schema.md index a3033e4cbc4..f7357fce86b 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, -197 tables, 5 views and 19 materialized views in the `loom` and `loom_telemetry` databases; a `loom_telemetry` object keeps its database prefix. +198 tables, 5 views and 19 materialized views in the `loom` and `loom_telemetry` databases; a `loom_telemetry` object keeps its database prefix. #### Tables @@ -248,6 +248,7 @@ the `loom` tables each view reads, and, for each materialized view, its target, | `knowledge_ingestions` | `ReplacingMergeTree(version)` | `(org, namespace, ingestion_id)` | | `toDateTime(updated_at) + toIntervalDay(30)` | | | `knowledge_mirror_latch` | `KeeperMap('/loom/knowledge_mirror_latch')` | | | | | | `knowledge_mirrors` | `ReplacingMergeTree(version)` | `(org, namespace, mirror)` | | | | +| `knowledge_reports` | `ReplacingMergeTree(version)` | `(org, namespace, report_id)` | | | | | `knowledge_source_listings` | `ReplacingMergeTree(version)` | `(org, namespace, source_id)` | | | | | `knowledge_source_push` | `ReplacingMergeTree(version)` | `(org, namespace, source_id)` | | | | | `knowledge_sources` | `ReplacingMergeTree(version)` | `(org, namespace, name)` | | | | diff --git a/docs/reference/status.md b/docs/reference/status.md index b2167b58d5b..f04ab9b73bd 100644 --- a/docs/reference/status.md +++ b/docs/reference/status.md @@ -25,7 +25,7 @@ serves is in the [MCP reference](./mcp.md#toolsets). -379 operations, 265 of them experimental. +384 operations, 270 of them experimental. | Group | Stable | Experimental | | --- | --- | --- | @@ -51,7 +51,7 @@ serves is in the [MCP reference](./mcp.md#toolsets). | `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) | -| `knowledge` | 5 | [`knowledge.bulk_delete`](operations/knowledge.md#knowledgebulk_delete), [`knowledge.dataset_approve`](operations/knowledge.md#knowledgedataset_approve), [`knowledge.dataset_get`](operations/knowledge.md#knowledgedataset_get), [`knowledge.dedup_list`](operations/knowledge.md#knowledgededup_list), [`knowledge.dedup_resolve`](operations/knowledge.md#knowledgededup_resolve), [`knowledge.delete`](operations/knowledge.md#knowledgedelete), [`knowledge.formats`](operations/knowledge.md#knowledgeformats), [`knowledge.gaps.draft`](operations/knowledge.md#knowledgegapsdraft), [`knowledge.gaps.list`](operations/knowledge.md#knowledgegapslist), [`knowledge.ingest`](operations/knowledge.md#knowledgeingest), [`knowledge.ingest_cancel`](operations/knowledge.md#knowledgeingest_cancel), [`knowledge.ingest_status`](operations/knowledge.md#knowledgeingest_status), [`knowledge.inspect`](operations/knowledge.md#knowledgeinspect), [`knowledge.move`](operations/knowledge.md#knowledgemove), [`knowledge.outline`](operations/knowledge.md#knowledgeoutline), [`knowledge.query`](operations/knowledge.md#knowledgequery), [`knowledge.query_history.add`](operations/knowledge.md#knowledgequery_historyadd), [`knowledge.query_history.list`](operations/knowledge.md#knowledgequery_historylist), [`knowledge.query_history.remove`](operations/knowledge.md#knowledgequery_historyremove), [`knowledge.reads`](operations/knowledge.md#knowledgereads), [`knowledge.restore`](operations/knowledge.md#knowledgerestore), [`knowledge.source.add`](operations/knowledge.md#knowledgesourceadd), [`knowledge.source.check`](operations/knowledge.md#knowledgesourcecheck), [`knowledge.source.inspect`](operations/knowledge.md#knowledgesourceinspect), [`knowledge.source.list`](operations/knowledge.md#knowledgesourcelist), [`knowledge.source.parse_links`](operations/knowledge.md#knowledgesourceparse_links), [`knowledge.source.push_configure`](operations/knowledge.md#knowledgesourcepush_configure), [`knowledge.source.push_confirm`](operations/knowledge.md#knowledgesourcepush_confirm), [`knowledge.source.push_status`](operations/knowledge.md#knowledgesourcepush_status), [`knowledge.source.remove`](operations/knowledge.md#knowledgesourceremove), [`knowledge.source.rotate`](operations/knowledge.md#knowledgesourcerotate), [`knowledge.source.sync_now`](operations/knowledge.md#knowledgesourcesync_now), [`knowledge.source.update`](operations/knowledge.md#knowledgesourceupdate), [`knowledge.synthesize`](operations/knowledge.md#knowledgesynthesize), [`knowledge.update_metadata`](operations/knowledge.md#knowledgeupdate_metadata), [`knowledge.upsert`](operations/knowledge.md#knowledgeupsert) | +| `knowledge` | 5 | [`knowledge.bulk_delete`](operations/knowledge.md#knowledgebulk_delete), [`knowledge.dataset_approve`](operations/knowledge.md#knowledgedataset_approve), [`knowledge.dataset_get`](operations/knowledge.md#knowledgedataset_get), [`knowledge.dedup_list`](operations/knowledge.md#knowledgededup_list), [`knowledge.dedup_resolve`](operations/knowledge.md#knowledgededup_resolve), [`knowledge.delete`](operations/knowledge.md#knowledgedelete), [`knowledge.formats`](operations/knowledge.md#knowledgeformats), [`knowledge.gaps.draft`](operations/knowledge.md#knowledgegapsdraft), [`knowledge.gaps.list`](operations/knowledge.md#knowledgegapslist), [`knowledge.ingest`](operations/knowledge.md#knowledgeingest), [`knowledge.ingest_cancel`](operations/knowledge.md#knowledgeingest_cancel), [`knowledge.ingest_status`](operations/knowledge.md#knowledgeingest_status), [`knowledge.inspect`](operations/knowledge.md#knowledgeinspect), [`knowledge.move`](operations/knowledge.md#knowledgemove), [`knowledge.outline`](operations/knowledge.md#knowledgeoutline), [`knowledge.query`](operations/knowledge.md#knowledgequery), [`knowledge.query_history.add`](operations/knowledge.md#knowledgequery_historyadd), [`knowledge.query_history.list`](operations/knowledge.md#knowledgequery_historylist), [`knowledge.query_history.remove`](operations/knowledge.md#knowledgequery_historyremove), [`knowledge.reads`](operations/knowledge.md#knowledgereads), [`knowledge.reports.evidence`](operations/knowledge.md#knowledgereportsevidence), [`knowledge.reports.get`](operations/knowledge.md#knowledgereportsget), [`knowledge.reports.list`](operations/knowledge.md#knowledgereportslist), [`knowledge.reports.submit`](operations/knowledge.md#knowledgereportssubmit), [`knowledge.reports.update`](operations/knowledge.md#knowledgereportsupdate), [`knowledge.restore`](operations/knowledge.md#knowledgerestore), [`knowledge.source.add`](operations/knowledge.md#knowledgesourceadd), [`knowledge.source.check`](operations/knowledge.md#knowledgesourcecheck), [`knowledge.source.inspect`](operations/knowledge.md#knowledgesourceinspect), [`knowledge.source.list`](operations/knowledge.md#knowledgesourcelist), [`knowledge.source.parse_links`](operations/knowledge.md#knowledgesourceparse_links), [`knowledge.source.push_configure`](operations/knowledge.md#knowledgesourcepush_configure), [`knowledge.source.push_confirm`](operations/knowledge.md#knowledgesourcepush_confirm), [`knowledge.source.push_status`](operations/knowledge.md#knowledgesourcepush_status), [`knowledge.source.remove`](operations/knowledge.md#knowledgesourceremove), [`knowledge.source.rotate`](operations/knowledge.md#knowledgesourcerotate), [`knowledge.source.sync_now`](operations/knowledge.md#knowledgesourcesync_now), [`knowledge.source.update`](operations/knowledge.md#knowledgesourceupdate), [`knowledge.synthesize`](operations/knowledge.md#knowledgesynthesize), [`knowledge.update_metadata`](operations/knowledge.md#knowledgeupdate_metadata), [`knowledge.upsert`](operations/knowledge.md#knowledgeupsert) | | `learnings` | 0 | [`learnings.list`](operations/learnings.md#learningslist), [`learnings.quality`](operations/learnings.md#learningsquality), [`learnings.review`](operations/learnings.md#learningsreview) | | `memory` | 38 | [`memory.aggregate`](operations/memory.md#memoryaggregate), [`memory.append_batch`](operations/memory.md#memoryappend_batch), [`memory.apply`](operations/memory.md#memoryapply), [`memory.assign_category`](operations/memory.md#memoryassign_category), [`memory.auto_retirements`](operations/memory.md#memoryauto_retirements), [`memory.backlinks`](operations/memory.md#memorybacklinks), [`memory.copy_to`](operations/memory.md#memorycopy_to), [`memory.cross_promote`](operations/memory.md#memorycross_promote), [`memory.dedup_collapse`](operations/memory.md#memorydedup_collapse), [`memory.definitions.list`](operations/memory.md#memorydefinitionslist), [`memory.delete_version`](operations/memory.md#memorydelete_version), [`memory.demonstrate`](operations/memory.md#memorydemonstrate), [`memory.demote`](operations/memory.md#memorydemote), [`memory.exposure_summary`](operations/memory.md#memoryexposure_summary), [`memory.extraction_retry_mine`](operations/memory.md#memoryextraction_retry_mine), [`memory.extraction_status_mine`](operations/memory.md#memoryextraction_status_mine), [`memory.history`](operations/memory.md#memoryhistory), [`memory.import`](operations/memory.md#memoryimport), [`memory.import_curated`](operations/memory.md#memoryimport_curated), [`memory.inspect`](operations/memory.md#memoryinspect), [`memory.keys`](operations/memory.md#memorykeys), [`memory.lineage`](operations/memory.md#memorylineage), [`memory.lock`](operations/memory.md#memorylock), [`memory.outcome`](operations/memory.md#memoryoutcome), [`memory.outline`](operations/memory.md#memoryoutline), [`memory.owner_report`](operations/memory.md#memoryowner_report), [`memory.pin`](operations/memory.md#memorypin), [`memory.promote`](operations/memory.md#memorypromote), [`memory.proposal_decide`](operations/memory.md#memoryproposal_decide), [`memory.proposals`](operations/memory.md#memoryproposals), [`memory.record.conflicts`](operations/memory.md#memoryrecordconflicts), [`memory.redact`](operations/memory.md#memoryredact), [`memory.reindex`](operations/memory.md#memoryreindex), [`memory.reject`](operations/memory.md#memoryreject), [`memory.related`](operations/memory.md#memoryrelated), [`memory.stack`](operations/memory.md#memorystack), [`memory.statuses`](operations/memory.md#memorystatuses), [`memory.sweep_expired`](operations/memory.md#memorysweep_expired), [`memory.timeline`](operations/memory.md#memorytimeline), [`memory.touch`](operations/memory.md#memorytouch), [`memory.unlock`](operations/memory.md#memoryunlock), [`memory.unpin`](operations/memory.md#memoryunpin) | | `memory_schema` | 1 | [`memory_schema.approve`](operations/memory_schema.md#memory_schemaapprove), [`memory_schema.list`](operations/memory_schema.md#memory_schemalist), [`memory_schema.propose`](operations/memory_schema.md#memory_schemapropose) | diff --git a/llms.txt b/llms.txt index 242862c80f3..277ebf57f0e 100644 --- a/llms.txt +++ b/llms.txt @@ -177,6 +177,7 @@ Start with [the docs map](docs/index.md). To install Loom, a coding agent reads - [Google ADK memory service](docs/architecture/google-adk-adapter.md): The Google ADK adapter implements the framework's memory service through Loom's Python and TypeScript SDKs. - [Haystack document store and retriever](docs/architecture/haystack-adapter.md): The optional Haystack 3.5 adapter implements its document-store protocol and a native retrieval component through the synchronous Loom SDK. - [Knowledge gaps](docs/architecture/knowledge-gaps.md): Loom records the searches that found nothing a caller could use and groups them, once a day, into knowledge gaps: the questions several people asked that the namespace's memory and documents do not answer. +- [Knowledge reports](docs/architecture/knowledge-reports.md): A knowledge report says that a memory claim or a document is incorrect or outdated, or that the namespace is missing knowledge. - [Live connected-source search](docs/architecture/live-source-search.md): `search.query(live=true)` adds an ephemeral section from the asker's own connected Drive, Notion and Linear registrations. - [LLM and embedding architecture](docs/architecture/llm-architecture.md): Loom uses pluggable embedders and model clients configured through server settings. - [Memory architecture](docs/architecture/memory-architecture.md): The memory plane stores facts in `loom.memory`, makes them searchable through `loom.memory_embeddings`, and derives evidence, chunks, graph rows and statistics from them. diff --git a/schemas/migrations/120_knowledge_reports.sql b/schemas/migrations/120_knowledge_reports.sql new file mode 100644 index 00000000000..21c237177f1 --- /dev/null +++ b/schemas/migrations/120_knowledge_reports.sql @@ -0,0 +1,49 @@ +-- Knowledge problem reports (docs/architecture/knowledge-reports.md). +-- +-- One row per report version: submit writes version 1 and each disposition change the +-- next, read with FINAL. A report about a memory claim holds its key, version and +-- content hash; one about a document holds its source URI, revision and content hash; +-- a missing-knowledge report holds no target. Each version carries the `actor` and +-- `source_class` the server stamped on the write that made it, and in `written_by` the +-- person that token stands for, folded as the reporter is, whom a user erasure matches +-- (a service account's version names its creator). `problem` and +-- `suggested_correction` are the reporter's words, erased with the reporter (user erasure) +-- and the namespace; `reason`, and the `resolution_revision` of a report with no target, +-- are the words of the maintainer `reason_by` names, erased with them. Nothing is copied +-- from the target: evidence is references only (gap, reflection and run ids). Older builds +-- do not read this table. +CREATE TABLE IF NOT EXISTS loom.knowledge_reports +( + `org` LowCardinality(String), + `namespace` LowCardinality(String), + `agent` LowCardinality(String) DEFAULT '-', + `user_id` String DEFAULT '-', + `session_id` String DEFAULT '-', + `report_id` String, + `version` UInt64, + `kind` LowCardinality(String), + `state` LowCardinality(String), + `target_kind` LowCardinality(String) DEFAULT '', + `target_key` String DEFAULT '', + `target_version` UInt64 DEFAULT 0, + `target_sha256` String DEFAULT '', + `problem` String, + `suggested_correction` String DEFAULT '', + `run_id` String DEFAULT '', + `evidence` Array(String) DEFAULT [], + `related` Array(String) DEFAULT [], + `reporter` String, + `assignee` String DEFAULT '', + `reason` String DEFAULT '', + `reason_by` String DEFAULT '', + `resolution_revision` String DEFAULT '', + `actor` String DEFAULT '', + `written_by` String DEFAULT '', + `source_class` LowCardinality(String) DEFAULT '', + `created_at` DateTime64(3, 'UTC'), + `updated_at` DateTime64(3, 'UTC') DEFAULT now64(3), + `deleted` Bool DEFAULT false +) +ENGINE = ReplacingMergeTree(version) +ORDER BY (org, namespace, report_id) +SETTINGS non_replicated_deduplication_window = 1000; diff --git a/schemas/schema.sql b/schemas/schema.sql index e0ae676e712..1e95ce6e284 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: 197 tables + 5 views + 19 materialized views. +-- Counts: 198 tables + 5 views + 19 materialized views. CREATE DATABASE IF NOT EXISTS `loom`; CREATE DATABASE IF NOT EXISTS `loom_telemetry`; -- ====================================================================== --- Tables (197) +-- Tables (198) -- ====================================================================== -- loom.acl_versions @@ -2258,6 +2258,43 @@ ENGINE = ReplacingMergeTree(version) ORDER BY (org, namespace, mirror) SETTINGS non_replicated_deduplication_window = 1000, index_granularity = 8192; +-- loom.knowledge_reports +CREATE TABLE IF NOT EXISTS loom.knowledge_reports +( + `org` LowCardinality(String), + `namespace` LowCardinality(String), + `agent` LowCardinality(String) DEFAULT '-', + `user_id` String DEFAULT '-', + `session_id` String DEFAULT '-', + `report_id` String, + `version` UInt64, + `kind` LowCardinality(String), + `state` LowCardinality(String), + `target_kind` LowCardinality(String) DEFAULT '', + `target_key` String DEFAULT '', + `target_version` UInt64 DEFAULT 0, + `target_sha256` String DEFAULT '', + `problem` String, + `suggested_correction` String DEFAULT '', + `run_id` String DEFAULT '', + `evidence` Array(String) DEFAULT [], + `related` Array(String) DEFAULT [], + `reporter` String, + `assignee` String DEFAULT '', + `reason` String DEFAULT '', + `reason_by` String DEFAULT '', + `resolution_revision` String DEFAULT '', + `actor` String DEFAULT '', + `written_by` String DEFAULT '', + `source_class` LowCardinality(String) DEFAULT '', + `created_at` DateTime64(3, 'UTC'), + `updated_at` DateTime64(3, 'UTC') DEFAULT now64(3), + `deleted` Bool DEFAULT false +) +ENGINE = ReplacingMergeTree(version) +ORDER BY (org, namespace, report_id) +SETTINGS non_replicated_deduplication_window = 1000, index_granularity = 8192; + -- loom.knowledge_source_listings CREATE TABLE IF NOT EXISTS loom.knowledge_source_listings ( diff --git a/scripts/codegen/sdk_go_gen.py b/scripts/codegen/sdk_go_gen.py index d430b6b22fd..18b83a9d387 100644 --- a/scripts/codegen/sdk_go_gen.py +++ b/scripts/codegen/sdk_go_gen.py @@ -86,11 +86,15 @@ "memory.update": {"agent"}, # Omission keeps the namespace-wide ambiguity check. } _SNAPSHOT_KEY = "NamespaceSnapshotOutput" -# conflicts.list reads and compares the memory row's ClickHouse UInt64 version. +# conflicts.list compares the memory row's ClickHouse UInt64 version, and a report's +# target_version is a UInt64 column; both overflow int64. _UINT64_FIELDS = { - "ConflictsListInput": "before_version", - "ConflictsListOutput": "next_before_version", - "_ConflictRow": "version", + ("server.memory.api.models_conflicts", "ConflictsListInput"): "before_version", + ("server.memory.api.models_conflicts", "ConflictsListOutput"): "next_before_version", + ("server.memory.api.models_conflicts", "_ConflictRow"): "version", + ("server.knowledge.api.models_reports", "KnowledgeReportsSubmitInput"): "target_version", + ("server.knowledge.api.models_reports", "KnowledgeReport"): "target_version", + ("server.knowledge.api.models_reports", "KnowledgeReportDetail"): "target_version", } # Keep the existing Client.Search method and SearchHit result type. _GROUP_NAMES = {"search": "LoomSearch"} @@ -186,9 +190,8 @@ def model_schema(self, schema: core_schema.ModelSchema) -> JsonSchemaValue: result.pop("required", None) if defaults := _factory_defaults(model): result["x-loom-factory-defaults"] = self.encode_default(defaults) - if model.__module__ == "server.memory.api.models_conflicts": - if field := _UINT64_FIELDS.get(model.__name__): - result["properties"][field]["x-loom-go-uint64"] = True + if field := _UINT64_FIELDS.get((model.__module__, model.__name__)): + result["properties"][field]["x-loom-go-uint64"] = True return result @@ -264,6 +267,9 @@ def render(self, schema: dict[str, Any], *, unsigned: bool = False) -> str: return self.names[_ref_key(schema["$ref"])] if "anyOf" in schema: branches = [item for item in schema["anyOf"] if item.get("type") != "null"] + # A UInt64 that also takes a decimal string for JavaScript: Go's uint64 is exact. + if unsigned and {item.get("type") for item in branches} == {"integer", "string"}: + return "*uint64" if len(branches) < len(schema["anyOf"]) else "uint64" if len(branches) == 1 and len(branches) < len(schema["anyOf"]): inner = self.render(branches[0], unsigned=unsigned) return inner if inner == _RAW else f"*{inner}" diff --git a/sdk/go/client.gen.go b/sdk/go/client.gen.go index bd3ffc90bf9..bdfb2245357 100644 --- a/sdk/go/client.gen.go +++ b/sdk/go/client.gen.go @@ -1373,6 +1373,42 @@ type KnowledgeReadsInput = wire.KnowledgeReadsInput // KnowledgeReadsOutput is the response from knowledge.reads. type KnowledgeReadsOutput = wire.KnowledgeReadsOutput +// KnowledgeReport is a model used by Loom operations. +type KnowledgeReport = wire.KnowledgeReport + +// KnowledgeReportDetail is a model used by Loom operations. +type KnowledgeReportDetail = wire.KnowledgeReportDetail + +// KnowledgeReportsEvidenceInput is the request to knowledge.reports.evidence. +type KnowledgeReportsEvidenceInput = wire.KnowledgeReportsEvidenceInput + +// KnowledgeReportsEvidenceOutput is the response from knowledge.reports.evidence. +type KnowledgeReportsEvidenceOutput = wire.KnowledgeReportsEvidenceOutput + +// KnowledgeReportsGetInput is the request to knowledge.reports.get. +type KnowledgeReportsGetInput = wire.KnowledgeReportsGetInput + +// KnowledgeReportsGetOutput is the response from knowledge.reports.get. +type KnowledgeReportsGetOutput = wire.KnowledgeReportsGetOutput + +// KnowledgeReportsListInput is the request to knowledge.reports.list. +type KnowledgeReportsListInput = wire.KnowledgeReportsListInput + +// KnowledgeReportsListOutput is the response from knowledge.reports.list. +type KnowledgeReportsListOutput = wire.KnowledgeReportsListOutput + +// KnowledgeReportsSubmitInput is the request to knowledge.reports.submit. +type KnowledgeReportsSubmitInput = wire.KnowledgeReportsSubmitInput + +// KnowledgeReportsSubmitOutput is the response from knowledge.reports.submit. +type KnowledgeReportsSubmitOutput = wire.KnowledgeReportsSubmitOutput + +// KnowledgeReportsUpdateInput is the request to knowledge.reports.update. +type KnowledgeReportsUpdateInput = wire.KnowledgeReportsUpdateInput + +// KnowledgeReportsUpdateOutput is the response from knowledge.reports.update. +type KnowledgeReportsUpdateOutput = wire.KnowledgeReportsUpdateOutput + // KnowledgeRestoreInput is the request to knowledge.restore. type KnowledgeRestoreInput = wire.KnowledgeRestoreInput @@ -5648,6 +5684,72 @@ func (s KnowledgeService) Reads(ctx context.Context, opts ...Option[KnowledgeRea return callOperation[KnowledgeReadsOutput](s.client, ctx, "knowledge.reads", in) } +// ReportsEvidence calls knowledge.reports.evidence. +func (s KnowledgeService) ReportsEvidence(ctx context.Context, in KnowledgeReportsEvidenceInput) (*KnowledgeReportsEvidenceOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeReportsEvidenceOutput](s.client, ctx, "knowledge.reports.evidence", in) +} + +// ReportsGet calls knowledge.reports.get. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) ReportsGet(ctx context.Context, reportID string, opts ...Option[KnowledgeReportsGetInput]) (*KnowledgeReportsGetOutput, error) { + in := applyOptions(opts) + in.ReportID = reportID + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeReportsGetOutput](s.client, ctx, "knowledge.reports.get", in) +} + +// ReportsList calls knowledge.reports.list. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) ReportsList(ctx context.Context, opts ...Option[KnowledgeReportsListInput]) (*KnowledgeReportsListOutput, error) { + in := applyOptions(opts) + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeReportsListOutput](s.client, ctx, "knowledge.reports.list", in) +} + +// ReportsSubmit calls knowledge.reports.submit. +func (s KnowledgeService) ReportsSubmit(ctx context.Context, in KnowledgeReportsSubmitInput) (*KnowledgeReportsSubmitOutput, error) { + if in.Agent == nil && s.client.identity.Agent != "" { + in.Agent = Ptr(s.client.identity.Agent) + } + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeReportsSubmitOutput](s.client, ctx, "knowledge.reports.submit", in) +} + +// ReportsUpdate calls knowledge.reports.update. +// Use WithInput to supply additional request fields. +func (s KnowledgeService) ReportsUpdate(ctx context.Context, reportID string, opts ...Option[KnowledgeReportsUpdateInput]) (*KnowledgeReportsUpdateOutput, error) { + in := applyOptions(opts) + in.ReportID = reportID + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[KnowledgeReportsUpdateOutput](s.client, ctx, "knowledge.reports.update", in) +} + // Restore calls knowledge.restore. // Use WithInput to supply additional request fields. func (s KnowledgeService) Restore(ctx context.Context, sourceURI string, opts ...Option[KnowledgeRestoreInput]) (*KnowledgeRestoreOutput, error) { diff --git a/sdk/go/wire/models.gen.go b/sdk/go/wire/models.gen.go index e455dc9c320..286f8366ece 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: 1dafd83b6b775ec8e510f2db051c5b37bac6079e81a01ef9771c0236adf12e9d +// Registry model schema SHA-256: 2d15af6774b98358d6aa9ed5577838ffd7dce9c32f3c1fcfc003ac19eac1926d // Package wire contains the Go requests and responses for Loom operations. package wire @@ -5478,6 +5478,153 @@ type KnowledgeReadsOutput struct { Reads *[]map[string]json.RawMessage `json:"reads,omitempty"` } +// KnowledgeReport is a model used by Loom operations. +type KnowledgeReport struct { + ReportID string `json:"report_id"` + Version int64 `json:"version"` + Kind string `json:"kind"` + State string `json:"state"` + TargetKind *string `json:"target_kind,omitempty"` + TargetKey *string `json:"target_key,omitempty"` + TargetVersion *uint64 `json:"target_version,omitempty"` + TargetVersionText *string `json:"target_version_text,omitempty"` + Reporter string `json:"reporter"` + Assignee *string `json:"assignee,omitempty"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` +} + +// KnowledgeReportDetail is a model used by Loom operations. +type KnowledgeReportDetail struct { + ReportID string `json:"report_id"` + Version int64 `json:"version"` + Kind string `json:"kind"` + State string `json:"state"` + TargetKind *string `json:"target_kind,omitempty"` + TargetKey *string `json:"target_key,omitempty"` + TargetVersion *uint64 `json:"target_version,omitempty"` + TargetVersionText *string `json:"target_version_text,omitempty"` + Reporter string `json:"reporter"` + Assignee *string `json:"assignee,omitempty"` + CreatedAt string `json:"created_at"` + UpdatedAt string `json:"updated_at"` + TargetChanged *bool `json:"target_changed,omitempty"` + Problem string `json:"problem"` + SuggestedCorrection *string `json:"suggested_correction,omitempty"` + RunID *string `json:"run_id,omitempty"` + Evidence *[]string `json:"evidence,omitempty"` + Related *[]string `json:"related,omitempty"` + Reason *string `json:"reason,omitempty"` + ResolutionRevision *string `json:"resolution_revision,omitempty"` + TargetReadable *bool `json:"target_readable,omitempty"` +} + +// KnowledgeReportsEvidenceInput is the request to knowledge.reports.evidence. +type KnowledgeReportsEvidenceInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + ReportID string `json:"report_id"` + Evidence []string `json:"evidence"` +} + +// KnowledgeReportsEvidenceOutput is the response from knowledge.reports.evidence. +type KnowledgeReportsEvidenceOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + ReportID string `json:"report_id"` + State string `json:"state"` + Version int64 `json:"version"` +} + +// KnowledgeReportsGetInput is the request to knowledge.reports.get. +type KnowledgeReportsGetInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + ReportID string `json:"report_id"` +} + +// KnowledgeReportsGetOutput is the response from knowledge.reports.get. +type KnowledgeReportsGetOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Found bool `json:"found"` + Report Optional[KnowledgeReportDetail] `json:"report,omitempty"` +} + +// KnowledgeReportsListInput is the request to knowledge.reports.list. +type KnowledgeReportsListInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + States *[]string `json:"states,omitempty"` + Kinds *[]string `json:"kinds,omitempty"` + TargetKind *string `json:"target_kind,omitempty"` + TargetKey *string `json:"target_key,omitempty"` + Assignee *string `json:"assignee,omitempty"` + Reporter *string `json:"reporter,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// KnowledgeReportsListOutput is the response from knowledge.reports.list. +type KnowledgeReportsListOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Reports *[]KnowledgeReport `json:"reports,omitempty"` +} + +// KnowledgeReportsSubmitInput is the request to knowledge.reports.submit. +type KnowledgeReportsSubmitInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + RunID *string `json:"run_id,omitempty"` + Kind string `json:"kind"` + TargetKind *string `json:"target_kind,omitempty"` + TargetKey *string `json:"target_key,omitempty"` + TargetVersion *uint64 `json:"target_version,omitempty"` + TargetSHA256 *string `json:"target_sha256,omitempty"` + Problem string `json:"problem"` + SuggestedCorrection *string `json:"suggested_correction,omitempty"` + Evidence *[]string `json:"evidence,omitempty"` + Related *[]string `json:"related,omitempty"` +} + +// KnowledgeReportsSubmitOutput is the response from knowledge.reports.submit. +type KnowledgeReportsSubmitOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + ReportID string `json:"report_id"` + State string `json:"state"` + Version int64 `json:"version"` +} + +// KnowledgeReportsUpdateInput is the request to knowledge.reports.update. +type KnowledgeReportsUpdateInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + ReportID string `json:"report_id"` + Action Optional[string] `json:"action,omitempty"` + Reason *string `json:"reason,omitempty"` + ResolutionRevision *string `json:"resolution_revision,omitempty"` + Related *[]string `json:"related,omitempty"` + ExpectedVersion Optional[int64] `json:"expected_version,omitempty"` +} + +// KnowledgeReportsUpdateOutput is the response from knowledge.reports.update. +type KnowledgeReportsUpdateOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + ReportID string `json:"report_id"` + State string `json:"state"` + Version int64 `json:"version"` +} + // KnowledgeRestoreInput is the request to knowledge.restore. type KnowledgeRestoreInput struct { Org string `json:"org"` diff --git a/sdk/go/wire/models_test.go b/sdk/go/wire/models_test.go index b907b7b213c..7f16641d40b 100644 --- a/sdk/go/wire/models_test.go +++ b/sdk/go/wire/models_test.go @@ -2,6 +2,7 @@ package wire_test import ( "encoding/json" + "math" "testing" "github.com/ClickHouse/loom/sdk/go/wire" @@ -87,6 +88,28 @@ func TestDecodeProjectedMemoryGet(t *testing.T) { } } +func TestDecodeKnowledgeReportsAtTheLargestTargetVersion(t *testing.T) { + // target_version is a ClickHouse UInt64, so the API accepts up to its maximum. + var got wire.KnowledgeReportsGetOutput + if err := json.Unmarshal([]byte(`{"found":true,"report":{"target_version":18446744073709551615}}`), &got); err != nil { + t.Fatal(err) + } + report, ok := got.Report.Get() + if !ok || report.TargetVersion == nil || *report.TargetVersion != math.MaxUint64 { + t.Fatal("get lost the largest target version") + } + var list wire.KnowledgeReportsListOutput + if err := json.Unmarshal([]byte(`{"reports":[{"target_version":18446744073709551615}]}`), &list); err != nil { + t.Fatal(err) + } + if list.Reports == nil || len(*list.Reports) != 1 { + t.Fatal("list lost its report") + } + if v := (*list.Reports)[0].TargetVersion; v == nil || *v != math.MaxUint64 { + t.Fatal("list lost the largest target version") + } +} + func TestDecodeProjectedMemoryGetDistinguishesNullAndOmitted(t *testing.T) { var out wire.MemoryGetOutput if err := json.Unmarshal([]byte(`{"found":true,"expires_at":null}`), &out); err != nil { diff --git a/sdk/python/loom/client.py b/sdk/python/loom/client.py index ce08b6daa61..75f5c40cf8e 100644 --- a/sdk/python/loom/client.py +++ b/sdk/python/loom/client.py @@ -1525,6 +1525,51 @@ async def reads( "_ops.KnowledgeReadsOutput", await self._agent.call("knowledge.reads", body, **options) ) + async def reports_evidence( + self, body: _ops.KnowledgeReportsEvidenceBody | None = None, /, **options: Any + ) -> _ops.KnowledgeReportsEvidenceOutput: + """`knowledge.reports.evidence`.""" + return cast( + "_ops.KnowledgeReportsEvidenceOutput", + await self._agent.call("knowledge.reports.evidence", body, **options), + ) + + async def reports_get( + self, body: _ops.KnowledgeReportsGetBody | None = None, /, **options: Any + ) -> _ops.KnowledgeReportsGetOutput: + """`knowledge.reports.get`.""" + return cast( + "_ops.KnowledgeReportsGetOutput", + await self._agent.call("knowledge.reports.get", body, **options), + ) + + async def reports_list( + self, body: _ops.KnowledgeReportsListBody | None = None, /, **options: Any + ) -> _ops.KnowledgeReportsListOutput: + """`knowledge.reports.list`.""" + return cast( + "_ops.KnowledgeReportsListOutput", + await self._agent.call("knowledge.reports.list", body, **options), + ) + + async def reports_submit( + self, body: _ops.KnowledgeReportsSubmitBody | None = None, /, **options: Any + ) -> _ops.KnowledgeReportsSubmitOutput: + """`knowledge.reports.submit`.""" + return cast( + "_ops.KnowledgeReportsSubmitOutput", + await self._agent.call("knowledge.reports.submit", body, **options), + ) + + async def reports_update( + self, body: _ops.KnowledgeReportsUpdateBody | None = None, /, **options: Any + ) -> _ops.KnowledgeReportsUpdateOutput: + """`knowledge.reports.update`.""" + return cast( + "_ops.KnowledgeReportsUpdateOutput", + await self._agent.call("knowledge.reports.update", body, **options), + ) + async def restore( self, body: _ops.KnowledgeRestoreBody | None = None, /, **options: Any ) -> _ops.KnowledgeRestoreOutput: diff --git a/sdk/python/loom/ops.py b/sdk/python/loom/ops.py index fc1862f0479..7b700505aa5 100644 --- a/sdk/python/loom/ops.py +++ b/sdk/python/loom/ops.py @@ -193,6 +193,11 @@ class OpSpec: "knowledge.query_history.list", "knowledge.query_history.remove", "knowledge.reads", + "knowledge.reports.evidence", + "knowledge.reports.get", + "knowledge.reports.list", + "knowledge.reports.submit", + "knowledge.reports.update", "knowledge.restore", "knowledge.search", "knowledge.source.add", @@ -575,6 +580,11 @@ class OpSpec: "knowledge.query_history.list", "knowledge.query_history.remove", "knowledge.reads", + "knowledge.reports.evidence", + "knowledge.reports.get", + "knowledge.reports.list", + "knowledge.reports.submit", + "knowledge.reports.update", "knowledge.restore", "knowledge.search", "knowledge.source.add", @@ -2651,6 +2661,66 @@ class OpSpec: False, True, ), + "knowledge.reports.evidence": OpSpec( + "knowledge.reports.evidence", + "KnowledgeReportsEvidenceInput", + "KnowledgeReportsEvidenceBody", + "KnowledgeReportsEvidenceOutput", + False, + "writer", + "experimental", + 300, + False, + False, + ), + "knowledge.reports.get": OpSpec( + "knowledge.reports.get", + "KnowledgeReportsGetInput", + "KnowledgeReportsGetBody", + "KnowledgeReportsGetOutput", + True, + "viewer", + "experimental", + 100, + False, + True, + ), + "knowledge.reports.list": OpSpec( + "knowledge.reports.list", + "KnowledgeReportsListInput", + "KnowledgeReportsListBody", + "KnowledgeReportsListOutput", + True, + "admin", + "experimental", + 200, + False, + False, + ), + "knowledge.reports.submit": OpSpec( + "knowledge.reports.submit", + "KnowledgeReportsSubmitInput", + "KnowledgeReportsSubmitBody", + "KnowledgeReportsSubmitOutput", + True, + "writer", + "experimental", + 400, + False, + False, + ), + "knowledge.reports.update": OpSpec( + "knowledge.reports.update", + "KnowledgeReportsUpdateInput", + "KnowledgeReportsUpdateBody", + "KnowledgeReportsUpdateOutput", + False, + "admin", + "experimental", + 300, + True, + False, + ), "knowledge.restore": OpSpec( "knowledge.restore", "KnowledgeRestoreInput", @@ -11887,6 +11957,204 @@ class KnowledgeReadsOutput(TypedDict, total=False): reads: NotRequired[list[dict[str, Any]]] +class KnowledgeReportsEvidenceInput(TypedDict, total=False): + "The reporter adds evidence to their own report, for example after a maintainer" + + org: Required[str] + namespace: Required[str] + report_id: Required[str] + evidence: Required[list[str]] + + +class KnowledgeReportsEvidenceBody(TypedDict, total=False): + "The reporter adds evidence to their own report, for example after a maintainer" + + org: NotRequired[str] + namespace: NotRequired[str] + report_id: Required[str] + evidence: Required[list[str]] + + +class KnowledgeReportsEvidenceOutput(TypedDict, total=False): + report_id: Required[str] + state: Required[Literal["open", "taken", "needs_evidence", "resolved", "dismissed"]] + version: Required[int] + + +class KnowledgeReportsGetInput(TypedDict, total=False): + "One report, with the problem, the suggested correction and the evidence, when you" + + org: Required[str] + namespace: Required[str] + report_id: Required[str] + + +class KnowledgeReportsGetBody(TypedDict, total=False): + "One report, with the problem, the suggested correction and the evidence, when you" + + org: NotRequired[str] + namespace: NotRequired[str] + report_id: Required[str] + + +class KnowledgeReportsGetOutput(TypedDict, total=False): + found: Required[bool] + report: NotRequired[Optional["KnowledgeReportDetail"]] + + +class KnowledgeReportDetail(TypedDict, total=False): + report_id: Required[str] + version: Required[int] + kind: Required[Literal["missing", "incorrect", "outdated"]] + state: Required[Literal["open", "taken", "needs_evidence", "resolved", "dismissed"]] + target_kind: NotRequired[Literal["", "memory", "document"]] + target_key: NotRequired[str] + target_version: NotRequired[int] + target_version_text: NotRequired[str] + reporter: Required[str] + assignee: NotRequired[str] + created_at: Required[str] # date-time as ISO-8601 text + updated_at: Required[str] # date-time as ISO-8601 text + target_changed: NotRequired[bool] + problem: Required[str] + suggested_correction: NotRequired[str] + run_id: NotRequired[str] + evidence: NotRequired[list[str]] + related: NotRequired[list[str]] + reason: NotRequired[str] + resolution_revision: NotRequired[str] + target_readable: NotRequired[bool] + + +class KnowledgeReportsListInput(TypedDict, total=False): + "The namespace's report queue for maintainers, newest change first. Rows carry no" + + org: Required[str] + namespace: Required[str] + states: NotRequired[list[Literal["open", "taken", "needs_evidence", "resolved", "dismissed"]]] + kinds: NotRequired[list[Literal["missing", "incorrect", "outdated"]]] + target_kind: NotRequired[Literal["", "memory", "document"]] + target_key: NotRequired[str] + assignee: NotRequired[str] + reporter: NotRequired[str] + limit: NotRequired[int] + + +class KnowledgeReportsListBody(TypedDict, total=False): + "The namespace's report queue for maintainers, newest change first. Rows carry no" + + org: NotRequired[str] + namespace: NotRequired[str] + states: NotRequired[list[Literal["open", "taken", "needs_evidence", "resolved", "dismissed"]]] + kinds: NotRequired[list[Literal["missing", "incorrect", "outdated"]]] + target_kind: NotRequired[Literal["", "memory", "document"]] + target_key: NotRequired[str] + assignee: NotRequired[str] + reporter: NotRequired[str] + limit: NotRequired[int] + + +class KnowledgeReportsListOutput(TypedDict, total=False): + reports: NotRequired[list["KnowledgeReport"]] + + +class KnowledgeReport(TypedDict, total=False): + report_id: Required[str] + version: Required[int] + kind: Required[Literal["missing", "incorrect", "outdated"]] + state: Required[Literal["open", "taken", "needs_evidence", "resolved", "dismissed"]] + target_kind: NotRequired[Literal["", "memory", "document"]] + target_key: NotRequired[str] + target_version: NotRequired[int] + target_version_text: NotRequired[str] + reporter: Required[str] + assignee: NotRequired[str] + created_at: Required[str] # date-time as ISO-8601 text + updated_at: Required[str] # date-time as ISO-8601 text + + +class KnowledgeReportsSubmitInput(TypedDict, total=False): + "Report that a memory claim or a document passage is incorrect or outdated, or that" + + org: Required[str] + namespace: Required[str] + agent: NotRequired[str] + user_id: NotRequired[str] + session_id: NotRequired[str] + run_id: NotRequired[str] + kind: Required[Literal["missing", "incorrect", "outdated"]] + target_kind: NotRequired[Literal["", "memory", "document"]] + target_key: NotRequired[str] + target_version: NotRequired[Union[int, str]] + target_sha256: NotRequired[str] + problem: Required[str] + suggested_correction: NotRequired[str] + evidence: NotRequired[list[str]] + related: NotRequired[list[str]] + + +class KnowledgeReportsSubmitBody(TypedDict, total=False): + "Report that a memory claim or a document passage is incorrect or outdated, or that" + + org: NotRequired[str] + namespace: NotRequired[str] + agent: NotRequired[str] + user_id: NotRequired[str] + session_id: NotRequired[str] + run_id: NotRequired[str] + kind: Required[Literal["missing", "incorrect", "outdated"]] + target_kind: NotRequired[Literal["", "memory", "document"]] + target_key: NotRequired[str] + target_version: NotRequired[Union[int, str]] + target_sha256: NotRequired[str] + problem: Required[str] + suggested_correction: NotRequired[str] + evidence: NotRequired[list[str]] + related: NotRequired[list[str]] + + +class KnowledgeReportsSubmitOutput(TypedDict, total=False): + report_id: Required[str] + state: Required[Literal["open", "taken", "needs_evidence", "resolved", "dismissed"]] + version: Required[int] + + +class KnowledgeReportsUpdateInput(TypedDict, total=False): + "A maintainer takes, releases, asks for evidence on, resolves, dismisses or reopens" + + org: Required[str] + namespace: Required[str] + report_id: Required[str] + action: NotRequired[ + Optional[Literal["take", "release", "request_evidence", "resolve", "dismiss", "reopen"]] + ] + reason: NotRequired[str] + resolution_revision: NotRequired[str] + related: NotRequired[list[str]] + expected_version: NotRequired[Optional[int]] + + +class KnowledgeReportsUpdateBody(TypedDict, total=False): + "A maintainer takes, releases, asks for evidence on, resolves, dismisses or reopens" + + org: NotRequired[str] + namespace: NotRequired[str] + report_id: Required[str] + action: NotRequired[ + Optional[Literal["take", "release", "request_evidence", "resolve", "dismiss", "reopen"]] + ] + reason: NotRequired[str] + resolution_revision: NotRequired[str] + related: NotRequired[list[str]] + expected_version: NotRequired[Optional[int]] + + +class KnowledgeReportsUpdateOutput(TypedDict, total=False): + report_id: Required[str] + state: Required[Literal["open", "taken", "needs_evidence", "resolved", "dismissed"]] + version: Required[int] + + class KnowledgeRestoreInput(TypedDict, total=False): "Undo a `knowledge.delete` or `knowledge.bulk_delete` of one document." diff --git a/sdk/ruby/lib/clickhouse/loom/generated/ops.rb b/sdk/ruby/lib/clickhouse/loom/generated/ops.rb index d413c34c68b..9faad538a75 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 = 379 + OP_COUNT = 384 # The declared spec of every served op, by name; the HTTP path is /v1/. OPS = { @@ -166,6 +166,11 @@ module Generated "knowledge.query_history.list" => OpSpec.new("knowledge.query_history.list", "knowledge", "query_history_list", true, false, "admin", "experimental", %w[fields org namespace limit].freeze, %w[org namespace].freeze), "knowledge.query_history.remove" => OpSpec.new("knowledge.query_history.remove", "knowledge", "query_history_remove", true, false, "admin", "experimental", %w[org namespace name].freeze, %w[org namespace name].freeze), "knowledge.reads" => OpSpec.new("knowledge.reads", "knowledge", "reads", true, true, "viewer", "experimental", %w[org namespace days source_uris].freeze, %w[org namespace].freeze), + "knowledge.reports.evidence" => OpSpec.new("knowledge.reports.evidence", "knowledge", "reports_evidence", false, false, "writer", "experimental", %w[org namespace report_id evidence].freeze, %w[org namespace report_id evidence].freeze), + "knowledge.reports.get" => OpSpec.new("knowledge.reports.get", "knowledge", "reports_get", true, true, "viewer", "experimental", %w[org namespace report_id].freeze, %w[org namespace report_id].freeze), + "knowledge.reports.list" => OpSpec.new("knowledge.reports.list", "knowledge", "reports_list", true, false, "admin", "experimental", %w[org namespace states kinds target_kind target_key assignee reporter limit].freeze, %w[org namespace].freeze), + "knowledge.reports.submit" => OpSpec.new("knowledge.reports.submit", "knowledge", "reports_submit", true, false, "writer", "experimental", %w[org namespace agent user_id session_id run_id kind target_kind target_key target_version target_sha256 problem suggested_correction evidence related].freeze, %w[org namespace kind problem].freeze), + "knowledge.reports.update" => OpSpec.new("knowledge.reports.update", "knowledge", "reports_update", false, false, "admin", "experimental", %w[org namespace report_id action reason resolution_revision related expected_version].freeze, %w[org namespace report_id].freeze), "knowledge.restore" => OpSpec.new("knowledge.restore", "knowledge", "restore", true, false, "writer", "experimental", %w[org namespace source_uri if_revision].freeze, %w[org namespace source_uri].freeze), "knowledge.search" => OpSpec.new("knowledge.search", "knowledge", "search", true, true, "viewer", "stable", %w[org namespace query tags since_seconds top_k namespace_scope namespaces search_mode lexical_weight narrow_spans collapse_sections uri_prefix session_ids source_classes formats block_types rerank].freeze, %w[org namespace query].freeze), "knowledge.source.add" => OpSpec.new("knowledge.source.add", "knowledge", "source_add", false, false, "writer", "experimental", %w[org namespace name kind items links config include credential_mode crawl_options credential dry_run].freeze, %w[org namespace name kind].freeze), @@ -1442,6 +1447,41 @@ def reads(body = nil, request_options: nil, **fields) call_op("knowledge.reads", body, fields, request_options) end + # `knowledge.reports.evidence` (writer, writes, experimental). + # The reporter adds evidence to their own report, for example after a maintainer + # Required: org, namespace, report_id, evidence. + def reports_evidence(body = nil, request_options: nil, **fields) + call_op("knowledge.reports.evidence", body, fields, request_options) + end + + # `knowledge.reports.get` (viewer, read-only, experimental). + # One report, with the problem, the suggested correction and the evidence, when you + # Required: org, namespace, report_id. + def reports_get(body = nil, request_options: nil, **fields) + call_op("knowledge.reports.get", body, fields, request_options) + end + + # `knowledge.reports.list` (admin, writes, Idempotency-Key, experimental). + # The namespace's report queue for maintainers, newest change first. Rows carry no + # Required: org, namespace. + def reports_list(body = nil, request_options: nil, **fields) + call_op("knowledge.reports.list", body, fields, request_options) + end + + # `knowledge.reports.submit` (writer, writes, Idempotency-Key, experimental). + # Report that a memory claim or a document passage is incorrect or outdated, or that + # Required: org, namespace, kind, problem. + def reports_submit(body = nil, request_options: nil, **fields) + call_op("knowledge.reports.submit", body, fields, request_options) + end + + # `knowledge.reports.update` (admin, writes, experimental). + # A maintainer takes, releases, asks for evidence on, resolves, dismisses or reopens + # Required: org, namespace, report_id. + def reports_update(body = nil, request_options: nil, **fields) + call_op("knowledge.reports.update", body, fields, request_options) + end + # `knowledge.restore` (writer, writes, Idempotency-Key, experimental). # Undo a `knowledge.delete` or `knowledge.bulk_delete` of one document. # Required: org, namespace, source_uri. diff --git a/sdk/rust/src/blocking_operations.rs b/sdk/rust/src/blocking_operations.rs index 6b07db86efc..6eface6c188 100644 --- a/sdk/rust/src/blocking_operations.rs +++ b/sdk/rust/src/blocking_operations.rs @@ -2110,6 +2110,91 @@ impl crate::blocking::Client { ) -> Result, crate::CallFailure> { self.call("knowledge.gaps.draft", &request, options) } + /// Call `knowledge.reports.submit`. + pub fn knowledge_reports_submit( + &self, + request: crate::KnowledgeReportsSubmitInput, + ) -> Result { + self.knowledge_reports_submit_with_options(request, crate::CallOptions::default()) + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `knowledge.reports.submit` with per-request options and metadata. + pub fn knowledge_reports_submit_with_options( + &self, + request: crate::KnowledgeReportsSubmitInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("knowledge.reports.submit", &request, options) + } + /// Call `knowledge.reports.get`. + pub fn knowledge_reports_get( + &self, + request: crate::KnowledgeReportsGetInput, + ) -> Result { + self.knowledge_reports_get_with_options(request, crate::CallOptions::default()) + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `knowledge.reports.get` with per-request options and metadata. + pub fn knowledge_reports_get_with_options( + &self, + request: crate::KnowledgeReportsGetInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("knowledge.reports.get", &request, options) + } + /// Call `knowledge.reports.list`. + pub fn knowledge_reports_list( + &self, + request: crate::KnowledgeReportsListInput, + ) -> Result { + self.knowledge_reports_list_with_options(request, crate::CallOptions::default()) + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `knowledge.reports.list` with per-request options and metadata. + pub fn knowledge_reports_list_with_options( + &self, + request: crate::KnowledgeReportsListInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("knowledge.reports.list", &request, options) + } + /// Call `knowledge.reports.update`. + pub fn knowledge_reports_update( + &self, + request: crate::KnowledgeReportsUpdateInput, + ) -> Result { + self.knowledge_reports_update_with_options(request, crate::CallOptions::default()) + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `knowledge.reports.update` with per-request options and metadata. + pub fn knowledge_reports_update_with_options( + &self, + request: crate::KnowledgeReportsUpdateInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("knowledge.reports.update", &request, options) + } + /// Call `knowledge.reports.evidence`. + pub fn knowledge_reports_evidence( + &self, + request: crate::KnowledgeReportsEvidenceInput, + ) -> Result { + self.knowledge_reports_evidence_with_options(request, crate::CallOptions::default()) + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `knowledge.reports.evidence` with per-request options and metadata. + pub fn knowledge_reports_evidence_with_options( + &self, + request: crate::KnowledgeReportsEvidenceInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("knowledge.reports.evidence", &request, options) + } /// Call `knowledge.query_history.add`. pub fn knowledge_query_history_add( &self, diff --git a/sdk/rust/src/operations.rs b/sdk/rust/src/operations.rs index 721893a77ab..39895a85498 100644 --- a/sdk/rust/src/operations.rs +++ b/sdk/rust/src/operations.rs @@ -2258,6 +2258,99 @@ impl crate::Client { ) -> Result, crate::CallFailure> { self.call("knowledge.gaps.draft", &request, options).await } + /// Call `knowledge.reports.submit`. + pub async fn knowledge_reports_submit( + &self, + request: crate::KnowledgeReportsSubmitInput, + ) -> Result { + self.knowledge_reports_submit_with_options(request, crate::CallOptions::default()) + .await + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `knowledge.reports.submit` with per-request options and metadata. + pub async fn knowledge_reports_submit_with_options( + &self, + request: crate::KnowledgeReportsSubmitInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("knowledge.reports.submit", &request, options) + .await + } + /// Call `knowledge.reports.get`. + pub async fn knowledge_reports_get( + &self, + request: crate::KnowledgeReportsGetInput, + ) -> Result { + self.knowledge_reports_get_with_options(request, crate::CallOptions::default()) + .await + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `knowledge.reports.get` with per-request options and metadata. + pub async fn knowledge_reports_get_with_options( + &self, + request: crate::KnowledgeReportsGetInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("knowledge.reports.get", &request, options).await + } + /// Call `knowledge.reports.list`. + pub async fn knowledge_reports_list( + &self, + request: crate::KnowledgeReportsListInput, + ) -> Result { + self.knowledge_reports_list_with_options(request, crate::CallOptions::default()) + .await + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `knowledge.reports.list` with per-request options and metadata. + pub async fn knowledge_reports_list_with_options( + &self, + request: crate::KnowledgeReportsListInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("knowledge.reports.list", &request, options).await + } + /// Call `knowledge.reports.update`. + pub async fn knowledge_reports_update( + &self, + request: crate::KnowledgeReportsUpdateInput, + ) -> Result { + self.knowledge_reports_update_with_options(request, crate::CallOptions::default()) + .await + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `knowledge.reports.update` with per-request options and metadata. + pub async fn knowledge_reports_update_with_options( + &self, + request: crate::KnowledgeReportsUpdateInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("knowledge.reports.update", &request, options) + .await + } + /// Call `knowledge.reports.evidence`. + pub async fn knowledge_reports_evidence( + &self, + request: crate::KnowledgeReportsEvidenceInput, + ) -> Result { + self.knowledge_reports_evidence_with_options(request, crate::CallOptions::default()) + .await + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `knowledge.reports.evidence` with per-request options and metadata. + pub async fn knowledge_reports_evidence_with_options( + &self, + request: crate::KnowledgeReportsEvidenceInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("knowledge.reports.evidence", &request, options) + .await + } /// Call `knowledge.query_history.add`. pub async fn knowledge_query_history_add( &self, diff --git a/sdk/rust/src/wire_models.rs b/sdk/rust/src/wire_models.rs index 21aa809d1fb..cd960b9a788 100644 --- a/sdk/rust/src/wire_models.rs +++ b/sdk/rust/src/wire_models.rs @@ -788,6 +788,41 @@ pub(crate) const OP_POLICIES: &[OperationPolicy] = &[ &["namespace", "org"], &[], ), + ( + "knowledge.reports.submit", + true, + false, + &["namespace", "org"], + &[], + ), + ( + "knowledge.reports.get", + true, + true, + &["namespace", "org"], + &[], + ), + ( + "knowledge.reports.list", + true, + false, + &["namespace", "org"], + &[], + ), + ( + "knowledge.reports.update", + false, + false, + &["namespace", "org"], + &[], + ), + ( + "knowledge.reports.evidence", + false, + false, + &["namespace", "org"], + &[], + ), ( "knowledge.query_history.add", false, @@ -26878,6 +26913,812 @@ impl KnowledgeReadsInput { } } +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportsEvidenceOutputState { + #[serde(rename = "open")] + Open, + #[serde(rename = "taken")] + Taken, + #[serde(rename = "needs_evidence")] + NeedsEvidence, + #[serde(rename = "resolved")] + Resolved, + #[serde(rename = "dismissed")] + Dismissed, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct KnowledgeReportsEvidenceOutput { + pub report_id: String, + pub state: KnowledgeReportsEvidenceOutputState, + pub version: Integer, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct KnowledgeReportsEvidenceInput { + #[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 report_id: String, + pub evidence: Vec, +} +impl KnowledgeReportsEvidenceInput { + pub fn new( + report_id: impl Into, + evidence: impl IntoIterator>, + ) -> Self { + Self { + org: None, + namespace: None, + report_id: report_id.into(), + evidence: evidence.into_iter().map(Into::into).collect(), + } + } + 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("knowledge.reports.evidence", &self, options) + .await + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportDetailKind { + #[serde(rename = "missing")] + Missing, + #[serde(rename = "incorrect")] + Incorrect, + #[serde(rename = "outdated")] + Outdated, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportDetailState { + #[serde(rename = "open")] + Open, + #[serde(rename = "taken")] + Taken, + #[serde(rename = "needs_evidence")] + NeedsEvidence, + #[serde(rename = "resolved")] + Resolved, + #[serde(rename = "dismissed")] + Dismissed, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportDetailTargetKind { + #[serde(rename = "")] + Empty, + #[serde(rename = "memory")] + Memory, + #[serde(rename = "document")] + Document, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct KnowledgeReportDetail { + pub report_id: String, + pub version: Integer, + pub kind: KnowledgeReportDetailKind, + pub state: KnowledgeReportDetailState, + #[serde(default = "default_1202")] + pub target_kind: KnowledgeReportDetailTargetKind, + #[serde(default = "default_1203")] + pub target_key: String, + #[serde(default = "default_1204")] + pub target_version: Integer, + #[serde(default = "default_1205")] + pub target_version_text: String, + pub reporter: String, + #[serde(default = "default_1206")] + pub assignee: String, + pub created_at: String, + pub updated_at: String, + #[serde(default = "default_1207")] + pub target_changed: bool, + pub problem: String, + #[serde(default = "default_1208")] + pub suggested_correction: String, + #[serde(default = "default_1209")] + pub run_id: String, + #[serde(default = "default_1210")] + pub evidence: Vec, + #[serde(default = "default_1211")] + pub related: Vec, + #[serde(default = "default_1212")] + pub reason: String, + #[serde(default = "default_1213")] + pub resolution_revision: String, + #[serde(default = "default_1214")] + pub target_readable: bool, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct KnowledgeReportsGetOutput { + pub found: bool, + #[serde(default = "default_1215")] + pub report: Option, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct KnowledgeReportsGetInput { + #[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 report_id: String, +} +impl KnowledgeReportsGetInput { + pub fn new(report_id: impl Into) -> Self { + Self { + org: None, + namespace: None, + report_id: report_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("knowledge.reports.get", &self, options).await + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportKind { + #[serde(rename = "missing")] + Missing, + #[serde(rename = "incorrect")] + Incorrect, + #[serde(rename = "outdated")] + Outdated, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportState { + #[serde(rename = "open")] + Open, + #[serde(rename = "taken")] + Taken, + #[serde(rename = "needs_evidence")] + NeedsEvidence, + #[serde(rename = "resolved")] + Resolved, + #[serde(rename = "dismissed")] + Dismissed, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportTargetKind { + #[serde(rename = "")] + Empty, + #[serde(rename = "memory")] + Memory, + #[serde(rename = "document")] + Document, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct KnowledgeReport { + pub report_id: String, + pub version: Integer, + pub kind: KnowledgeReportKind, + pub state: KnowledgeReportState, + #[serde(default = "default_1216")] + pub target_kind: KnowledgeReportTargetKind, + #[serde(default = "default_1217")] + pub target_key: String, + #[serde(default = "default_1218")] + pub target_version: Integer, + #[serde(default = "default_1219")] + pub target_version_text: String, + pub reporter: String, + #[serde(default = "default_1220")] + pub assignee: String, + pub created_at: String, + pub updated_at: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct KnowledgeReportsListOutput { + #[serde(default = "default_1221")] + pub reports: Vec, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportsListInputStatesItem { + #[serde(rename = "open")] + Open, + #[serde(rename = "taken")] + Taken, + #[serde(rename = "needs_evidence")] + NeedsEvidence, + #[serde(rename = "resolved")] + Resolved, + #[serde(rename = "dismissed")] + Dismissed, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportsListInputKindsItem { + #[serde(rename = "missing")] + Missing, + #[serde(rename = "incorrect")] + Incorrect, + #[serde(rename = "outdated")] + Outdated, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportsListInputTargetKind { + #[serde(rename = "")] + Empty, + #[serde(rename = "memory")] + Memory, + #[serde(rename = "document")] + Document, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct KnowledgeReportsListInput { + #[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, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub states: Option>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub kinds: Option>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub target_kind: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub target_key: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub assignee: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub reporter: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub limit: Option, +} +impl Default for KnowledgeReportsListInput { + fn default() -> Self { + Self::new() + } +} +impl KnowledgeReportsListInput { + pub fn new() -> Self { + Self { + org: None, + namespace: None, + states: None, + kinds: None, + target_kind: None, + target_key: None, + assignee: None, + reporter: None, + limit: 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 fn states(mut self, states: Vec) -> Self { + self.states = Some(states); + self + } + pub fn kinds(mut self, kinds: Vec) -> Self { + self.kinds = Some(kinds); + self + } + pub fn target_kind(mut self, target_kind: KnowledgeReportsListInputTargetKind) -> Self { + self.target_kind = Some(target_kind); + self + } + pub fn target_key(mut self, target_key: impl Into) -> Self { + self.target_key = Some(target_key.into()); + self + } + pub fn assignee(mut self, assignee: impl Into) -> Self { + self.assignee = Some(assignee.into()); + self + } + pub fn reporter(mut self, reporter: impl Into) -> Self { + self.reporter = Some(reporter.into()); + self + } + pub fn limit(mut self, limit: impl Into) -> Self { + self.limit = Some(limit.into()); + self + } + pub async fn send( + self, + client: &crate::Client, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + client.call("knowledge.reports.list", &self, options).await + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportsSubmitOutputState { + #[serde(rename = "open")] + Open, + #[serde(rename = "taken")] + Taken, + #[serde(rename = "needs_evidence")] + NeedsEvidence, + #[serde(rename = "resolved")] + Resolved, + #[serde(rename = "dismissed")] + Dismissed, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct KnowledgeReportsSubmitOutput { + pub report_id: String, + pub state: KnowledgeReportsSubmitOutputState, + pub version: Integer, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportsSubmitInputKind { + #[serde(rename = "missing")] + Missing, + #[serde(rename = "incorrect")] + Incorrect, + #[serde(rename = "outdated")] + Outdated, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportsSubmitInputTargetKind { + #[serde(rename = "")] + Empty, + #[serde(rename = "memory")] + Memory, + #[serde(rename = "document")] + Document, +} + +#[derive(Debug, Clone, PartialEq, Serialize)] +#[serde(untagged)] +pub enum KnowledgeReportsSubmitInputTargetVersion { + Variant0(Integer), + Variant1(String), +} +impl<'de> Deserialize<'de> for KnowledgeReportsSubmitInputTargetVersion { + fn deserialize>(deserializer: D) -> Result { + let value = serde_json::Value::deserialize(deserializer)?; + if let Ok(value) = serde_json::from_value::(value.clone()) { + return Ok(Self::Variant0(value)); + } + if let Ok(value) = serde_json::from_value::(value.clone()) { + return Ok(Self::Variant1(value)); + } + Err(serde::de::Error::custom( + "no matching variant for KnowledgeReportsSubmitInputTargetVersion", + )) + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct KnowledgeReportsSubmitInput { + #[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, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub agent: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub user_id: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub session_id: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub run_id: Option, + pub kind: KnowledgeReportsSubmitInputKind, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub target_kind: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub target_key: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub target_version: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub target_sha256: Option, + pub problem: String, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub suggested_correction: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub evidence: Option>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub related: Option>, +} +impl KnowledgeReportsSubmitInput { + pub fn new(kind: KnowledgeReportsSubmitInputKind, problem: impl Into) -> Self { + Self { + org: None, + namespace: None, + agent: None, + user_id: None, + session_id: None, + run_id: None, + kind, + target_kind: None, + target_key: None, + target_version: None, + target_sha256: None, + problem: problem.into(), + suggested_correction: None, + evidence: None, + related: 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 fn agent(mut self, agent: impl Into) -> Self { + self.agent = Some(agent.into()); + self + } + pub fn user_id(mut self, user_id: impl Into) -> Self { + self.user_id = Some(user_id.into()); + self + } + pub fn session_id(mut self, session_id: impl Into) -> Self { + self.session_id = Some(session_id.into()); + self + } + pub fn run_id(mut self, run_id: impl Into) -> Self { + self.run_id = Some(run_id.into()); + self + } + pub fn target_kind(mut self, target_kind: KnowledgeReportsSubmitInputTargetKind) -> Self { + self.target_kind = Some(target_kind); + self + } + pub fn target_key(mut self, target_key: impl Into) -> Self { + self.target_key = Some(target_key.into()); + self + } + pub fn target_version( + mut self, + target_version: KnowledgeReportsSubmitInputTargetVersion, + ) -> Self { + self.target_version = Some(target_version); + self + } + pub fn target_sha256(mut self, target_sha256: impl Into) -> Self { + self.target_sha256 = Some(target_sha256.into()); + self + } + pub fn suggested_correction(mut self, suggested_correction: impl Into) -> Self { + self.suggested_correction = Some(suggested_correction.into()); + self + } + pub fn evidence(mut self, evidence: impl IntoIterator>) -> Self { + self.evidence = Some(evidence.into_iter().map(Into::into).collect()); + self + } + pub fn related(mut self, related: impl IntoIterator>) -> Self { + self.related = Some(related.into_iter().map(Into::into).collect()); + self + } + pub async fn send( + self, + client: &crate::Client, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + client + .call("knowledge.reports.submit", &self, options) + .await + } +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportsUpdateOutputState { + #[serde(rename = "open")] + Open, + #[serde(rename = "taken")] + Taken, + #[serde(rename = "needs_evidence")] + NeedsEvidence, + #[serde(rename = "resolved")] + Resolved, + #[serde(rename = "dismissed")] + Dismissed, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct KnowledgeReportsUpdateOutput { + pub report_id: String, + pub state: KnowledgeReportsUpdateOutputState, + pub version: Integer, +} + +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum KnowledgeReportsUpdateInputAction { + #[serde(rename = "take")] + Take, + #[serde(rename = "release")] + Release, + #[serde(rename = "request_evidence")] + RequestEvidence, + #[serde(rename = "resolve")] + Resolve, + #[serde(rename = "dismiss")] + Dismiss, + #[serde(rename = "reopen")] + Reopen, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct KnowledgeReportsUpdateInput { + #[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 report_id: String, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_nullable" + )] + pub action: Option>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub reason: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub resolution_revision: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub related: Option>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_nullable" + )] + pub expected_version: Option>, +} +impl KnowledgeReportsUpdateInput { + pub fn new(report_id: impl Into) -> Self { + Self { + org: None, + namespace: None, + report_id: report_id.into(), + action: None, + reason: None, + resolution_revision: None, + related: None, + expected_version: 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 fn action(mut self, action: KnowledgeReportsUpdateInputAction) -> Self { + self.action = Some(Some(action)); + self + } + pub fn action_null(mut self) -> Self { + self.action = Some(None); + self + } + pub fn reason(mut self, reason: impl Into) -> Self { + self.reason = Some(reason.into()); + self + } + pub fn resolution_revision(mut self, resolution_revision: impl Into) -> Self { + self.resolution_revision = Some(resolution_revision.into()); + self + } + pub fn related(mut self, related: impl IntoIterator>) -> Self { + self.related = Some(related.into_iter().map(Into::into).collect()); + self + } + pub fn expected_version(mut self, expected_version: impl Into) -> Self { + self.expected_version = Some(Some(expected_version.into())); + self + } + pub fn expected_version_null(mut self) -> Self { + self.expected_version = Some(None); + self + } + pub async fn send( + self, + client: &crate::Client, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + client + .call("knowledge.reports.update", &self, options) + .await + } +} + #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[non_exhaustive] pub enum KnowledgeRestoreOutputReason { @@ -26910,15 +27751,15 @@ pub enum KnowledgeRestoreOutputOriginal { #[non_exhaustive] pub struct KnowledgeRestoreOutput { pub restored: bool, - #[serde(default = "default_1202")] + #[serde(default = "default_1222")] pub reason: KnowledgeRestoreOutputReason, - #[serde(default = "default_1203")] + #[serde(default = "default_1223")] pub doc_id: String, - #[serde(default = "default_1204")] + #[serde(default = "default_1224")] pub revision: Option, - #[serde(default = "default_1205")] + #[serde(default = "default_1225")] pub chunks_restored: Integer, - #[serde(default = "default_1206")] + #[serde(default = "default_1226")] pub original: KnowledgeRestoreOutputOriginal, } @@ -26991,35 +27832,35 @@ pub struct KnowledgeSourceCrawlProof { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceProbe { - #[serde(default = "default_1211")] + #[serde(default = "default_1231")] pub documents: Integer, - #[serde(default = "default_1212")] + #[serde(default = "default_1232")] pub more: bool, - #[serde(default = "default_1213")] + #[serde(default = "default_1233")] pub sample: Vec, - #[serde(default = "default_1214")] + #[serde(default = "default_1234")] pub checked: Integer, - #[serde(default = "default_1215")] + #[serde(default = "default_1235")] pub sampled: bool, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceAddOutput { - #[serde(default = "default_1207")] + #[serde(default = "default_1227")] pub crawl_proof: Option, pub name: String, pub kind: String, pub namespace: String, - #[serde(default = "default_1208")] + #[serde(default = "default_1228")] pub items: Vec>, - #[serde(default = "default_1209")] + #[serde(default = "default_1229")] pub include: Vec, - #[serde(default = "default_1210")] + #[serde(default = "default_1230")] pub config: std::collections::HashMap, - #[serde(default = "default_1216")] + #[serde(default = "default_1236")] pub probe: KnowledgeSourceProbe, - #[serde(default = "default_1217")] + #[serde(default = "default_1237")] pub dry_run: bool, } @@ -27236,21 +28077,21 @@ impl KnowledgeSourceAddInput { #[non_exhaustive] pub struct KnowledgeSourceCheckOutput { pub name: String, - #[serde(default = "default_1218")] + #[serde(default = "default_1238")] pub reachable: bool, - #[serde(default = "default_1219")] + #[serde(default = "default_1239")] pub documents: Integer, - #[serde(default = "default_1220")] + #[serde(default = "default_1240")] pub more: bool, - #[serde(default = "default_1221")] + #[serde(default = "default_1241")] pub sample: Vec, - #[serde(default = "default_1222")] + #[serde(default = "default_1242")] pub checked: Integer, - #[serde(default = "default_1223")] + #[serde(default = "default_1243")] pub sampled: bool, - #[serde(default = "default_1224")] + #[serde(default = "default_1244")] pub summary: String, - #[serde(default = "default_1225")] + #[serde(default = "default_1245")] pub checked_at: String, } @@ -27299,37 +28140,37 @@ impl KnowledgeSourceCheckInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceSync { - #[serde(default = "default_1236")] + #[serde(default = "default_1256")] pub requested_at: String, - #[serde(default = "default_1237")] + #[serde(default = "default_1257")] pub last_synced_at: String, - #[serde(default = "default_1238")] + #[serde(default = "default_1258")] pub status: String, - #[serde(default = "default_1239")] + #[serde(default = "default_1259")] pub documents_seen: Integer, - #[serde(default = "default_1240")] + #[serde(default = "default_1260")] pub changed: Integer, - #[serde(default = "default_1241")] + #[serde(default = "default_1261")] pub removed: Integer, - #[serde(default = "default_1242")] + #[serde(default = "default_1262")] pub unconverted: Integer, - #[serde(default = "default_1243")] + #[serde(default = "default_1263")] pub unconverted_reasons: std::collections::HashMap, - #[serde(default = "default_1244")] + #[serde(default = "default_1264")] pub skipped: Integer, - #[serde(default = "default_1245")] + #[serde(default = "default_1265")] pub error: String, - #[serde(default = "default_1246")] + #[serde(default = "default_1266")] pub pending_extract: Integer, - #[serde(default = "default_1247")] + #[serde(default = "default_1267")] pub last_extracted_at: String, - #[serde(default = "default_1248")] + #[serde(default = "default_1268")] pub extracted: Integer, - #[serde(default = "default_1249")] + #[serde(default = "default_1269")] pub flagged_pinned: Integer, - #[serde(default = "default_1250")] + #[serde(default = "default_1270")] pub unextracted: Integer, - #[serde(default = "default_1251")] + #[serde(default = "default_1271")] pub extract_error: String, } @@ -27337,11 +28178,11 @@ pub struct KnowledgeSourceSync { #[non_exhaustive] pub struct KnowledgeSourceDocument { pub source_uri: String, - #[serde(default = "default_1253")] + #[serde(default = "default_1273")] pub title: String, - #[serde(default = "default_1254")] + #[serde(default = "default_1274")] pub source_revision: String, - #[serde(default = "default_1255")] + #[serde(default = "default_1275")] pub ingested_at: String, } @@ -27350,29 +28191,29 @@ pub struct KnowledgeSourceDocument { pub struct KnowledgeSourceInspectOutput { pub name: String, pub kind: String, - #[serde(default = "default_1226")] + #[serde(default = "default_1246")] pub credential_mode: String, - #[serde(default = "default_1227")] + #[serde(default = "default_1247")] pub owned_by_caller: bool, - #[serde(default = "default_1228")] + #[serde(default = "default_1248")] pub access: String, - #[serde(default = "default_1229")] + #[serde(default = "default_1249")] pub crawl_options: std::collections::HashMap, - #[serde(default = "default_1230")] + #[serde(default = "default_1250")] pub owner_subject: String, - #[serde(default = "default_1231")] + #[serde(default = "default_1251")] pub items: Vec>, - #[serde(default = "default_1232")] + #[serde(default = "default_1252")] pub include: Vec, - #[serde(default = "default_1233")] + #[serde(default = "default_1253")] pub config: std::collections::HashMap, - #[serde(default = "default_1234")] + #[serde(default = "default_1254")] pub created_by: String, - #[serde(default = "default_1235")] + #[serde(default = "default_1255")] pub created_at: String, - #[serde(default = "default_1252")] + #[serde(default = "default_1272")] pub sync: KnowledgeSourceSync, - #[serde(default = "default_1256")] + #[serde(default = "default_1276")] pub documents: Vec, } @@ -27425,40 +28266,40 @@ impl KnowledgeSourceInspectInput { pub struct KnowledgeSourceEntry { pub name: String, pub kind: String, - #[serde(default = "default_1257")] + #[serde(default = "default_1277")] pub credential_mode: String, - #[serde(default = "default_1258")] + #[serde(default = "default_1278")] pub owned_by_caller: bool, - #[serde(default = "default_1259")] + #[serde(default = "default_1279")] pub access: String, - #[serde(default = "default_1260")] + #[serde(default = "default_1280")] pub crawl_options: std::collections::HashMap, - #[serde(default = "default_1261")] + #[serde(default = "default_1281")] pub owner_subject: String, - #[serde(default = "default_1262")] + #[serde(default = "default_1282")] pub items: Vec>, - #[serde(default = "default_1263")] + #[serde(default = "default_1283")] pub include: Vec, - #[serde(default = "default_1264")] + #[serde(default = "default_1284")] pub config: std::collections::HashMap, - #[serde(default = "default_1265")] + #[serde(default = "default_1285")] pub created_by: String, - #[serde(default = "default_1266")] + #[serde(default = "default_1286")] pub created_at: String, - #[serde(default = "default_1267")] + #[serde(default = "default_1287")] pub sync: KnowledgeSourceSync, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceListOutput { - #[serde(default = "default_1268")] + #[serde(default = "default_1288")] pub sources: Vec, - #[serde(default = "default_1269")] + #[serde(default = "default_1289")] pub enabled: bool, - #[serde(default = "default_1270")] + #[serde(default = "default_1290")] pub accepts_sources: bool, - #[serde(default = "default_1271")] + #[serde(default = "default_1291")] pub self_service: bool, } @@ -27511,18 +28352,18 @@ impl KnowledgeSourceListInput { #[non_exhaustive] pub struct KnowledgeSourceParsedLink { pub link: String, - #[serde(default = "default_1272")] + #[serde(default = "default_1292")] pub kind: String, - #[serde(default = "default_1273")] + #[serde(default = "default_1293")] pub item: std::collections::HashMap, - #[serde(default = "default_1274")] + #[serde(default = "default_1294")] pub unreadable: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceParseLinksOutput { - #[serde(default = "default_1275")] + #[serde(default = "default_1295")] pub links: Vec, } @@ -27573,25 +28414,25 @@ impl KnowledgeSourceParseLinksInput { #[derive(Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct PushStatusOutput { - #[serde(default = "default_1276")] + #[serde(default = "default_1296")] pub enabled: bool, - #[serde(default = "default_1277")] + #[serde(default = "default_1297")] pub status: String, - #[serde(default = "default_1278")] + #[serde(default = "default_1298")] pub provider: String, - #[serde(default = "default_1279")] + #[serde(default = "default_1299")] pub generation: String, - #[serde(default = "default_1280")] + #[serde(default = "default_1300")] pub callback_url: String, - #[serde(default = "default_1281")] + #[serde(default = "default_1301")] pub provider_id: String, - #[serde(default = "default_1282")] + #[serde(default = "default_1302")] pub challenge_fingerprint: String, - #[serde(default = "default_1283")] + #[serde(default = "default_1303")] pub verification_token: String, - #[serde(default = "default_1284")] + #[serde(default = "default_1304")] pub channels: Integer, - #[serde(default = "default_1285")] + #[serde(default = "default_1305")] pub expires_at: f64, } impl std::fmt::Debug for PushStatusOutput { @@ -27836,7 +28677,7 @@ impl PushStatusInput { #[non_exhaustive] pub struct KnowledgeSourceRemoveOutput { pub name: String, - #[serde(default = "default_1286")] + #[serde(default = "default_1306")] pub documents_pending: Integer, } @@ -27898,12 +28739,12 @@ impl KnowledgeSourceRemoveInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceRotateOutput { - #[serde(default = "default_1287")] + #[serde(default = "default_1307")] pub crawl_proof: Option, pub name: String, - #[serde(default = "default_1288")] + #[serde(default = "default_1308")] pub probe: KnowledgeSourceProbe, - #[serde(default = "default_1289")] + #[serde(default = "default_1309")] pub rotated_at: String, } @@ -27955,7 +28796,7 @@ impl KnowledgeSourceRotateInput { #[non_exhaustive] pub struct KnowledgeSourceSyncNowOutput { pub name: String, - #[serde(default = "default_1290")] + #[serde(default = "default_1310")] pub enabled: bool, } @@ -28017,20 +28858,20 @@ impl KnowledgeSourceSyncNowInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceUpdateOutput { - #[serde(default = "default_1291")] + #[serde(default = "default_1311")] pub crawl_proof: Option, pub name: String, - #[serde(default = "default_1292")] + #[serde(default = "default_1312")] pub items: Vec>, - #[serde(default = "default_1293")] + #[serde(default = "default_1313")] pub include: Vec, - #[serde(default = "default_1294")] + #[serde(default = "default_1314")] pub config: std::collections::HashMap, - #[serde(default = "default_1295")] + #[serde(default = "default_1315")] pub added: Vec>, - #[serde(default = "default_1296")] + #[serde(default = "default_1316")] pub removed: Vec>, - #[serde(default = "default_1297")] + #[serde(default = "default_1317")] pub probe: KnowledgeSourceProbe, } @@ -28161,9 +29002,9 @@ impl KnowledgeSourceUpdateInput { pub struct CitedChunk { pub source_uri: String, pub chunk_idx: Integer, - #[serde(default = "default_1299")] + #[serde(default = "default_1319")] pub revision: Integer, - #[serde(default = "default_1300")] + #[serde(default = "default_1320")] pub locator: Option>, } @@ -28172,12 +29013,12 @@ pub struct CitedChunk { pub struct SynthesizeCalculation { pub columns: Vec, pub rows: Vec>, - #[serde(default = "default_1307")] + #[serde(default = "default_1327")] pub row_ids: Vec>, - #[serde(default = "default_1308")] + #[serde(default = "default_1328")] pub truncated: bool, pub complete: bool, - #[serde(default = "default_1309")] + #[serde(default = "default_1329")] pub incomplete: Vec, pub receipt: QueryReceipt, pub citation: String, @@ -28191,23 +29032,23 @@ pub struct KnowledgeSynthesizeOutput { pub chunks_read: Integer, pub documents: Integer, pub reduce_rounds: Integer, - #[serde(default = "default_1298")] + #[serde(default = "default_1318")] pub citations: Vec, - #[serde(default = "default_1301")] + #[serde(default = "default_1321")] pub cited_chunks: Vec, - #[serde(default = "default_1302")] + #[serde(default = "default_1322")] pub unsupported_citations: Vec, - #[serde(default = "default_1303")] + #[serde(default = "default_1323")] pub truncated: bool, - #[serde(default = "default_1304")] + #[serde(default = "default_1324")] pub abstain: bool, - #[serde(default = "default_1305")] + #[serde(default = "default_1325")] pub abstain_reason: String, - #[serde(default = "default_1306")] + #[serde(default = "default_1326")] pub clarification: String, - #[serde(default = "default_1310")] + #[serde(default = "default_1330")] pub calculations: Vec, - #[serde(default = "default_1311")] + #[serde(default = "default_1331")] pub model: String, } @@ -28323,13 +29164,13 @@ impl KnowledgeSynthesizeInput { #[non_exhaustive] pub struct KnowledgeUpdateMetadataOutput { pub updated: bool, - #[serde(default = "default_1312")] + #[serde(default = "default_1332")] pub title: String, - #[serde(default = "default_1313")] + #[serde(default = "default_1333")] pub description: String, - #[serde(default = "default_1314")] + #[serde(default = "default_1334")] pub tags: Vec, - #[serde(default = "default_1315")] + #[serde(default = "default_1335")] pub chunks_reindexed: Integer, } @@ -28441,13 +29282,13 @@ pub struct KnowledgeUpsertOutput { pub chunks_superseded: Integer, pub embedding_model: String, pub embedding_dim: Integer, - #[serde(default = "default_1316")] + #[serde(default = "default_1336")] pub duplicate_of_uri: String, - #[serde(default = "default_1317")] + #[serde(default = "default_1337")] pub duplicate_chunk_count: Integer, - #[serde(default = "default_1318")] + #[serde(default = "default_1338")] pub namespace: String, - #[serde(default = "default_1319")] + #[serde(default = "default_1339")] pub source_uri: String, } @@ -28632,26 +29473,26 @@ pub struct LearningEntry { pub memory_type: String, pub proposed_value: Value, pub supporter_count: Integer, - #[serde(default = "default_1320")] + #[serde(default = "default_1340")] pub supporter_sessions: Integer, - #[serde(default = "default_1321")] + #[serde(default = "default_1341")] pub supporter_writers: Integer, pub confidence_avg: f64, pub supporters: Vec, pub rationale: String, - #[serde(default = "default_1322")] + #[serde(default = "default_1342")] pub source_kind: String, - #[serde(default = "default_1323")] + #[serde(default = "default_1343")] pub source_resource_id: String, - #[serde(default = "default_1324")] + #[serde(default = "default_1344")] pub agent: String, pub status: LearningEntryStatus, pub proposed_at: String, - #[serde(default = "default_1325")] + #[serde(default = "default_1345")] pub decided_at: Option, - #[serde(default = "default_1326")] + #[serde(default = "default_1346")] pub decided_by: String, - #[serde(default = "default_1327")] + #[serde(default = "default_1347")] pub decision_reason: String, } @@ -28854,11 +29695,11 @@ pub enum LearningsReviewOutputNewStatus { pub struct LearningsReviewOutput { pub candidate_id: String, pub new_status: LearningsReviewOutputNewStatus, - #[serde(default = "default_1328")] + #[serde(default = "default_1348")] pub promoted_to_shared: bool, - #[serde(default = "default_1329")] + #[serde(default = "default_1349")] pub promoted_to_knowledge: bool, - #[serde(default = "default_1330")] + #[serde(default = "default_1350")] pub knowledge_source_uri: String, pub decided_at: String, } @@ -29062,7 +29903,7 @@ impl MemoryAgentsListInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct AggregateRow { - #[serde(default = "default_1331")] + #[serde(default = "default_1351")] pub group: std::collections::HashMap, pub metric: f64, } @@ -29070,9 +29911,9 @@ pub struct AggregateRow { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryAggregateOutput { - #[serde(default = "default_1332")] + #[serde(default = "default_1352")] pub rows: Vec, - #[serde(default = "default_1333")] + #[serde(default = "default_1353")] pub sql_executed: String, } @@ -29240,15 +30081,15 @@ impl MemoryAggregateInput { pub struct BulkSetResult { pub memory_key: String, pub version: Integer, - #[serde(default = "default_1334")] + #[serde(default = "default_1354")] pub memory_id: String, - #[serde(default = "default_1335")] + #[serde(default = "default_1355")] pub conflict_verdict: String, - #[serde(default = "default_1336")] + #[serde(default = "default_1356")] pub peers: Vec, - #[serde(default = "default_1337")] + #[serde(default = "default_1357")] pub next: String, - #[serde(default = "default_1338")] + #[serde(default = "default_1358")] pub pinned_blocker_id: String, } @@ -29256,29 +30097,29 @@ pub struct BulkSetResult { #[non_exhaustive] pub struct MemoryBulkSetOutput { pub written: Vec, - #[serde(default = "default_1339")] + #[serde(default = "default_1359")] pub skipped_pinned: Vec, - #[serde(default = "default_1340")] + #[serde(default = "default_1360")] pub skipped_locked: Vec, - #[serde(default = "default_1341")] + #[serde(default = "default_1361")] pub skipped_blacklisted: Vec, - #[serde(default = "default_1342")] + #[serde(default = "default_1362")] pub merged: Vec, - #[serde(default = "default_1343")] + #[serde(default = "default_1363")] pub value_updates_linked: Integer, - #[serde(default = "default_1344")] + #[serde(default = "default_1364")] pub rejected_pinned: Vec, - #[serde(default = "default_1345")] + #[serde(default = "default_1365")] pub duplicates: Vec, - #[serde(default = "default_1346")] + #[serde(default = "default_1366")] pub conflicted: Vec, - #[serde(default = "default_1347")] + #[serde(default = "default_1367")] pub unchecked: Integer, - #[serde(default = "default_1348")] + #[serde(default = "default_1368")] pub retyped: Vec, - #[serde(default = "default_1349")] + #[serde(default = "default_1369")] pub identity_duplicates: std::collections::HashMap, - #[serde(default = "default_1350")] + #[serde(default = "default_1370")] pub stage_ms: std::collections::HashMap, } @@ -29428,18 +30269,18 @@ pub enum ApplyRowStatus { #[non_exhaustive] pub struct ApplyRow { pub memory_key: String, - #[serde(default = "default_1358")] + #[serde(default = "default_1378")] pub memory_id: String, - #[serde(default = "default_1359")] + #[serde(default = "default_1379")] pub agent: String, - #[serde(default = "default_1360")] + #[serde(default = "default_1380")] pub user_id: String, - #[serde(default = "default_1361")] + #[serde(default = "default_1381")] pub session_id: String, pub status: ApplyRowStatus, - #[serde(default = "default_1362")] + #[serde(default = "default_1382")] pub version: Option, - #[serde(default = "default_1363")] + #[serde(default = "default_1383")] pub detail: String, } @@ -29449,21 +30290,21 @@ pub struct MemoryApplyOutput { pub action: String, pub dry_run: bool, pub target: String, - #[serde(default = "default_1351")] + #[serde(default = "default_1371")] pub matched: Integer, - #[serde(default = "default_1352")] + #[serde(default = "default_1372")] pub applied: Integer, - #[serde(default = "default_1353")] + #[serde(default = "default_1373")] pub would_apply: Integer, - #[serde(default = "default_1354")] + #[serde(default = "default_1374")] pub refused: Integer, - #[serde(default = "default_1355")] + #[serde(default = "default_1375")] pub noop: Integer, - #[serde(default = "default_1356")] + #[serde(default = "default_1376")] pub failed: Integer, - #[serde(default = "default_1357")] + #[serde(default = "default_1377")] pub truncated: bool, - #[serde(default = "default_1364")] + #[serde(default = "default_1384")] pub rows: Vec, } @@ -30197,137 +31038,137 @@ pub enum MemoryAskOutputDeepFirst { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryAskOutput { - #[serde(default = "default_1365")] + #[serde(default = "default_1385")] pub answer: String, - #[serde(default = "default_1366")] + #[serde(default = "default_1386")] pub source: MemoryAskOutputSource, - #[serde(default = "default_1367")] + #[serde(default = "default_1387")] pub abstain: bool, - #[serde(default = "default_1368")] + #[serde(default = "default_1388")] pub abstain_reason: String, - #[serde(default = "default_1369")] + #[serde(default = "default_1389")] pub memory_keys: Vec, - #[serde(default = "default_1370")] + #[serde(default = "default_1390")] pub results: Vec, - #[serde(default = "default_1371")] + #[serde(default = "default_1391")] pub cited_sessions: Vec, - #[serde(default = "default_1372")] + #[serde(default = "default_1392")] pub next: String, - #[serde(default = "default_1373")] + #[serde(default = "default_1393")] pub synth_model: String, - #[serde(default = "default_1374")] + #[serde(default = "default_1394")] pub route_tier: MemoryAskOutputRouteTier, - #[serde(default = "default_1375")] + #[serde(default = "default_1395")] pub route_reason: String, - #[serde(default = "default_1376")] + #[serde(default = "default_1396")] pub llm_cache_hits: Integer, - #[serde(default = "default_1377")] + #[serde(default = "default_1397")] pub llm_cache_misses: Integer, - #[serde(default = "default_1378")] + #[serde(default = "default_1398")] pub llm_cache: bool, - #[serde(default = "default_1379")] + #[serde(default = "default_1399")] pub llm_cache_saved_usd: f64, - #[serde(default = "default_1380")] + #[serde(default = "default_1400")] pub temporal_consistency: Option, - #[serde(default = "default_1381")] + #[serde(default = "default_1401")] pub citation_concentration: Option, - #[serde(default = "default_1382")] + #[serde(default = "default_1402")] pub escalated: bool, - #[serde(default = "default_1383")] + #[serde(default = "default_1403")] pub gate_mode: String, - #[serde(default = "default_1384")] + #[serde(default = "default_1404")] pub gate_kept: Integer, - #[serde(default = "default_1385")] + #[serde(default = "default_1405")] pub gate_dropped: Integer, - #[serde(default = "default_1386")] + #[serde(default = "default_1406")] pub pending_extraction: Integer, - #[serde(default = "default_1387")] + #[serde(default = "default_1407")] pub pending_evidence: Integer, - #[serde(default = "default_1388")] + #[serde(default = "default_1408")] pub retrieval_query: String, - #[serde(default = "default_1389")] + #[serde(default = "default_1409")] pub facets: Vec, - #[serde(default = "default_1390")] + #[serde(default = "default_1410")] pub facet_memories_added: Integer, - #[serde(default = "default_1391")] + #[serde(default = "default_1411")] pub consistency: MemoryAskOutputConsistency, - #[serde(default = "default_1392")] + #[serde(default = "default_1412")] pub consistency_score: f64, - #[serde(default = "default_1393")] + #[serde(default = "default_1413")] pub consistency_note: String, - #[serde(default = "default_1394")] + #[serde(default = "default_1414")] pub identifier_chase_hops: Integer, - #[serde(default = "default_1395")] + #[serde(default = "default_1415")] pub identifier_chase_added: Integer, - #[serde(default = "default_1396")] + #[serde(default = "default_1416")] pub premise_conflict: String, - #[serde(default = "default_1397")] + #[serde(default = "default_1417")] pub premise_note: String, - #[serde(default = "default_1398")] + #[serde(default = "default_1418")] pub premise_verdict: String, - #[serde(default = "default_1399")] + #[serde(default = "default_1419")] pub attribution_note: String, - #[serde(default = "default_1400")] + #[serde(default = "default_1420")] pub depth: MemoryAskOutputDepth, - #[serde(default = "default_1401")] + #[serde(default = "default_1421")] pub deep_fired: bool, - #[serde(default = "default_1402")] + #[serde(default = "default_1422")] pub decomposed: Vec, - #[serde(default = "default_1403")] + #[serde(default = "default_1423")] pub decomposed_parts: Integer, - #[serde(default = "default_1404")] + #[serde(default = "default_1424")] pub superseded_dropped: Integer, - #[serde(default = "default_1405")] + #[serde(default = "default_1425")] pub stale_sentences_masked: Integer, - #[serde(default = "default_1406")] + #[serde(default = "default_1426")] pub entity_followed: Vec, - #[serde(default = "default_1407")] + #[serde(default = "default_1427")] pub when_evidence_turns: Integer, - #[serde(default = "default_1408")] + #[serde(default = "default_1428")] pub decompose_failed: Integer, - #[serde(default = "default_1409")] + #[serde(default = "default_1429")] pub pool_k: Integer, - #[serde(default = "default_1410")] + #[serde(default = "default_1430")] pub grounding: MemoryAskOutputGrounding, - #[serde(default = "default_1411")] + #[serde(default = "default_1431")] pub deep_reason: String, - #[serde(default = "default_1412")] + #[serde(default = "default_1432")] pub deep_keys: Vec, - #[serde(default = "default_1413")] + #[serde(default = "default_1433")] pub deep_chars: Integer, - #[serde(default = "default_1414")] + #[serde(default = "default_1434")] pub code_hits: Integer, - #[serde(default = "default_1415")] + #[serde(default = "default_1435")] pub pool_facts: Integer, - #[serde(default = "default_1416")] + #[serde(default = "default_1436")] pub pool_chunks: Integer, - #[serde(default = "default_1417")] + #[serde(default = "default_1437")] pub prompt_blocks: std::collections::HashMap, - #[serde(default = "default_1418")] + #[serde(default = "default_1438")] pub deep_selector: MemoryAskOutputDeepSelector, - #[serde(default = "default_1419")] + #[serde(default = "default_1439")] pub deep_first: MemoryAskOutputDeepFirst, - #[serde(default = "default_1420")] + #[serde(default = "default_1440")] pub synth_calls: Integer, - #[serde(default = "default_1421")] + #[serde(default = "default_1441")] pub synth_input_tokens: Integer, - #[serde(default = "default_1422")] + #[serde(default = "default_1442")] pub synth_cached_input_tokens: Integer, - #[serde(default = "default_1423")] + #[serde(default = "default_1443")] pub synth_cache_write_tokens: Integer, - #[serde(default = "default_1424")] + #[serde(default = "default_1444")] pub synth_cost_usd: f64, - #[serde(default = "default_1425")] + #[serde(default = "default_1445")] pub context_tokens_est: Integer, - #[serde(default = "default_1426")] + #[serde(default = "default_1446")] pub context_trimmed: Integer, - #[serde(default = "default_1427")] + #[serde(default = "default_1447")] pub summary_hits: Integer, - #[serde(default = "default_1428")] + #[serde(default = "default_1448")] pub knowledge_hits: Integer, - #[serde(default = "default_1429")] + #[serde(default = "default_1449")] pub timeline_rows: Integer, - #[serde(default = "default_1430")] + #[serde(default = "default_1450")] pub count_recomputed: bool, } @@ -31282,36 +32123,36 @@ pub struct MemoryAutoRetirement { pub reason: String, pub memory_id: String, pub memory_key: String, - #[serde(default = "default_1431")] + #[serde(default = "default_1451")] pub agent: String, - #[serde(default = "default_1432")] + #[serde(default = "default_1452")] pub user_id: String, - #[serde(default = "default_1433")] + #[serde(default = "default_1453")] pub session_id: String, - #[serde(default = "default_1434")] + #[serde(default = "default_1454")] pub superseded_by: String, - #[serde(default = "default_1435")] + #[serde(default = "default_1455")] pub superseded_by_key: String, - #[serde(default = "default_1436")] + #[serde(default = "default_1456")] pub label: String, - #[serde(default = "default_1437")] + #[serde(default = "default_1457")] pub unconfirmed: bool, - #[serde(default = "default_1438")] + #[serde(default = "default_1458")] pub judge_verdict: String, - #[serde(default = "default_1439")] + #[serde(default = "default_1459")] pub judge_confidence: Option, - #[serde(default = "default_1440")] + #[serde(default = "default_1460")] pub judge_model: String, - #[serde(default = "default_1441")] + #[serde(default = "default_1461")] pub judge_prompt_version: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryAutoRetirementsOutput { - #[serde(default = "default_1442")] + #[serde(default = "default_1462")] pub rows: Vec, - #[serde(default = "default_1443")] + #[serde(default = "default_1463")] pub next_cursor: Option, } @@ -31405,9 +32246,9 @@ impl MemoryAutoRetirementsInput { #[non_exhaustive] pub struct BacklinkVersion { pub version: Integer, - #[serde(default = "default_1445")] + #[serde(default = "default_1465")] pub status: String, - #[serde(default = "default_1446")] + #[serde(default = "default_1466")] pub created_at: String, } @@ -31415,7 +32256,7 @@ pub struct BacklinkVersion { #[non_exhaustive] pub struct BacklinkDigest { pub session_id: String, - #[serde(default = "default_1448")] + #[serde(default = "default_1468")] pub date: String, } @@ -31423,9 +32264,9 @@ pub struct BacklinkDigest { #[non_exhaustive] pub struct BacklinkEdge { pub memory_key: String, - #[serde(default = "default_1450")] + #[serde(default = "default_1470")] pub relation: String, - #[serde(default = "default_1451")] + #[serde(default = "default_1471")] pub created_at: String, } @@ -31433,7 +32274,7 @@ pub struct BacklinkEdge { #[non_exhaustive] pub struct BacklinkRelated { pub memory_key: String, - #[serde(default = "default_1455")] + #[serde(default = "default_1475")] pub shared_entities: Vec, } @@ -31441,19 +32282,19 @@ pub struct BacklinkRelated { #[non_exhaustive] pub struct MemoryBacklinksOutput { pub memory_key: String, - #[serde(default = "default_1444")] + #[serde(default = "default_1464")] pub found: bool, - #[serde(default = "default_1447")] + #[serde(default = "default_1467")] pub versions: Vec, - #[serde(default = "default_1449")] + #[serde(default = "default_1469")] pub digests: Vec, - #[serde(default = "default_1452")] + #[serde(default = "default_1472")] pub links_in: Vec, - #[serde(default = "default_1453")] + #[serde(default = "default_1473")] pub links_out: Vec, - #[serde(default = "default_1454")] + #[serde(default = "default_1474")] pub evidence_count: Integer, - #[serde(default = "default_1456")] + #[serde(default = "default_1476")] pub related: Vec, } @@ -31558,36 +32399,36 @@ impl MemoryBacklinksInput { #[non_exhaustive] pub struct BriefEvidence { pub memory_key: String, - #[serde(default = "default_1461")] + #[serde(default = "default_1481")] pub source: String, - #[serde(default = "default_1462")] + #[serde(default = "default_1482")] pub source_class: String, - #[serde(default = "default_1463")] + #[serde(default = "default_1483")] pub verified: bool, - #[serde(default = "default_1464")] + #[serde(default = "default_1484")] pub when: String, - #[serde(default = "default_1465")] + #[serde(default = "default_1485")] pub session_id: String, - #[serde(default = "default_1466")] + #[serde(default = "default_1486")] pub excerpt: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryBriefOutput { - #[serde(default = "default_1457")] + #[serde(default = "default_1477")] pub query: String, - #[serde(default = "default_1458")] + #[serde(default = "default_1478")] pub answer: String, - #[serde(default = "default_1459")] + #[serde(default = "default_1479")] pub abstained: bool, - #[serde(default = "default_1460")] + #[serde(default = "default_1480")] pub grounding: String, - #[serde(default = "default_1467")] + #[serde(default = "default_1487")] pub evidence: Vec, - #[serde(default = "default_1468")] + #[serde(default = "default_1488")] pub unknowns: Vec, - #[serde(default = "default_1469")] + #[serde(default = "default_1489")] pub next_reads: Vec, } @@ -32001,9 +32842,9 @@ pub struct MemoryBulkGetOutputMemoryGetOutput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryBulkGetOutput { - #[serde(default = "default_1470")] + #[serde(default = "default_1490")] pub results: std::collections::HashMap, - #[serde(default = "default_1471")] + #[serde(default = "default_1491")] pub missing: Vec, } @@ -32516,7 +33357,7 @@ pub struct MemoryClearOutput { pub cleared_at: String, pub rows_affected: std::collections::HashMap, pub total: Integer, - #[serde(default = "default_1472")] + #[serde(default = "default_1492")] pub locked_skipped: Integer, } @@ -32604,21 +33445,21 @@ pub struct MemoryConsolidateResult { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryConsolidateOutput { - #[serde(default = "default_1473")] + #[serde(default = "default_1493")] pub consolidated: Vec, - #[serde(default = "default_1474")] + #[serde(default = "default_1494")] pub examined: Integer, - #[serde(default = "default_1475")] + #[serde(default = "default_1495")] pub clusters_found: Integer, - #[serde(default = "default_1476")] + #[serde(default = "default_1496")] pub clusters_failed: Integer, - #[serde(default = "default_1477")] + #[serde(default = "default_1497")] pub clusters_refused_lossy: Integer, - #[serde(default = "default_1478")] + #[serde(default = "default_1498")] pub skipped_in_flight: Integer, - #[serde(default = "default_1479")] + #[serde(default = "default_1499")] pub tokens_in: Integer, - #[serde(default = "default_1480")] + #[serde(default = "default_1500")] pub tokens_out: Integer, } @@ -32759,7 +33600,7 @@ impl MemoryConsolidateInput { #[non_exhaustive] pub struct MemoryCopyToOutput { pub copied: bool, - #[serde(default = "default_1481")] + #[serde(default = "default_1501")] pub target_memory_id: String, pub target_namespace: String, pub target_key: String, @@ -32870,11 +33711,11 @@ impl MemoryCopyToInput { #[non_exhaustive] pub struct MemoryCrossPromoteOutput { pub promoted: bool, - #[serde(default = "default_1482")] + #[serde(default = "default_1502")] pub target_memory_id: String, pub target_namespace: String, pub target_key: String, - #[serde(default = "default_1483")] + #[serde(default = "default_1503")] pub cross_promoted_from_memory_id: String, } @@ -32957,23 +33798,23 @@ pub struct DedupCollapsePair { #[non_exhaustive] pub struct MemoryDedupCollapseOutput { pub namespace: String, - #[serde(default = "default_1484")] + #[serde(default = "default_1504")] pub prefix: String, - #[serde(default = "default_1485")] + #[serde(default = "default_1505")] pub dry_run: bool, - #[serde(default = "default_1486")] + #[serde(default = "default_1506")] pub pairs: Integer, - #[serde(default = "default_1487")] + #[serde(default = "default_1507")] pub canonical_live: Integer, - #[serde(default = "default_1488")] + #[serde(default = "default_1508")] pub orphans: Integer, - #[serde(default = "default_1489")] + #[serde(default = "default_1509")] pub mirror_stale: Integer, - #[serde(default = "default_1490")] + #[serde(default = "default_1510")] pub restamped: Integer, - #[serde(default = "default_1491")] + #[serde(default = "default_1511")] pub truncated: bool, - #[serde(default = "default_1492")] + #[serde(default = "default_1512")] pub sample: Vec, } @@ -33072,7 +33913,7 @@ pub struct DedupDuplicate { pub memory_id: String, pub memory_key: String, pub agent: String, - #[serde(default = "default_1495")] + #[serde(default = "default_1515")] pub created_at: Option, } @@ -33080,12 +33921,12 @@ pub struct DedupDuplicate { #[non_exhaustive] pub struct DedupCluster { pub canonical_id: String, - #[serde(default = "default_1493")] + #[serde(default = "default_1513")] pub canonical_key: String, - #[serde(default = "default_1494")] + #[serde(default = "default_1514")] pub canonical_agent: String, pub dup_count: Integer, - #[serde(default = "default_1496")] + #[serde(default = "default_1516")] pub duplicates: Vec, } @@ -33157,11 +33998,11 @@ pub struct MemoryDedupResolveOutput { pub canonical_key: String, pub duplicate_key: String, pub decision: String, - #[serde(default = "default_1497")] + #[serde(default = "default_1517")] pub canonical_tombstoned: bool, - #[serde(default = "default_1498")] + #[serde(default = "default_1518")] pub duplicate_tombstoned: bool, - #[serde(default = "default_1499")] + #[serde(default = "default_1519")] pub ignored_args: Vec, } @@ -33299,17 +34140,17 @@ pub struct LostName { pub struct DefinitionEntry { pub memory_key: String, pub promoted_at: String, - #[serde(default = "default_1500")] + #[serde(default = "default_1520")] pub capped: bool, - #[serde(default = "default_1501")] + #[serde(default = "default_1521")] pub term: Option, - #[serde(default = "default_1502")] + #[serde(default = "default_1522")] pub aliases: Vec, - #[serde(default = "default_1503")] + #[serde(default = "default_1523")] pub verdict: Option, - #[serde(default = "default_1504")] + #[serde(default = "default_1524")] pub lapse_reason: Option, - #[serde(default = "default_1505")] + #[serde(default = "default_1525")] pub lost: Vec, } @@ -33370,15 +34211,15 @@ impl MemoryDefinitionsListInput { #[non_exhaustive] pub struct MemoryDeleteVersionOutput { pub tombstoned: bool, - #[serde(default = "default_1506")] + #[serde(default = "default_1526")] pub version: Integer, - #[serde(default = "default_1507")] + #[serde(default = "default_1527")] pub found: bool, - #[serde(default = "default_1508")] + #[serde(default = "default_1528")] pub reason: String, - #[serde(default = "default_1509")] + #[serde(default = "default_1529")] pub dependents_tombstoned: Integer, - #[serde(default = "default_1510")] + #[serde(default = "default_1530")] pub dependents_downgraded: Integer, } @@ -33505,21 +34346,21 @@ pub struct DemonstrationRow { pub struct MemoryDemonstrateOutput { pub query: String, pub demonstrations: Vec, - #[serde(default = "default_1511")] + #[serde(default = "default_1531")] pub votes: std::collections::HashMap, - #[serde(default = "default_1512")] + #[serde(default = "default_1532")] pub predicted_label: String, - #[serde(default = "default_1513")] + #[serde(default = "default_1533")] pub margin: f64, - #[serde(default = "default_1514")] + #[serde(default = "default_1534")] pub abstain: bool, - #[serde(default = "default_1515")] + #[serde(default = "default_1535")] pub abstain_reason: String, - #[serde(default = "default_1516")] + #[serde(default = "default_1536")] pub few_shot_block: String, - #[serde(default = "default_1517")] + #[serde(default = "default_1537")] pub examined: Integer, - #[serde(default = "default_1518")] + #[serde(default = "default_1538")] pub labelled: Integer, } @@ -33659,7 +34500,7 @@ impl MemoryDemonstrateInput { pub struct MemoryDemoteOutput { pub demoted: bool, pub was_reversible: bool, - #[serde(default = "default_1519")] + #[serde(default = "default_1539")] pub tombstoned_at: Option, } @@ -33721,15 +34562,15 @@ impl MemoryDemoteInput { pub struct DigestRow { pub session_id: String, pub summary_text: String, - #[serde(default = "default_1520")] + #[serde(default = "default_1540")] pub key_facts: Vec, - #[serde(default = "default_1521")] + #[serde(default = "default_1541")] pub derived_from: Vec, - #[serde(default = "default_1522")] + #[serde(default = "default_1542")] pub valid_at: Option, - #[serde(default = "default_1523")] + #[serde(default = "default_1543")] pub created_at: Option, - #[serde(default = "default_1524")] + #[serde(default = "default_1544")] pub version: Integer, } @@ -33737,7 +34578,7 @@ pub struct DigestRow { #[non_exhaustive] pub struct MemoryDigestsOutput { pub rows: Vec, - #[serde(default = "default_1525")] + #[serde(default = "default_1545")] pub truncated: bool, } @@ -33862,17 +34703,17 @@ pub struct MemoryEvidenceItem { pub evidence_id: String, pub support_type: String, pub scope: MemoryEvidenceItemScope, - #[serde(default = "default_1529")] + #[serde(default = "default_1549")] pub role: String, - #[serde(default = "default_1530")] + #[serde(default = "default_1550")] pub observed_at: Option, - #[serde(default = "default_1531")] + #[serde(default = "default_1551")] pub content: String, - #[serde(default = "default_1532")] + #[serde(default = "default_1552")] pub char_start: Integer, - #[serde(default = "default_1533")] + #[serde(default = "default_1553")] pub char_end: Integer, - #[serde(default = "default_1534")] + #[serde(default = "default_1554")] pub span: String, } @@ -33880,23 +34721,23 @@ pub struct MemoryEvidenceItem { #[non_exhaustive] pub struct MemoryEvidenceOutput { pub found: bool, - #[serde(default = "default_1526")] + #[serde(default = "default_1546")] pub memory_key: String, - #[serde(default = "default_1527")] + #[serde(default = "default_1547")] pub memory_id: String, - #[serde(default = "default_1528")] + #[serde(default = "default_1548")] pub value: String, - #[serde(default = "default_1535")] + #[serde(default = "default_1555")] pub items: Vec, - #[serde(default = "default_1536")] + #[serde(default = "default_1556")] pub truncated: bool, - #[serde(default = "default_1537")] + #[serde(default = "default_1557")] pub cited: Integer, - #[serde(default = "default_1538")] + #[serde(default = "default_1558")] pub lexical: Integer, - #[serde(default = "default_1539")] + #[serde(default = "default_1559")] pub window: Integer, - #[serde(default = "default_1540")] + #[serde(default = "default_1560")] pub derived: Integer, } @@ -34001,26 +34842,26 @@ impl MemoryEvidenceInput { #[non_exhaustive] pub struct EvidenceChunk { pub session_id: String, - #[serde(default = "default_1541")] + #[serde(default = "default_1561")] pub chunk_index: Integer, pub content: String, - #[serde(default = "default_1542")] + #[serde(default = "default_1562")] pub content_sha256: String, - #[serde(default = "default_1543")] + #[serde(default = "default_1563")] pub agent: String, - #[serde(default = "default_1544")] + #[serde(default = "default_1564")] pub user_id: String, - #[serde(default = "default_1545")] + #[serde(default = "default_1565")] pub parent_memory_key: String, - #[serde(default = "default_1546")] + #[serde(default = "default_1566")] pub memory_keys: Vec, - #[serde(default = "default_1547")] + #[serde(default = "default_1567")] pub line_start: Integer, - #[serde(default = "default_1548")] + #[serde(default = "default_1568")] pub line_end: Integer, - #[serde(default = "default_1549")] + #[serde(default = "default_1569")] pub created_at: String, - #[serde(default = "default_1550")] + #[serde(default = "default_1570")] pub source_url: String, } @@ -34029,17 +34870,17 @@ pub struct EvidenceChunk { pub struct EvidenceDigest { pub session_id: String, pub summary_text: String, - #[serde(default = "default_1552")] + #[serde(default = "default_1572")] pub agent: String, - #[serde(default = "default_1553")] + #[serde(default = "default_1573")] pub user_id: String, - #[serde(default = "default_1554")] + #[serde(default = "default_1574")] pub key_facts: Vec, - #[serde(default = "default_1555")] + #[serde(default = "default_1575")] pub derived_from: Vec, - #[serde(default = "default_1556")] + #[serde(default = "default_1576")] pub valid_at: String, - #[serde(default = "default_1557")] + #[serde(default = "default_1577")] pub created_at: String, } @@ -34049,28 +34890,28 @@ pub struct EvidenceEdge { pub from_key: String, pub to_key: String, pub relation: String, - #[serde(default = "default_1559")] + #[serde(default = "default_1579")] pub confidence: f64, - #[serde(default = "default_1560")] + #[serde(default = "default_1580")] pub explanation: String, - #[serde(default = "default_1561")] + #[serde(default = "default_1581")] pub created_at: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExportEvidenceOutput { - #[serde(default = "default_1551")] + #[serde(default = "default_1571")] pub chunks: Vec, - #[serde(default = "default_1558")] + #[serde(default = "default_1578")] pub digests: Vec, - #[serde(default = "default_1562")] + #[serde(default = "default_1582")] pub edges: Vec, - #[serde(default = "default_1563")] + #[serde(default = "default_1583")] pub has_more: bool, - #[serde(default = "default_1564")] + #[serde(default = "default_1584")] pub next_cursor: String, - #[serde(default = "default_1565")] + #[serde(default = "default_1585")] pub held_high: Integer, } @@ -34263,15 +35104,15 @@ impl ExposureSummaryInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExtractionRetryMineOutput { - #[serde(default = "default_1566")] + #[serde(default = "default_1586")] pub requeued: Vec, - #[serde(default = "default_1567")] + #[serde(default = "default_1587")] pub not_failed: Vec, - #[serde(default = "default_1568")] + #[serde(default = "default_1588")] pub model_calls_off: Vec, - #[serde(default = "default_1569")] + #[serde(default = "default_1589")] pub expired: Vec, - #[serde(default = "default_1570")] + #[serde(default = "default_1590")] pub unknown: Vec, } @@ -34332,20 +35173,20 @@ pub struct ExtractionQueueRow { pub content_chars: Integer, pub written: Integer, pub last_error: String, - #[serde(default = "default_1571")] + #[serde(default = "default_1591")] pub enqueued_at: Option, - #[serde(default = "default_1572")] + #[serde(default = "default_1592")] pub updated_at: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExtractionStatusOutput { - #[serde(default = "default_1573")] + #[serde(default = "default_1593")] pub batches: Vec, - #[serde(default = "default_1574")] + #[serde(default = "default_1594")] pub pending: Integer, - #[serde(default = "default_1575")] + #[serde(default = "default_1595")] pub failed: Integer, } @@ -34493,13 +35334,13 @@ impl MemoryExtractionStatusInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExtractionStatusMineOutput { - #[serde(default = "default_1576")] + #[serde(default = "default_1596")] pub batches: Vec, - #[serde(default = "default_1577")] + #[serde(default = "default_1597")] pub unknown: Vec, - #[serde(default = "default_1578")] + #[serde(default = "default_1598")] pub pending: Integer, - #[serde(default = "default_1579")] + #[serde(default = "default_1599")] pub failed: Integer, } @@ -34620,39 +35461,39 @@ pub struct MemoryForFileHit { pub memory_key: String, pub memory_type: String, pub value: String, - #[serde(default = "default_1580")] + #[serde(default = "default_1600")] pub value_truncated: bool, - #[serde(default = "default_1581")] + #[serde(default = "default_1601")] pub tags: Vec, - #[serde(default = "default_1582")] + #[serde(default = "default_1602")] pub confidence: f64, - #[serde(default = "default_1583")] + #[serde(default = "default_1603")] pub pinned: bool, - #[serde(default = "default_1584")] + #[serde(default = "default_1604")] pub status: String, - #[serde(default = "default_1585")] + #[serde(default = "default_1605")] pub agent: String, - #[serde(default = "default_1586")] + #[serde(default = "default_1606")] pub updated_at: Option, - #[serde(default = "default_1587")] + #[serde(default = "default_1607")] pub namespace: String, - #[serde(default = "default_1588")] + #[serde(default = "default_1608")] pub actor: String, - #[serde(default = "default_1589")] + #[serde(default = "default_1609")] pub supersedes_key: String, - #[serde(default = "default_1590")] + #[serde(default = "default_1610")] pub supersedes: String, - #[serde(default = "default_1591")] + #[serde(default = "default_1611")] pub supersedes_kind: MemoryForFileHitSupersedesKind, - #[serde(default = "default_1592")] + #[serde(default = "default_1612")] pub matched_files: Vec, - #[serde(default = "default_1593")] + #[serde(default = "default_1613")] pub source_resource_id: String, - #[serde(default = "default_1594")] + #[serde(default = "default_1614")] pub verification: MemoryForFileHitVerification, - #[serde(default = "default_1595")] + #[serde(default = "default_1615")] pub code_state: MemoryForFileHitCodeState, - #[serde(default = "default_1596")] + #[serde(default = "default_1616")] pub code_moved: Vec, } @@ -34662,7 +35503,7 @@ pub struct MemoryForFilePrintedRow { pub namespace: String, pub memory_key: String, pub line: String, - #[serde(default = "default_1600")] + #[serde(default = "default_1620")] pub binding: bool, } @@ -34672,13 +35513,13 @@ pub struct MemoryForFileOutput { pub path: String, pub total: Integer, pub hits: Vec, - #[serde(default = "default_1597")] + #[serde(default = "default_1617")] pub rendered: String, - #[serde(default = "default_1598")] + #[serde(default = "default_1618")] pub tokens_estimate: Integer, - #[serde(default = "default_1599")] + #[serde(default = "default_1619")] pub truncated: bool, - #[serde(default = "default_1601")] + #[serde(default = "default_1621")] pub printed: Vec, } @@ -34786,61 +35627,61 @@ impl MemoryForFileInput { #[non_exhaustive] pub struct MemoryGetByIdOutput { pub found: bool, - #[serde(default = "default_1602")] + #[serde(default = "default_1622")] pub memory_id: String, - #[serde(default = "default_1603")] + #[serde(default = "default_1623")] pub namespace: String, - #[serde(default = "default_1604")] + #[serde(default = "default_1624")] pub agent: String, - #[serde(default = "default_1605")] + #[serde(default = "default_1625")] pub user_id: String, - #[serde(default = "default_1606")] + #[serde(default = "default_1626")] pub session_id: String, - #[serde(default = "default_1607")] + #[serde(default = "default_1627")] pub memory_key: String, - #[serde(default = "default_1608")] + #[serde(default = "default_1628")] pub memory_type: Option, - #[serde(default = "default_1609")] + #[serde(default = "default_1629")] pub value: Value, - #[serde(default = "default_1610")] + #[serde(default = "default_1630")] pub confidence: Option, - #[serde(default = "default_1611")] + #[serde(default = "default_1631")] pub version: Option, - #[serde(default = "default_1612")] + #[serde(default = "default_1632")] pub created_at: Option, - #[serde(default = "default_1613")] + #[serde(default = "default_1633")] pub expires_at: Option, - #[serde(default = "default_1614")] + #[serde(default = "default_1634")] pub valid_at: Option, - #[serde(default = "default_1615")] + #[serde(default = "default_1635")] pub valid_to: Option, - #[serde(default = "default_1616")] + #[serde(default = "default_1636")] pub pinned: bool, - #[serde(default = "default_1617")] + #[serde(default = "default_1637")] pub content_sha256: String, - #[serde(default = "default_1618")] + #[serde(default = "default_1638")] pub verified_by: String, - #[serde(default = "default_1619")] + #[serde(default = "default_1639")] pub verified_at: Option, - #[serde(default = "default_1620")] + #[serde(default = "default_1640")] pub verification: String, - #[serde(default = "default_1621")] + #[serde(default = "default_1641")] pub sensitivity: String, - #[serde(default = "default_1622")] + #[serde(default = "default_1642")] pub actor: String, - #[serde(default = "default_1623")] + #[serde(default = "default_1643")] pub source_class: String, - #[serde(default = "default_1624")] + #[serde(default = "default_1644")] pub lock_mode: String, - #[serde(default = "default_1625")] + #[serde(default = "default_1645")] pub lock_reason: String, - #[serde(default = "default_1626")] + #[serde(default = "default_1646")] pub lock_until: Option, - #[serde(default = "default_1627")] + #[serde(default = "default_1647")] pub locked_by: String, - #[serde(default = "default_1628")] + #[serde(default = "default_1648")] pub on_expire: String, - #[serde(default = "default_1629")] + #[serde(default = "default_1649")] pub expire_reason: String, } @@ -34916,41 +35757,41 @@ pub struct MemoryHealthTopRow { pub memory_type: String, pub recall_count: Integer, pub used_count: Integer, - #[serde(default = "default_1632")] + #[serde(default = "default_1652")] pub harm_count: Integer, - #[serde(default = "default_1633")] + #[serde(default = "default_1653")] pub last_recalled_at: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryHealthStaleness { - #[serde(default = "default_1635")] + #[serde(default = "default_1655")] pub by_age: std::collections::HashMap, - #[serde(default = "default_1636")] + #[serde(default = "default_1656")] pub with_validity_end: Integer, - #[serde(default = "default_1637")] + #[serde(default = "default_1657")] pub with_validity_end_share: f64, - #[serde(default = "default_1638")] + #[serde(default = "default_1658")] pub with_expiry: Integer, - #[serde(default = "default_1639")] + #[serde(default = "default_1659")] pub expiring_7d: Integer, - #[serde(default = "default_1640")] + #[serde(default = "default_1660")] pub pinned: Integer, - #[serde(default = "default_1641")] + #[serde(default = "default_1661")] pub days_since_reinforced_p50: Integer, - #[serde(default = "default_1642")] + #[serde(default = "default_1662")] pub days_since_reinforced_p90: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryHealthFootprint { - #[serde(default = "default_1644")] + #[serde(default = "default_1664")] pub value_chars: Integer, - #[serde(default = "default_1645")] + #[serde(default = "default_1665")] pub value_tokens_est: Integer, - #[serde(default = "default_1646")] + #[serde(default = "default_1666")] pub tokens_per_row_est: f64, } @@ -34960,19 +35801,19 @@ pub struct MemoryHealthOutput { pub live: Integer, pub recalled_ever: Integer, pub used_ever: Integer, - #[serde(default = "default_1630")] + #[serde(default = "default_1650")] pub harmed_ever: Integer, pub silent: Integer, pub silent_older: Integer, pub silent_share: f64, pub silent_after_days: Integer, - #[serde(default = "default_1631")] + #[serde(default = "default_1651")] pub by_type: Vec, - #[serde(default = "default_1634")] + #[serde(default = "default_1654")] pub top_recalled: Vec, - #[serde(default = "default_1643")] + #[serde(default = "default_1663")] pub staleness: MemoryHealthStaleness, - #[serde(default = "default_1647")] + #[serde(default = "default_1667")] pub footprint: MemoryHealthFootprint, } @@ -35092,51 +35933,51 @@ impl MemoryHealthInput { pub struct MemoryHistoryRow { pub memory_id: String, pub version: Integer, - #[serde(default = "default_1648")] + #[serde(default = "default_1668")] pub version_text: String, - #[serde(default = "default_1649")] + #[serde(default = "default_1669")] pub value: Value, pub confidence: f64, - #[serde(default = "default_1650")] + #[serde(default = "default_1670")] pub source_trace: String, - #[serde(default = "default_1651")] + #[serde(default = "default_1671")] pub pinned: bool, pub created_at: String, - #[serde(default = "default_1652")] + #[serde(default = "default_1672")] pub expires_at: Option, - #[serde(default = "default_1653")] + #[serde(default = "default_1673")] pub tombstoned_at: Option, - #[serde(default = "default_1654")] + #[serde(default = "default_1674")] pub redacted_at: Option, - #[serde(default = "default_1655")] + #[serde(default = "default_1675")] pub redaction_reason: String, - #[serde(default = "default_1656")] + #[serde(default = "default_1676")] pub content_sha256: String, - #[serde(default = "default_1657")] + #[serde(default = "default_1677")] pub actor: String, - #[serde(default = "default_1658")] + #[serde(default = "default_1678")] pub source_class: String, - #[serde(default = "default_1659")] + #[serde(default = "default_1679")] pub agent: String, - #[serde(default = "default_1660")] + #[serde(default = "default_1680")] pub written_at: Option, - #[serde(default = "default_1661")] + #[serde(default = "default_1681")] pub status: String, - #[serde(default = "default_1662")] + #[serde(default = "default_1682")] pub conflict_with: Vec, - #[serde(default = "default_1663")] + #[serde(default = "default_1683")] pub tags: Vec, - #[serde(default = "default_1664")] + #[serde(default = "default_1684")] pub verified_at: Option, - #[serde(default = "default_1665")] + #[serde(default = "default_1685")] pub verified_by: String, - #[serde(default = "default_1666")] + #[serde(default = "default_1686")] pub verified_sha256: String, - #[serde(default = "default_1667")] + #[serde(default = "default_1687")] pub lock_mode: String, - #[serde(default = "default_1668")] + #[serde(default = "default_1688")] pub lock_reason: String, - #[serde(default = "default_1669")] + #[serde(default = "default_1689")] pub lock_until: Option, } @@ -35246,13 +36087,13 @@ impl MemoryHistoryInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryImportTotals { - #[serde(default = "default_1670")] + #[serde(default = "default_1690")] pub written: Integer, - #[serde(default = "default_1671")] + #[serde(default = "default_1691")] pub held: Integer, - #[serde(default = "default_1672")] + #[serde(default = "default_1692")] pub skipped: Integer, - #[serde(default = "default_1673")] + #[serde(default = "default_1693")] pub refused: Integer, } @@ -35335,11 +36176,11 @@ pub struct MemoryImportResult { pub index: Integer, pub key: String, pub outcome: MemoryImportResultOutcome, - #[serde(default = "default_1674")] + #[serde(default = "default_1694")] pub reason: MemoryImportResultReason, - #[serde(default = "default_1675")] + #[serde(default = "default_1695")] pub held_by: String, - #[serde(default = "default_1676")] + #[serde(default = "default_1696")] pub note: MemoryImportResultNote, } @@ -35348,7 +36189,7 @@ pub struct MemoryImportResult { pub struct MemoryImportOutput { pub totals: MemoryImportTotals, pub results: Vec, - #[serde(default = "default_1677")] + #[serde(default = "default_1697")] pub dry_run: bool, } @@ -35541,9 +36382,9 @@ pub struct MemoryImportCuratedRow { pub section_heading: String, pub bytes_written: Integer, pub verdict: String, - #[serde(default = "default_1678")] + #[serde(default = "default_1698")] pub rejection_reason: String, - #[serde(default = "default_1679")] + #[serde(default = "default_1699")] pub pinned_blocker_id: Option, } @@ -35635,21 +36476,21 @@ impl MemoryImportCuratedInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryImportEvidenceOutput { - #[serde(default = "default_1680")] + #[serde(default = "default_1700")] pub chunks_written: Integer, - #[serde(default = "default_1681")] + #[serde(default = "default_1701")] pub links_written: Integer, - #[serde(default = "default_1682")] + #[serde(default = "default_1702")] pub digests_written: Integer, - #[serde(default = "default_1683")] + #[serde(default = "default_1703")] pub embedding_model: String, - #[serde(default = "default_1684")] + #[serde(default = "default_1704")] pub embedding_dim: Integer, - #[serde(default = "default_1685")] + #[serde(default = "default_1705")] pub edited: Vec, - #[serde(default = "default_1686")] + #[serde(default = "default_1706")] pub skipped: Integer, - #[serde(default = "default_1687")] + #[serde(default = "default_1707")] pub unchecked: Integer, } @@ -35986,7 +36827,7 @@ pub struct InspectRow { pub memory_key: String, pub memory_id: String, pub version: Integer, - #[serde(default = "default_1697")] + #[serde(default = "default_1717")] pub content_sha256: String, pub memory_type: String, pub status: String, @@ -35997,9 +36838,9 @@ pub struct InspectRow { pub actor: String, pub updated_at: String, pub sensitivity: String, - #[serde(default = "default_1698")] + #[serde(default = "default_1718")] pub versions: Integer, - #[serde(default = "default_1699")] + #[serde(default = "default_1719")] pub excerpt: String, } @@ -36007,27 +36848,27 @@ pub struct InspectRow { #[non_exhaustive] pub struct InspectView { pub definition: String, - #[serde(default = "default_1688")] + #[serde(default = "default_1708")] pub refs: Vec, - #[serde(default = "default_1689")] + #[serde(default = "default_1709")] pub live_rows: Integer, - #[serde(default = "default_1690")] + #[serde(default = "default_1710")] pub by_type: Vec, - #[serde(default = "default_1691")] + #[serde(default = "default_1711")] pub by_status: Vec, - #[serde(default = "default_1692")] + #[serde(default = "default_1712")] pub by_source_class: Vec, - #[serde(default = "default_1693")] + #[serde(default = "default_1713")] pub top_tags: Vec, - #[serde(default = "default_1694")] + #[serde(default = "default_1714")] pub categories: Vec, - #[serde(default = "default_1695")] + #[serde(default = "default_1715")] pub first_updated_at: Option, - #[serde(default = "default_1696")] + #[serde(default = "default_1716")] pub last_updated_at: Option, - #[serde(default = "default_1700")] + #[serde(default = "default_1720")] pub newest: Vec, - #[serde(default = "default_1701")] + #[serde(default = "default_1721")] pub complete: bool, } @@ -36043,32 +36884,32 @@ pub struct InspectCall { #[non_exhaustive] pub struct InspectActivity { pub window_seconds: Integer, - #[serde(default = "default_1702")] + #[serde(default = "default_1722")] pub calls: Vec, - #[serde(default = "default_1703")] + #[serde(default = "default_1723")] pub first_at: Option, - #[serde(default = "default_1704")] + #[serde(default = "default_1724")] pub last_at: Option, - #[serde(default = "default_1705")] + #[serde(default = "default_1725")] pub gap: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct InspectSettings { - #[serde(default = "default_1706")] + #[serde(default = "default_1726")] pub guide_revision: Integer, - #[serde(default = "default_1707")] + #[serde(default = "default_1727")] pub guide_summary: String, - #[serde(default = "default_1708")] + #[serde(default = "default_1728")] pub categories_registered: Integer, - #[serde(default = "default_1709")] + #[serde(default = "default_1729")] pub extraction_policy: Option, - #[serde(default = "default_1710")] + #[serde(default = "default_1730")] pub extraction_policy_unavailable: String, - #[serde(default = "default_1711")] + #[serde(default = "default_1731")] pub extraction_instructions: String, - #[serde(default = "default_1712")] + #[serde(default = "default_1732")] pub extraction_instructions_refs: Vec, } @@ -36084,7 +36925,7 @@ pub struct MemoryInspectOutput { pub others: InspectView, pub activity: InspectActivity, pub settings: InspectSettings, - #[serde(default = "default_1713")] + #[serde(default = "default_1733")] pub skipped: Vec, } @@ -36178,7 +37019,7 @@ pub struct MemoryKeyRef { #[non_exhaustive] pub struct MemoryKeysOutput { pub keys: Vec, - #[serde(default = "default_1714")] + #[serde(default = "default_1734")] pub truncated: bool, } @@ -36281,9 +37122,9 @@ pub struct LineageCandidate { pub decided_at: String, pub decided_by: String, pub match_confidence: LineageCandidateMatchConfidence, - #[serde(default = "default_1723")] + #[serde(default = "default_1743")] pub seeded_from_thread_id: String, - #[serde(default = "default_1724")] + #[serde(default = "default_1744")] pub seeded_from_msg_id: String, } @@ -36301,25 +37142,25 @@ pub struct LineageAuditEvent { pub struct MemoryLineageOutput { pub found: bool, pub memory_key: String, - #[serde(default = "default_1715")] + #[serde(default = "default_1735")] pub promotion_event: String, - #[serde(default = "default_1716")] + #[serde(default = "default_1736")] pub promoted_by: String, - #[serde(default = "default_1717")] + #[serde(default = "default_1737")] pub promoted_at: Option, - #[serde(default = "default_1718")] + #[serde(default = "default_1738")] pub rationale: String, - #[serde(default = "default_1719")] + #[serde(default = "default_1739")] pub source_trace: String, - #[serde(default = "default_1720")] + #[serde(default = "default_1740")] pub source_resource_id: String, - #[serde(default = "default_1721")] + #[serde(default = "default_1741")] pub mechanism: MemoryLineageOutputMechanism, - #[serde(default = "default_1722")] + #[serde(default = "default_1742")] pub supporters: Vec, - #[serde(default = "default_1725")] + #[serde(default = "default_1745")] pub candidate: Option, - #[serde(default = "default_1726")] + #[serde(default = "default_1746")] pub audit_chain: Vec, } @@ -36448,11 +37289,11 @@ pub struct MemoryLinkOutput { pub from_key: String, pub to_key: String, pub relation: String, - #[serde(default = "default_1727")] + #[serde(default = "default_1747")] pub confidence: f64, - #[serde(default = "default_1728")] + #[serde(default = "default_1748")] pub conflict_opened: bool, - #[serde(default = "default_1729")] + #[serde(default = "default_1749")] pub relation_defaulted: bool, } @@ -36766,17 +37607,17 @@ pub struct MemoryListEntry { pub struct MemoryListOutput { pub entries: Vec, pub truncated: bool, - #[serde(default = "default_1730")] + #[serde(default = "default_1750")] pub total: Integer, - #[serde(default = "default_1731")] + #[serde(default = "default_1751")] pub today: Integer, - #[serde(default = "default_1732")] + #[serde(default = "default_1752")] pub namespace_version: String, - #[serde(default = "default_1733")] + #[serde(default = "default_1753")] pub unchanged: bool, - #[serde(default = "default_1734")] + #[serde(default = "default_1754")] pub hidden: Integer, - #[serde(default = "default_1735")] + #[serde(default = "default_1755")] pub hidden_hint: String, } @@ -37162,19 +38003,19 @@ impl MemoryListInput { #[non_exhaustive] pub struct MemoryLockOutput { pub locked: bool, - #[serde(default = "default_1736")] + #[serde(default = "default_1756")] pub reason: String, - #[serde(default = "default_1737")] + #[serde(default = "default_1757")] pub memory_id: String, - #[serde(default = "default_1738")] + #[serde(default = "default_1758")] pub version: Option, - #[serde(default = "default_1739")] + #[serde(default = "default_1759")] pub lock_mode: String, - #[serde(default = "default_1740")] + #[serde(default = "default_1760")] pub lock_until: Option, - #[serde(default = "default_1741")] + #[serde(default = "default_1761")] pub locked_by: String, - #[serde(default = "default_1742")] + #[serde(default = "default_1762")] pub previous_mode: String, } @@ -37333,21 +38174,21 @@ pub struct MemoryMoveOutput { pub from_key: String, pub to_key: String, pub redirected: bool, - #[serde(default = "default_1743")] + #[serde(default = "default_1763")] pub memory_id: String, - #[serde(default = "default_1744")] + #[serde(default = "default_1764")] pub version: Integer, - #[serde(default = "default_1745")] + #[serde(default = "default_1765")] pub content_sha256: String, - #[serde(default = "default_1746")] + #[serde(default = "default_1766")] pub advisories: Vec, - #[serde(default = "default_1747")] + #[serde(default = "default_1767")] pub dry_run: bool, - #[serde(default = "default_1748")] + #[serde(default = "default_1768")] pub memory_type: String, - #[serde(default = "default_1749")] + #[serde(default = "default_1769")] pub value_preview: String, - #[serde(default = "default_1750")] + #[serde(default = "default_1770")] pub sensitivity: String, } @@ -37559,7 +38400,7 @@ impl MemoryMoveInput { pub struct MemoryOutcomeOutput { pub recorded: bool, pub evidence_count_after: Integer, - #[serde(default = "default_1751")] + #[serde(default = "default_1771")] pub quarantined: bool, } @@ -37802,13 +38643,13 @@ impl MemoryOutcomeRunInput { #[non_exhaustive] pub struct OutlineSession { pub session_id: String, - #[serde(default = "default_1753")] + #[serde(default = "default_1773")] pub date: String, - #[serde(default = "default_1754")] + #[serde(default = "default_1774")] pub headline: String, - #[serde(default = "default_1755")] + #[serde(default = "default_1775")] pub key_facts: Integer, - #[serde(default = "default_1756")] + #[serde(default = "default_1776")] pub rows: Integer, } @@ -37816,7 +38657,7 @@ pub struct OutlineSession { #[non_exhaustive] pub struct OutlineHub { pub entity: String, - #[serde(default = "default_1759")] + #[serde(default = "default_1779")] pub degree: Integer, } @@ -37824,28 +38665,28 @@ pub struct OutlineHub { #[non_exhaustive] pub struct OutlineCommunity { pub community_id: Integer, - #[serde(default = "default_1761")] + #[serde(default = "default_1781")] pub label: String, - #[serde(default = "default_1762")] + #[serde(default = "default_1782")] pub size: Integer, - #[serde(default = "default_1763")] + #[serde(default = "default_1783")] pub computed_at: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryOutlineOutput { - #[serde(default = "default_1752")] + #[serde(default = "default_1772")] pub rows_by_type: std::collections::HashMap, - #[serde(default = "default_1757")] + #[serde(default = "default_1777")] pub sessions: Vec, - #[serde(default = "default_1758")] + #[serde(default = "default_1778")] pub sessions_total: Integer, - #[serde(default = "default_1760")] + #[serde(default = "default_1780")] pub hubs: Vec, - #[serde(default = "default_1764")] + #[serde(default = "default_1784")] pub communities: Vec, - #[serde(default = "default_1765")] + #[serde(default = "default_1785")] pub profile_chars: Integer, } @@ -37997,7 +38838,7 @@ pub struct OwnerUsageRow { pub recalls: Integer, pub used: Integer, pub harm: Integer, - #[serde(default = "default_1766")] + #[serde(default = "default_1786")] pub last_recalled: Option, } @@ -38484,7 +39325,7 @@ pub struct MemoryPromoteOutput { pub shared_memory_key: String, pub promotion_event: String, pub reversible_until: String, - #[serde(default = "default_1767")] + #[serde(default = "default_1787")] pub ignored_args: Vec, } @@ -38653,18 +39494,18 @@ impl MemoryPromoteInput { pub struct MemoryProposalDecision { pub memory_key: String, pub decided: bool, - #[serde(default = "default_1769")] + #[serde(default = "default_1789")] pub status: String, - #[serde(default = "default_1770")] + #[serde(default = "default_1790")] pub reason: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryProposalDecideOutput { - #[serde(default = "default_1768")] + #[serde(default = "default_1788")] pub decided: Integer, - #[serde(default = "default_1771")] + #[serde(default = "default_1791")] pub results: Vec, } @@ -38765,33 +39606,33 @@ pub enum MemoryProposalReady { pub struct MemoryProposal { pub memory_key: String, pub memory_id: String, - #[serde(default = "default_1772")] + #[serde(default = "default_1792")] pub content_sha256: String, - #[serde(default = "default_1773")] + #[serde(default = "default_1793")] pub agent: String, - #[serde(default = "default_1774")] + #[serde(default = "default_1794")] pub memory_type: String, - #[serde(default = "default_1775")] + #[serde(default = "default_1795")] pub value_preview: String, - #[serde(default = "default_1776")] + #[serde(default = "default_1796")] pub sensitivity: String, - #[serde(default = "default_1777")] + #[serde(default = "default_1797")] pub tags: Vec, - #[serde(default = "default_1778")] + #[serde(default = "default_1798")] pub created_at: String, - #[serde(default = "default_1779")] + #[serde(default = "default_1799")] pub graded_passes: Integer, - #[serde(default = "default_1780")] + #[serde(default = "default_1800")] pub graded_fails: Integer, - #[serde(default = "default_1781")] + #[serde(default = "default_1801")] pub last_graded_at: String, - #[serde(default = "default_1782")] + #[serde(default = "default_1802")] pub used_count: Integer, - #[serde(default = "default_1783")] + #[serde(default = "default_1803")] pub harm_count: Integer, - #[serde(default = "default_1784")] + #[serde(default = "default_1804")] pub ready: MemoryProposalReady, - #[serde(default = "default_1785")] + #[serde(default = "default_1805")] pub conflict_with: Vec, } @@ -38807,24 +39648,24 @@ pub enum ProposalPolicyMode { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProposalPolicy { - #[serde(default = "default_1788")] + #[serde(default = "default_1808")] pub mode: ProposalPolicyMode, - #[serde(default = "default_1789")] + #[serde(default = "default_1809")] pub min_passes: Integer, - #[serde(default = "default_1790")] + #[serde(default = "default_1810")] pub max_fails: Integer, - #[serde(default = "default_1791")] + #[serde(default = "default_1811")] pub reject_after_fails: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryProposalsOutput { - #[serde(default = "default_1786")] + #[serde(default = "default_1806")] pub proposals: Vec, - #[serde(default = "default_1787")] + #[serde(default = "default_1807")] pub total: Integer, - #[serde(default = "default_1792")] + #[serde(default = "default_1812")] pub policy: ProposalPolicy, } @@ -38942,19 +39783,19 @@ impl MemoryProposalsInput { pub struct MemoryProvenanceLink { pub direction: String, pub memory_key: String, - #[serde(default = "default_1806")] + #[serde(default = "default_1826")] pub relation: String, - #[serde(default = "default_1807")] + #[serde(default = "default_1827")] pub label: String, - #[serde(default = "default_1808")] + #[serde(default = "default_1828")] pub explanation: String, - #[serde(default = "default_1809")] + #[serde(default = "default_1829")] pub evidence: Vec, - #[serde(default = "default_1810")] + #[serde(default = "default_1830")] pub confidence: f64, - #[serde(default = "default_1811")] + #[serde(default = "default_1831")] pub author: String, - #[serde(default = "default_1812")] + #[serde(default = "default_1832")] pub run_id: String, } @@ -38962,33 +39803,33 @@ pub struct MemoryProvenanceLink { #[non_exhaustive] pub struct MemoryProvenanceOutput { pub found: bool, - #[serde(default = "default_1793")] + #[serde(default = "default_1813")] pub source_trace: String, - #[serde(default = "default_1794")] + #[serde(default = "default_1814")] pub source_kind: String, - #[serde(default = "default_1795")] + #[serde(default = "default_1815")] pub actor: String, - #[serde(default = "default_1796")] + #[serde(default = "default_1816")] pub source_class: String, - #[serde(default = "default_1797")] + #[serde(default = "default_1817")] pub source_label: String, - #[serde(default = "default_1798")] + #[serde(default = "default_1818")] pub thread_id: String, - #[serde(default = "default_1799")] + #[serde(default = "default_1819")] pub thread_exists: bool, - #[serde(default = "default_1800")] + #[serde(default = "default_1820")] pub thread_title: String, - #[serde(default = "default_1801")] + #[serde(default = "default_1821")] pub agent: String, - #[serde(default = "default_1802")] + #[serde(default = "default_1822")] pub session_id: String, - #[serde(default = "default_1803")] + #[serde(default = "default_1823")] pub run_id: String, - #[serde(default = "default_1804")] + #[serde(default = "default_1824")] pub written_at: String, - #[serde(default = "default_1805")] + #[serde(default = "default_1825")] pub source_resource_id: String, - #[serde(default = "default_1813")] + #[serde(default = "default_1833")] pub links: Vec, } @@ -39083,17 +39924,17 @@ impl MemoryProvenanceInput { pub struct RecallTurn { pub evidence_id: String, pub session_id: String, - #[serde(default = "default_1814")] + #[serde(default = "default_1834")] pub role: String, - #[serde(default = "default_1815")] + #[serde(default = "default_1835")] pub actor: String, - #[serde(default = "default_1816")] + #[serde(default = "default_1836")] pub observed_at: String, - #[serde(default = "default_1817")] + #[serde(default = "default_1837")] pub content: String, - #[serde(default = "default_1818")] + #[serde(default = "default_1838")] pub truncated: bool, - #[serde(default = "default_1819")] + #[serde(default = "default_1839")] pub matched_tokens: Integer, } @@ -39110,21 +39951,21 @@ pub enum MemoryRecallOutputOrder { #[non_exhaustive] pub struct MemoryRecallOutput { pub turns: Vec, - #[serde(default = "default_1820")] + #[serde(default = "default_1840")] pub total_matched: Integer, - #[serde(default = "default_1821")] + #[serde(default = "default_1841")] pub returned: Integer, - #[serde(default = "default_1822")] + #[serde(default = "default_1842")] pub has_more: bool, - #[serde(default = "default_1823")] + #[serde(default = "default_1843")] pub next_cursor: String, - #[serde(default = "default_1824")] + #[serde(default = "default_1844")] pub next_offset: Integer, - #[serde(default = "default_1825")] + #[serde(default = "default_1845")] pub order: MemoryRecallOutputOrder, - #[serde(default = "default_1826")] + #[serde(default = "default_1846")] pub query_tokens: Vec, - #[serde(default = "default_1827")] + #[serde(default = "default_1847")] pub tokens_returned: Integer, } @@ -39406,19 +40247,19 @@ pub struct MemoryRecordConflictRow { pub schema_name: String, pub memory_key: String, pub field_name: String, - #[serde(default = "default_1828")] + #[serde(default = "default_1848")] pub prior_value: Value, - #[serde(default = "default_1829")] + #[serde(default = "default_1849")] pub incoming_value: Value, pub prior_record_id: String, pub incoming_record_id: String, - #[serde(default = "default_1830")] + #[serde(default = "default_1850")] pub prior_memory_id: String, - #[serde(default = "default_1831")] + #[serde(default = "default_1851")] pub incoming_memory_id: String, - #[serde(default = "default_1832")] + #[serde(default = "default_1852")] pub detected_at: Option, - #[serde(default = "default_1833")] + #[serde(default = "default_1853")] pub resolved_at: Option, } @@ -39426,7 +40267,7 @@ pub struct MemoryRecordConflictRow { #[non_exhaustive] pub struct MemoryRecordConflictsOutput { pub rows: Vec, - #[serde(default = "default_1834")] + #[serde(default = "default_1854")] pub truncated: bool, } @@ -39536,19 +40377,19 @@ pub enum MemoryRecordRowStatus { #[non_exhaustive] pub struct MemoryRecordRow { pub record_id: String, - #[serde(default = "default_1835")] + #[serde(default = "default_1855")] pub memory_key: String, - #[serde(default = "default_1836")] + #[serde(default = "default_1856")] pub memory_id: String, - #[serde(default = "default_1837")] + #[serde(default = "default_1857")] pub record: std::collections::HashMap, - #[serde(default = "default_1838")] + #[serde(default = "default_1858")] pub field_states: std::collections::HashMap, - #[serde(default = "default_1839")] + #[serde(default = "default_1859")] pub status: MemoryRecordRowStatus, - #[serde(default = "default_1840")] + #[serde(default = "default_1860")] pub valid_at: Option, - #[serde(default = "default_1841")] + #[serde(default = "default_1861")] pub valid_to: Option, } @@ -39615,7 +40456,7 @@ impl MemoryRecordHistoryInput { #[non_exhaustive] pub struct MemoryRecordQueryOutput { pub rows: Vec, - #[serde(default = "default_1842")] + #[serde(default = "default_1862")] pub truncated: bool, } @@ -39839,15 +40680,15 @@ pub enum MemoryRecordWriteOutputKeySource { pub struct MemoryRecordWriteOutput { pub record_id: String, pub field_count: Integer, - #[serde(default = "default_1843")] + #[serde(default = "default_1863")] pub memory_key: String, - #[serde(default = "default_1844")] + #[serde(default = "default_1864")] pub key_source: MemoryRecordWriteOutputKeySource, - #[serde(default = "default_1845")] + #[serde(default = "default_1865")] pub fold: std::collections::HashMap, - #[serde(default = "default_1846")] + #[serde(default = "default_1866")] pub superseded_record_id: String, - #[serde(default = "default_1847")] + #[serde(default = "default_1867")] pub conflicts: Integer, } @@ -40090,13 +40931,13 @@ impl MemoryRecordWriteInput { #[non_exhaustive] pub struct MemoryRedactOutput { pub redacted: bool, - #[serde(default = "default_1848")] + #[serde(default = "default_1868")] pub refused_head: bool, - #[serde(default = "default_1849")] + #[serde(default = "default_1869")] pub redacted_at: Option, - #[serde(default = "default_1850")] + #[serde(default = "default_1870")] pub cache_rows_deleted: Integer, - #[serde(default = "default_1851")] + #[serde(default = "default_1871")] pub precedent_rows_deleted: Integer, } @@ -40256,7 +41097,7 @@ impl MemoryReindexInput { #[non_exhaustive] pub struct MemoryRejectOutput { pub rejected: bool, - #[serde(default = "default_1852")] + #[serde(default = "default_1872")] pub rejected_at: Option, } @@ -40372,7 +41213,7 @@ pub struct MemoryRelatedHit { pub struct MemoryRelatedOutput { pub results: Vec, pub source_entities: Vec, - #[serde(default = "default_1853")] + #[serde(default = "default_1873")] pub reason: String, } @@ -40487,13 +41328,13 @@ impl MemoryRelatedInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryResolveOrphanDuplicatesOutput { - #[serde(default = "default_1854")] + #[serde(default = "default_1874")] pub candidates: Integer, - #[serde(default = "default_1855")] + #[serde(default = "default_1875")] pub reactivated: Integer, - #[serde(default = "default_1856")] + #[serde(default = "default_1876")] pub dry_run: bool, - #[serde(default = "default_1857")] + #[serde(default = "default_1877")] pub memory_ids: Vec, } @@ -40570,15 +41411,15 @@ impl MemoryResolveOrphanDuplicatesInput { #[non_exhaustive] pub struct MemoryRestoreOutput { pub restored: bool, - #[serde(default = "default_1858")] + #[serde(default = "default_1878")] pub memory_id: Option, - #[serde(default = "default_1859")] + #[serde(default = "default_1879")] pub version: Option, - #[serde(default = "default_1860")] + #[serde(default = "default_1880")] pub expired: bool, - #[serde(default = "default_1861")] + #[serde(default = "default_1881")] pub redacted: bool, - #[serde(default = "default_1862")] + #[serde(default = "default_1882")] pub from_status: String, } @@ -40698,13 +41539,13 @@ pub struct SearchTraceHit { pub content_excerpt: String, pub distance: f64, pub similarity: f64, - #[serde(default = "default_1863")] + #[serde(default = "default_1883")] pub entity_boost: f64, pub rank_score: f64, pub rank: Integer, - #[serde(default = "default_1864")] + #[serde(default = "default_1884")] pub source: String, - #[serde(default = "default_1865")] + #[serde(default = "default_1885")] pub parent_memory_key: String, } @@ -40714,11 +41555,11 @@ pub struct MemorySearchTraceOutput { pub results: Vec, pub embedding_model: String, pub entity_filter: Vec, - #[serde(default = "default_1866")] + #[serde(default = "default_1886")] pub query_spellings: std::collections::HashMap, - #[serde(default = "default_1867")] + #[serde(default = "default_1887")] pub query_spellings_skipped: bool, - #[serde(default = "default_1868")] + #[serde(default = "default_1888")] pub stale_dropped: Integer, } @@ -41899,7 +42740,7 @@ pub struct SearchTraceLogRow { pub embedding_model: String, pub latency_ms: Integer, pub run_id: String, - #[serde(default = "default_1869")] + #[serde(default = "default_1889")] pub operation: String, } @@ -42008,71 +42849,71 @@ pub struct RefusedFact { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemorySetFromMessagesOutput { - #[serde(default = "default_1870")] + #[serde(default = "default_1890")] pub written: Vec, - #[serde(default = "default_1871")] + #[serde(default = "default_1891")] pub refused: Vec, - #[serde(default = "default_1872")] + #[serde(default = "default_1892")] pub tokens_in: Integer, - #[serde(default = "default_1873")] + #[serde(default = "default_1893")] pub tokens_out: Integer, - #[serde(default = "default_1874")] + #[serde(default = "default_1894")] pub llm_provider: String, - #[serde(default = "default_1875")] + #[serde(default = "default_1895")] pub llm_model: String, - #[serde(default = "default_1876")] + #[serde(default = "default_1896")] pub segments: Integer, - #[serde(default = "default_1877")] + #[serde(default = "default_1897")] pub foresight: Integer, - #[serde(default = "default_1878")] + #[serde(default = "default_1898")] pub forgotten: Integer, - #[serde(default = "default_1879")] + #[serde(default = "default_1899")] pub forgotten_keys: Vec, - #[serde(default = "default_1880")] + #[serde(default = "default_1900")] pub forget_requests: Integer, - #[serde(default = "default_1881")] + #[serde(default = "default_1901")] pub about_other: Integer, - #[serde(default = "default_1882")] + #[serde(default = "default_1902")] pub premise_facts: Integer, - #[serde(default = "default_1883")] + #[serde(default = "default_1903")] pub learning_candidates: Integer, - #[serde(default = "default_1884")] + #[serde(default = "default_1904")] pub ignored_args: Vec, - #[serde(default = "default_1885")] + #[serde(default = "default_1905")] pub segmenter: String, - #[serde(default = "default_1886")] + #[serde(default = "default_1906")] pub cached_tokens_in: Integer, - #[serde(default = "default_1887")] + #[serde(default = "default_1907")] pub ontology_warnings: Vec, - #[serde(default = "default_1888")] + #[serde(default = "default_1908")] pub evidence_ids: Vec, - #[serde(default = "default_1889")] + #[serde(default = "default_1909")] pub belief_source_links: Integer, - #[serde(default = "default_1890")] + #[serde(default = "default_1910")] pub pipeline_errors: Vec, - #[serde(default = "default_1891")] + #[serde(default = "default_1911")] pub value_updates_linked: Integer, - #[serde(default = "default_1892")] + #[serde(default = "default_1912")] pub stubbed_fields: Vec, - #[serde(default = "default_1893")] + #[serde(default = "default_1913")] pub degraded: Vec, - #[serde(default = "default_1894")] + #[serde(default = "default_1914")] pub deferred: bool, - #[serde(default = "default_1895")] + #[serde(default = "default_1915")] pub queue_id: String, - #[serde(default = "default_1896")] + #[serde(default = "default_1916")] pub deferred_by: String, - #[serde(default = "default_1897")] + #[serde(default = "default_1917")] pub stage_ms: std::collections::HashMap, - #[serde(default = "default_1898")] + #[serde(default = "default_1918")] pub observation_date_source: String, - #[serde(default = "default_1899")] + #[serde(default = "default_1919")] pub under_operator_policy: bool, - #[serde(default = "default_1900")] + #[serde(default = "default_1920")] pub extract_prompt_keys: Vec, - #[serde(default = "default_1901")] + #[serde(default = "default_1921")] pub llm_cache_hits: Integer, - #[serde(default = "default_1902")] + #[serde(default = "default_1922")] pub llm_cache_misses: Integer, } @@ -42527,22 +43368,22 @@ pub enum StackEntrySection { #[non_exhaustive] pub struct StackEntry { pub section: StackEntrySection, - #[serde(default = "default_1903")] + #[serde(default = "default_1923")] pub memory_key: String, - #[serde(default = "default_1904")] + #[serde(default = "default_1924")] pub memory_type: String, - #[serde(default = "default_1905")] + #[serde(default = "default_1925")] pub value: String, pub tokens: Integer, - #[serde(default = "default_1906")] + #[serde(default = "default_1926")] pub pinned: bool, - #[serde(default = "default_1907")] + #[serde(default = "default_1927")] pub recall_count: Integer, - #[serde(default = "default_1908")] + #[serde(default = "default_1928")] pub last_recalled_at: Option, - #[serde(default = "default_1909")] + #[serde(default = "default_1929")] pub actor: String, - #[serde(default = "default_1910")] + #[serde(default = "default_1930")] pub namespace: String, } @@ -42727,14 +43568,14 @@ impl MemoryStackInput { pub struct MemoryStatus { pub memory_id: String, pub status: String, - #[serde(default = "default_1911")] + #[serde(default = "default_1931")] pub superseded_by: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryStatusesOutput { - #[serde(default = "default_1912")] + #[serde(default = "default_1932")] pub rows: Vec, } @@ -42783,23 +43624,23 @@ impl MemoryStatusesInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemorySweepExpiredOutput { - #[serde(default = "default_1913")] + #[serde(default = "default_1933")] pub scanned: Integer, - #[serde(default = "default_1914")] + #[serde(default = "default_1934")] pub tombstoned: Integer, - #[serde(default = "default_1915")] + #[serde(default = "default_1935")] pub demoted: Integer, - #[serde(default = "default_1916")] + #[serde(default = "default_1936")] pub anonymized: Integer, - #[serde(default = "default_1917")] + #[serde(default = "default_1937")] pub locked_skipped: Integer, - #[serde(default = "default_1918")] + #[serde(default = "default_1938")] pub moved_skipped: Integer, - #[serde(default = "default_1919")] + #[serde(default = "default_1939")] pub dry_run: bool, - #[serde(default = "default_1920")] + #[serde(default = "default_1940")] pub sample: Vec>, - #[serde(default = "default_1921")] + #[serde(default = "default_1941")] pub failures: Vec, } @@ -42876,10 +43717,10 @@ pub struct MemoryTimelineEntry { pub memory_key: String, pub memory_type: String, pub content_excerpt: String, - #[serde(default = "default_1922")] + #[serde(default = "default_1942")] pub valid_at: Option, pub created_at: String, - #[serde(default = "default_1923")] + #[serde(default = "default_1943")] pub namespace: String, } @@ -42887,7 +43728,7 @@ pub struct MemoryTimelineEntry { #[non_exhaustive] pub struct MemoryTimelineOutput { pub events: Vec, - #[serde(default = "default_1924")] + #[serde(default = "default_1944")] pub total_matching: Integer, } @@ -43079,9 +43920,9 @@ impl MemoryTimelineInput { pub struct MemoryTouchResult { pub memory_key: String, pub touched: bool, - #[serde(default = "default_1927")] + #[serde(default = "default_1947")] pub version: Option, - #[serde(default = "default_1928")] + #[serde(default = "default_1948")] pub expires_at: Option, } @@ -43089,13 +43930,13 @@ pub struct MemoryTouchResult { #[non_exhaustive] pub struct MemoryTouchOutput { pub touched: bool, - #[serde(default = "default_1925")] + #[serde(default = "default_1945")] pub version: Option, - #[serde(default = "default_1926")] + #[serde(default = "default_1946")] pub expires_at: Option, - #[serde(default = "default_1929")] + #[serde(default = "default_1949")] pub results: Vec, - #[serde(default = "default_1930")] + #[serde(default = "default_1950")] pub touched_count: Integer, } @@ -43275,15 +44116,15 @@ impl MemoryTouchInput { #[non_exhaustive] pub struct MemoryUnlockOutput { pub unlocked: bool, - #[serde(default = "default_1931")] + #[serde(default = "default_1951")] pub reason: String, - #[serde(default = "default_1932")] + #[serde(default = "default_1952")] pub memory_id: String, - #[serde(default = "default_1933")] + #[serde(default = "default_1953")] pub version: Option, - #[serde(default = "default_1934")] + #[serde(default = "default_1954")] pub previous_mode: String, - #[serde(default = "default_1935")] + #[serde(default = "default_1955")] pub unlocked_by: String, } @@ -43388,11 +44229,11 @@ impl MemoryUnlockInput { #[non_exhaustive] pub struct MemoryUnpinOutput { pub unpinned: bool, - #[serde(default = "default_1936")] + #[serde(default = "default_1956")] pub reason: String, - #[serde(default = "default_1937")] + #[serde(default = "default_1957")] pub memory_id: String, - #[serde(default = "default_1938")] + #[serde(default = "default_1958")] pub version: Option, } @@ -43486,15 +44327,15 @@ impl MemoryUnpinInput { #[non_exhaustive] pub struct MemoryUpdateCandidate { pub memory_id: String, - #[serde(default = "default_1944")] + #[serde(default = "default_1964")] pub agent: String, - #[serde(default = "default_1945")] + #[serde(default = "default_1965")] pub user_id: String, - #[serde(default = "default_1946")] + #[serde(default = "default_1966")] pub session_id: String, - #[serde(default = "default_1947")] + #[serde(default = "default_1967")] pub version: Integer, - #[serde(default = "default_1948")] + #[serde(default = "default_1968")] pub status: String, } @@ -43502,23 +44343,23 @@ pub struct MemoryUpdateCandidate { #[non_exhaustive] pub struct MemoryUpdateOutput { pub updated: bool, - #[serde(default = "default_1939")] + #[serde(default = "default_1959")] pub memory_id: String, - #[serde(default = "default_1940")] + #[serde(default = "default_1960")] pub memory_key: String, - #[serde(default = "default_1941")] + #[serde(default = "default_1961")] pub new_version: Integer, - #[serde(default = "default_1942")] + #[serde(default = "default_1962")] pub content_sha256: String, - #[serde(default = "default_1943")] + #[serde(default = "default_1963")] pub reason: String, - #[serde(default = "default_1949")] + #[serde(default = "default_1969")] pub candidates: Vec, - #[serde(default = "default_1950")] + #[serde(default = "default_1970")] pub conflict_verdict: String, - #[serde(default = "default_1951")] + #[serde(default = "default_1971")] pub conflict_peers: Integer, - #[serde(default = "default_1952")] + #[serde(default = "default_1972")] pub duplicate_of: String, } @@ -43727,15 +44568,15 @@ impl MemoryUpdateInput { #[non_exhaustive] pub struct MemoryUpdateByIdOutput { pub updated: bool, - #[serde(default = "default_1953")] + #[serde(default = "default_1973")] pub new_version: Integer, - #[serde(default = "default_1954")] + #[serde(default = "default_1974")] pub content_sha256: String, - #[serde(default = "default_1955")] + #[serde(default = "default_1975")] pub conflict_verdict: String, - #[serde(default = "default_1956")] + #[serde(default = "default_1976")] pub conflict_peers: Integer, - #[serde(default = "default_1957")] + #[serde(default = "default_1977")] pub duplicate_of: String, } @@ -43863,23 +44704,23 @@ impl MemoryUpdateByIdInput { #[non_exhaustive] pub struct MemoryVerifyOutput { pub found: bool, - #[serde(default = "default_1958")] + #[serde(default = "default_1978")] pub changed: bool, - #[serde(default = "default_1959")] + #[serde(default = "default_1979")] pub memory_id: String, - #[serde(default = "default_1960")] + #[serde(default = "default_1980")] pub memory_key: String, - #[serde(default = "default_1961")] + #[serde(default = "default_1981")] pub namespace: String, - #[serde(default = "default_1962")] + #[serde(default = "default_1982")] pub verified_by: String, - #[serde(default = "default_1963")] + #[serde(default = "default_1983")] pub verified_at: Option, - #[serde(default = "default_1964")] + #[serde(default = "default_1984")] pub verification: String, - #[serde(default = "default_1965")] + #[serde(default = "default_1985")] pub version: Integer, - #[serde(default = "default_1966")] + #[serde(default = "default_1986")] pub content_sha256: String, } @@ -44084,13 +44925,13 @@ pub struct SchemaFieldOutput { #[serde(rename = "type")] pub r#type: String, pub required: bool, - #[serde(default = "default_1969")] + #[serde(default = "default_1989")] pub identity: bool, - #[serde(default = "default_1970")] + #[serde(default = "default_1990")] pub enum_values: Vec, - #[serde(default = "default_1971")] + #[serde(default = "default_1991")] pub constraints: std::collections::HashMap, - #[serde(default = "default_1972")] + #[serde(default = "default_1992")] pub description: String, } @@ -44099,11 +44940,11 @@ pub struct SchemaFieldOutput { pub struct MemorySchemaSummary { pub schema_id: String, pub name: String, - #[serde(default = "default_1967")] + #[serde(default = "default_1987")] pub description: String, - #[serde(default = "default_1968")] + #[serde(default = "default_1988")] pub status: String, - #[serde(default = "default_1973")] + #[serde(default = "default_1993")] pub fields: Vec, } @@ -44518,13 +45359,13 @@ impl MemorySchemaRegisterInput { #[non_exhaustive] pub struct MentorPlane { pub plane: String, - #[serde(default = "default_1975")] + #[serde(default = "default_1995")] pub calls: Integer, - #[serde(default = "default_1976")] + #[serde(default = "default_1996")] pub available: Option, - #[serde(default = "default_1977")] + #[serde(default = "default_1997")] pub when: String, - #[serde(default = "default_1978")] + #[serde(default = "default_1998")] pub mentored: bool, } @@ -44534,11 +45375,11 @@ pub struct MentorHint { pub code: String, pub severity: String, pub text: String, - #[serde(default = "default_1980")] + #[serde(default = "default_2000")] pub ops: Vec, - #[serde(default = "default_1981")] + #[serde(default = "default_2001")] pub evidence: std::collections::HashMap, - #[serde(default = "default_1982")] + #[serde(default = "default_2002")] pub plane: Option, } @@ -44546,9 +45387,9 @@ pub struct MentorHint { #[non_exhaustive] pub struct MentorAdoption { pub code: String, - #[serde(default = "default_1984")] + #[serde(default = "default_2004")] pub shown_sessions: Integer, - #[serde(default = "default_1985")] + #[serde(default = "default_2005")] pub followed_sessions: Integer, } @@ -44584,7 +45425,7 @@ pub enum UsageRungSource { #[non_exhaustive] pub struct UsageRung { pub rung: UsageRungRung, - #[serde(default = "default_1987")] + #[serde(default = "default_2007")] pub count: Option, pub source: UsageRungSource, pub meaning: String, @@ -44599,27 +45440,27 @@ pub struct MentorBriefOutput { pub window_seconds: Integer, pub computed_at: String, pub sessions: Integer, - #[serde(default = "default_1974")] + #[serde(default = "default_1994")] pub usage: std::collections::HashMap, - #[serde(default = "default_1979")] + #[serde(default = "default_1999")] pub planes: Vec, - #[serde(default = "default_1983")] + #[serde(default = "default_2003")] pub hints: Vec, - #[serde(default = "default_1986")] + #[serde(default = "default_2006")] pub adoption: Vec, - #[serde(default = "default_1988")] + #[serde(default = "default_2008")] pub usage_evidence: Vec, - #[serde(default = "default_1989")] + #[serde(default = "default_2009")] pub ledger_from: Option, - #[serde(default = "default_1990")] + #[serde(default = "default_2010")] pub ledger_retention_days: Option, - #[serde(default = "default_1991")] + #[serde(default = "default_2011")] pub agents: Vec, - #[serde(default = "default_1992")] + #[serde(default = "default_2012")] pub agent_defaulted: bool, - #[serde(default = "default_1993")] + #[serde(default = "default_2013")] pub skipped: Vec, - #[serde(default = "default_1994")] + #[serde(default = "default_2014")] pub healthy: bool, } @@ -44768,33 +45609,33 @@ impl MentorGuideInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct NamespaceAuditSummary { - #[serde(default = "default_1995")] + #[serde(default = "default_2015")] pub live_rows: Integer, - #[serde(default = "default_1996")] + #[serde(default = "default_2016")] pub live_bytes: Integer, - #[serde(default = "default_1997")] + #[serde(default = "default_2017")] pub excerpt_bytes: Integer, - #[serde(default = "default_1998")] + #[serde(default = "default_2018")] pub version_rows: Integer, - #[serde(default = "default_1999")] + #[serde(default = "default_2019")] pub version_bytes: Integer, - #[serde(default = "default_2000")] + #[serde(default = "default_2020")] pub unembedded_rows: Integer, - #[serde(default = "default_2001")] + #[serde(default = "default_2021")] pub gets: Integer, - #[serde(default = "default_2002")] + #[serde(default = "default_2022")] pub searches: Integer, - #[serde(default = "default_2003")] + #[serde(default = "default_2023")] pub sets: Integer, - #[serde(default = "default_2004")] + #[serde(default = "default_2024")] pub get_search_ratio: f64, - #[serde(default = "default_2005")] + #[serde(default = "default_2025")] pub inspector_calls: Integer, - #[serde(default = "default_2006")] + #[serde(default = "default_2026")] pub typed_gets: Integer, - #[serde(default = "default_2007")] + #[serde(default = "default_2027")] pub written_in_window: Integer, - #[serde(default = "default_2008")] + #[serde(default = "default_2028")] pub ledger_calls: Integer, } @@ -44826,25 +45667,25 @@ pub struct NamespaceAuditFinding { pub kind: NamespaceAuditFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_2009")] + #[serde(default = "default_2029")] pub window_seconds: Option, - #[serde(default = "default_2010")] + #[serde(default = "default_2030")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_2011")] + #[serde(default = "default_2031")] pub evidence: Vec, - #[serde(default = "default_2012")] + #[serde(default = "default_2032")] pub exceptions: String, - #[serde(default = "default_2013")] + #[serde(default = "default_2033")] pub uncertainty: String, pub code: String, pub severity: NamespaceAuditFindingSeverity, pub count: Integer, pub share: f64, - #[serde(default = "default_2014")] + #[serde(default = "default_2034")] pub bytes: Integer, - #[serde(default = "default_2015")] + #[serde(default = "default_2035")] pub samples: Vec>, pub detail: String, pub remedy: String, @@ -44859,7 +45700,7 @@ pub struct NamespaceAuditOutput { pub window_seconds: Integer, pub summary: NamespaceAuditSummary, pub findings: Vec, - #[serde(default = "default_2016")] + #[serde(default = "default_2036")] pub skipped: Vec, pub coverage: ReportCoverage, pub healthy: bool, @@ -44950,29 +45791,29 @@ pub enum BrowseEntryMyStatus { #[non_exhaustive] pub struct BrowseEntry { pub namespace: String, - #[serde(default = "default_2017")] + #[serde(default = "default_2037")] pub kind: String, pub description: String, pub owner_email: String, pub member_count: Integer, - #[serde(default = "default_2018")] + #[serde(default = "default_2038")] pub requires_approval: bool, pub created_at: String, - #[serde(default = "default_2019")] + #[serde(default = "default_2039")] pub join_policy: String, - #[serde(default = "default_2020")] + #[serde(default = "default_2040")] pub visibility: String, - #[serde(default = "default_2021")] + #[serde(default = "default_2041")] pub my_status: BrowseEntryMyStatus, - #[serde(default = "default_2022")] + #[serde(default = "default_2042")] pub my_role: String, - #[serde(default = "default_2023")] + #[serde(default = "default_2043")] pub repo: String, - #[serde(default = "default_2024")] + #[serde(default = "default_2044")] pub branch: String, - #[serde(default = "default_2025")] + #[serde(default = "default_2045")] pub guide_revision: Integer, - #[serde(default = "default_2026")] + #[serde(default = "default_2046")] pub guide_summary: String, } @@ -45076,9 +45917,9 @@ pub enum NamespaceCancelRequestOutputClearedRole { pub struct NamespaceCancelRequestOutput { pub cancelled: bool, pub namespace: String, - #[serde(default = "default_2027")] + #[serde(default = "default_2047")] pub cleared_role: Option, - #[serde(default = "default_2028")] + #[serde(default = "default_2048")] pub cancelled_at: Option, } @@ -45150,7 +45991,7 @@ pub struct NamespaceDeleteOutput { pub deleted: bool, pub namespace: String, pub updated_at: String, - #[serde(default = "default_2029")] + #[serde(default = "default_2049")] pub sources_retired: Vec, } @@ -45219,67 +46060,67 @@ pub enum NamespaceGetOutputClassification { pub struct NamespaceGetOutput { pub found: bool, pub namespace: String, - #[serde(default = "default_2030")] + #[serde(default = "default_2050")] pub kind: Option, - #[serde(default = "default_2031")] + #[serde(default = "default_2051")] pub owner_email: Option, - #[serde(default = "default_2032")] + #[serde(default = "default_2052")] pub description: Option, - #[serde(default = "default_2033")] + #[serde(default = "default_2053")] pub tags: Option>, - #[serde(default = "default_2034")] + #[serde(default = "default_2054")] pub active: Option, - #[serde(default = "default_2035")] + #[serde(default = "default_2055")] pub conversation_logging_enabled: Option, - #[serde(default = "default_2036")] + #[serde(default = "default_2056")] pub capture_generation_io: Option, - #[serde(default = "default_2037")] + #[serde(default = "default_2057")] pub coverage_sweep: Option, - #[serde(default = "default_2038")] + #[serde(default = "default_2058")] pub consolidation_enabled: Option, - #[serde(default = "default_2039")] + #[serde(default = "default_2059")] pub daily_cost_cap_usd: Option, - #[serde(default = "default_2040")] + #[serde(default = "default_2060")] pub daily_user_cost_cap_usd: Option, - #[serde(default = "default_2041")] + #[serde(default = "default_2061")] pub budget_alert_inbox: Option, - #[serde(default = "default_2042")] + #[serde(default = "default_2062")] pub conflict_threshold: Option, - #[serde(default = "default_2043")] + #[serde(default = "default_2063")] pub retention_days: Option, - #[serde(default = "default_2044")] + #[serde(default = "default_2064")] pub warm_days: Option, - #[serde(default = "default_2045")] + #[serde(default = "default_2065")] pub visibility: Option, - #[serde(default = "default_2046")] + #[serde(default = "default_2066")] pub requires_approval: Option, - #[serde(default = "default_2047")] + #[serde(default = "default_2067")] pub join_policy: Option, - #[serde(default = "default_2048")] + #[serde(default = "default_2068")] pub effective_join_policy: Option, - #[serde(default = "default_2049")] + #[serde(default = "default_2069")] pub retrieval_defaults: Option>, - #[serde(default = "default_2050")] + #[serde(default = "default_2070")] pub rerank_endpoint: Option, - #[serde(default = "default_2051")] + #[serde(default = "default_2071")] pub classify_endpoint: Option, - #[serde(default = "default_2052")] + #[serde(default = "default_2072")] pub default_conflict_policy: Option, - #[serde(default = "default_2053")] + #[serde(default = "default_2073")] pub proposal_policy: Option, - #[serde(default = "default_2054")] + #[serde(default = "default_2074")] pub code_change_policy: Option, - #[serde(default = "default_2055")] + #[serde(default = "default_2075")] pub tag_registry: Option>>, - #[serde(default = "default_2056")] + #[serde(default = "default_2076")] pub classification: Option, - #[serde(default = "default_2057")] + #[serde(default = "default_2077")] pub guide_revision: Option, - #[serde(default = "default_2058")] + #[serde(default = "default_2078")] pub guide_summary: Option, - #[serde(default = "default_2059")] + #[serde(default = "default_2079")] pub created_at: Option, - #[serde(default = "default_2060")] + #[serde(default = "default_2080")] pub updated_at: Option, } @@ -45332,17 +46173,17 @@ impl NamespaceGetInput { #[non_exhaustive] pub struct NamespaceGuideGetOutput { pub found: bool, - #[serde(default = "default_2061")] + #[serde(default = "default_2081")] pub revision: Integer, - #[serde(default = "default_2062")] + #[serde(default = "default_2082")] pub content: String, - #[serde(default = "default_2063")] + #[serde(default = "default_2083")] pub summary: String, - #[serde(default = "default_2064")] + #[serde(default = "default_2084")] pub note: String, - #[serde(default = "default_2065")] + #[serde(default = "default_2085")] pub updated_by: String, - #[serde(default = "default_2066")] + #[serde(default = "default_2086")] pub updated_at: Option, } @@ -45479,17 +46320,17 @@ impl NamespaceGuideHistoryInput { #[non_exhaustive] pub struct NamespaceGuideSetOutputNamespaceGuideGetOutput { pub found: bool, - #[serde(default = "default_2068")] + #[serde(default = "default_2088")] pub revision: Integer, - #[serde(default = "default_2069")] + #[serde(default = "default_2089")] pub content: String, - #[serde(default = "default_2070")] + #[serde(default = "default_2090")] pub summary: String, - #[serde(default = "default_2071")] + #[serde(default = "default_2091")] pub note: String, - #[serde(default = "default_2072")] + #[serde(default = "default_2092")] pub updated_by: String, - #[serde(default = "default_2073")] + #[serde(default = "default_2093")] pub updated_at: Option, } @@ -45497,10 +46338,10 @@ pub struct NamespaceGuideSetOutputNamespaceGuideGetOutput { #[non_exhaustive] pub struct NamespaceGuideSetOutput { pub written: bool, - #[serde(default = "default_2067")] + #[serde(default = "default_2087")] pub conflict: bool, pub revision: Integer, - #[serde(default = "default_2074")] + #[serde(default = "default_2094")] pub current: Option, } @@ -45621,7 +46462,7 @@ pub struct InventorySection { #[serde(deserialize_with = "required_nullable")] pub latest_at: Option, pub complete: bool, - #[serde(default = "default_2075")] + #[serde(default = "default_2095")] pub reason: String, } @@ -45651,10 +46492,10 @@ pub struct InventoryPopulation { pub population: InventoryPopulationPopulation, #[serde(deserialize_with = "required_nullable")] pub total: Option, - #[serde(default = "default_2076")] + #[serde(default = "default_2096")] pub top: Vec, pub complete: bool, - #[serde(default = "default_2077")] + #[serde(default = "default_2097")] pub reason: String, } @@ -45820,11 +46661,11 @@ pub struct NamespaceJoinOutput { pub joined: bool, pub namespace: String, pub role: NamespaceJoinOutputRole, - #[serde(default = "default_2078")] + #[serde(default = "default_2098")] pub status: String, - #[serde(default = "default_2079")] + #[serde(default = "default_2099")] pub requested_role: Option, - #[serde(default = "default_2080")] + #[serde(default = "default_2100")] pub pending_admins: Vec, pub joined_at: String, } @@ -45916,7 +46757,7 @@ impl NamespaceJoinInput { pub struct NamespaceLeaveOutput { pub left: bool, pub namespace: String, - #[serde(default = "default_2081")] + #[serde(default = "default_2101")] pub left_at: Option, } @@ -45993,27 +46834,27 @@ pub enum NamespaceEntryVisibility { #[non_exhaustive] pub struct NamespaceEntry { pub namespace: String, - #[serde(default = "default_2082")] + #[serde(default = "default_2102")] pub kind: String, pub owner_email: String, pub description: String, pub tags: Vec, pub active: bool, - #[serde(default = "default_2083")] + #[serde(default = "default_2103")] pub consolidation_enabled: bool, - #[serde(default = "default_2084")] + #[serde(default = "default_2104")] pub daily_cost_cap_usd: f64, - #[serde(default = "default_2085")] + #[serde(default = "default_2105")] pub daily_user_cost_cap_usd: f64, - #[serde(default = "default_2086")] + #[serde(default = "default_2106")] pub budget_alert_inbox: String, - #[serde(default = "default_2087")] + #[serde(default = "default_2107")] pub conflict_threshold: Option, - #[serde(default = "default_2088")] + #[serde(default = "default_2108")] pub retention_days: Integer, - #[serde(default = "default_2089")] + #[serde(default = "default_2109")] pub warm_days: Integer, - #[serde(default = "default_2090")] + #[serde(default = "default_2110")] pub visibility: NamespaceEntryVisibility, pub created_at: String, pub updated_at: String, @@ -46168,27 +47009,27 @@ pub enum MineEntryVisibility { pub struct MineEntry { pub namespace: String, pub role: String, - #[serde(default = "default_2091")] + #[serde(default = "default_2111")] pub status: String, - #[serde(default = "default_2092")] + #[serde(default = "default_2112")] pub pending_role: Option, - #[serde(default = "default_2093")] + #[serde(default = "default_2113")] pub pending_since: Option, - #[serde(default = "default_2094")] + #[serde(default = "default_2114")] pub pending_admins: Vec, - #[serde(default = "default_2095")] + #[serde(default = "default_2115")] pub visibility: MineEntryVisibility, - #[serde(default = "default_2096")] + #[serde(default = "default_2116")] pub kind: String, - #[serde(default = "default_2097")] + #[serde(default = "default_2117")] pub title: String, - #[serde(default = "default_2098")] + #[serde(default = "default_2118")] pub description: String, - #[serde(default = "default_2099")] + #[serde(default = "default_2119")] pub joined_at: Option, - #[serde(default = "default_2100")] + #[serde(default = "default_2120")] pub is_new: bool, - #[serde(default = "default_2101")] + #[serde(default = "default_2121")] pub inherited: bool, } @@ -46254,7 +47095,7 @@ pub struct OntologyEntry { pub name: String, pub status: String, pub description: String, - #[serde(default = "default_2102")] + #[serde(default = "default_2122")] pub cardinality: String, pub created_by: String, pub updated_at: String, @@ -46447,7 +47288,7 @@ pub struct NamespaceRegisterOutput { pub registered: bool, pub namespace: String, pub updated_at: String, - #[serde(default = "default_2103")] + #[serde(default = "default_2123")] pub visibility: NamespaceRegisterOutputVisibility, } @@ -47527,7 +48368,7 @@ impl NamespaceRegisterOntologyInput { #[non_exhaustive] pub struct NamespaceRestoreOutput { pub restored: bool, - #[serde(default = "default_2104")] + #[serde(default = "default_2124")] pub publication_pending: bool, pub target_namespace: String, pub snapshot_id: String, @@ -48414,15 +49255,15 @@ pub struct NamespaceRollbackOutput { pub version_at: Integer, pub reinstate: Integer, pub remove: Integer, - #[serde(default = "default_2105")] + #[serde(default = "default_2125")] pub skipped_no_head: Integer, - #[serde(default = "default_2106")] + #[serde(default = "default_2126")] pub skipped_already_gone: Integer, - #[serde(default = "default_2107")] + #[serde(default = "default_2127")] pub truncated: bool, - #[serde(default = "default_2108")] + #[serde(default = "default_2128")] pub sample: Vec>, - #[serde(default = "default_2109")] + #[serde(default = "default_2129")] pub applied_at: Option, } @@ -48601,101 +49442,101 @@ pub struct NamespaceSnapshotOutputSnapshotMemoryRow { pub confidence: f64, pub source_trace: String, pub pinned: bool, - #[serde(default = "default_2110")] + #[serde(default = "default_2130")] pub expires_at: Option, - #[serde(default = "default_2111")] + #[serde(default = "default_2131")] pub entities: Vec, - #[serde(default = "default_2112")] + #[serde(default = "default_2132")] pub version: Integer, - #[serde(default = "default_2113")] + #[serde(default = "default_2133")] pub content_sha256: String, - #[serde(default = "default_2114")] + #[serde(default = "default_2134")] pub actor: String, - #[serde(default = "default_2115")] + #[serde(default = "default_2135")] pub source_class: String, - #[serde(default = "default_2116")] + #[serde(default = "default_2136")] pub source_resource_id: String, - #[serde(default = "default_2117")] + #[serde(default = "default_2137")] pub verified_by: String, - #[serde(default = "default_2118")] + #[serde(default = "default_2138")] pub verified_at: Option, - #[serde(default = "default_2119")] + #[serde(default = "default_2139")] pub verified_sha256: String, - #[serde(default = "default_2120")] + #[serde(default = "default_2140")] pub grounding: String, - #[serde(default = "default_2121")] + #[serde(default = "default_2141")] pub evidence: String, - #[serde(default = "default_2122")] + #[serde(default = "default_2142")] pub tags: Vec, - #[serde(default = "default_2123")] + #[serde(default = "default_2143")] pub valid_at: Option, - #[serde(default = "default_2124")] + #[serde(default = "default_2144")] pub valid_to: Option, - #[serde(default = "default_2125")] + #[serde(default = "default_2145")] pub created_at: Option, - #[serde(default = "default_2126")] + #[serde(default = "default_2146")] pub updated_at: Option, - #[serde(default = "default_2127")] + #[serde(default = "default_2147")] pub value_json: String, - #[serde(default = "default_2128")] + #[serde(default = "default_2148")] pub status: NamespaceSnapshotOutputSnapshotMemoryRowStatus, - #[serde(default = "default_2129")] + #[serde(default = "default_2149")] pub requires_review: Option, - #[serde(default = "default_2130")] + #[serde(default = "default_2150")] pub conflict_with: Vec, - #[serde(default = "default_2131")] + #[serde(default = "default_2151")] pub duplicate_of: String, - #[serde(default = "default_2132")] + #[serde(default = "default_2152")] pub evidence_count: Integer, - #[serde(default = "default_2133")] + #[serde(default = "default_2153")] pub recall_count: Integer, - #[serde(default = "default_2134")] + #[serde(default = "default_2154")] pub last_recalled_at: Option, - #[serde(default = "default_2135")] + #[serde(default = "default_2155")] pub cross_promoted_from_memory_id: String, - #[serde(default = "default_2136")] + #[serde(default = "default_2156")] pub cross_promoted_from_namespace: String, - #[serde(default = "default_2137")] + #[serde(default = "default_2157")] pub superseded_by: String, - #[serde(default = "default_2138")] + #[serde(default = "default_2158")] pub rejection_reason: String, - #[serde(default = "default_2139")] + #[serde(default = "default_2159")] pub temporal_anchor: Option, - #[serde(default = "default_2140")] + #[serde(default = "default_2160")] pub temporal_confidence: f64, - #[serde(default = "default_2141")] + #[serde(default = "default_2161")] pub invalid_at: Option, - #[serde(default = "default_2142")] + #[serde(default = "default_2162")] pub char_limit: Option, - #[serde(default = "default_2143")] + #[serde(default = "default_2163")] pub reinforcement_count: Integer, - #[serde(default = "default_2144")] + #[serde(default = "default_2164")] pub last_reinforced_at: Option, - #[serde(default = "default_2145")] + #[serde(default = "default_2165")] pub mentioned_at: Option, - #[serde(default = "default_2146")] + #[serde(default = "default_2166")] pub sensitivity: String, - #[serde(default = "default_2147")] + #[serde(default = "default_2167")] pub redacted_at: Option, - #[serde(default = "default_2148")] + #[serde(default = "default_2168")] pub redaction_reason: String, - #[serde(default = "default_2149")] + #[serde(default = "default_2169")] pub lock_mode: String, - #[serde(default = "default_2150")] + #[serde(default = "default_2170")] pub lock_reason: String, - #[serde(default = "default_2151")] + #[serde(default = "default_2171")] pub lock_until: Option, - #[serde(default = "default_2152")] + #[serde(default = "default_2172")] pub locked_by: String, - #[serde(default = "default_2153")] + #[serde(default = "default_2173")] pub locked_at: Option, - #[serde(default = "default_2154")] + #[serde(default = "default_2174")] pub on_expire: String, - #[serde(default = "default_2155")] + #[serde(default = "default_2175")] pub expire_reason: String, - #[serde(default = "default_2156")] + #[serde(default = "default_2176")] pub files: Vec, - #[serde(default = "default_2157")] + #[serde(default = "default_2177")] pub concepts: Vec, } @@ -48704,11 +49545,11 @@ pub struct NamespaceSnapshotOutputSnapshotMemoryRow { pub struct NamespaceSnapshotOutputSnapshotTypeRow { pub memory_type: String, pub retention_days: Integer, - #[serde(default = "default_2158")] + #[serde(default = "default_2178")] pub dedup_threshold: Option, - #[serde(default = "default_2159")] + #[serde(default = "default_2179")] pub hot_quota: Integer, - #[serde(default = "default_2160")] + #[serde(default = "default_2180")] pub conflict_policy: String, } @@ -48923,7 +49764,7 @@ pub struct TaxonomyCommunity { pub community_id: Integer, pub label: String, pub size: Integer, - #[serde(default = "default_2161")] + #[serde(default = "default_2181")] pub top_entities: Vec, } @@ -48934,9 +49775,9 @@ pub struct NamespaceTaxonomyOutput { pub entities: Vec, pub memory_count: Integer, pub memory_types: Vec, - #[serde(default = "default_2162")] + #[serde(default = "default_2182")] pub communities: Vec, - #[serde(default = "default_2163")] + #[serde(default = "default_2183")] pub communities_computed_at: String, } @@ -49036,15 +49877,15 @@ pub enum TuneProposalTarget { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TuneEvidence { - #[serde(default = "default_2165")] + #[serde(default = "default_2185")] pub finding_codes: Vec, - #[serde(default = "default_2166")] + #[serde(default = "default_2186")] pub supporting_count: Integer, - #[serde(default = "default_2167")] + #[serde(default = "default_2187")] pub supporting: Vec, - #[serde(default = "default_2168")] + #[serde(default = "default_2188")] pub counter_count: Option, - #[serde(default = "default_2169")] + #[serde(default = "default_2189")] pub documents: Vec, } @@ -49070,10 +49911,10 @@ pub enum TuneApplyVia { #[non_exhaustive] pub struct TuneApply { pub op: String, - #[serde(default = "default_2173")] + #[serde(default = "default_2193")] pub via: TuneApplyVia, pub args: std::collections::HashMap, - #[serde(default = "default_2174")] + #[serde(default = "default_2194")] pub args_complete: bool, pub required_role: String, pub guard: String, @@ -49092,7 +49933,7 @@ pub struct ChunkStats { pub sections: Integer, pub sections_cut: Integer, pub max_input_tokens: Integer, - #[serde(default = "default_2176")] + #[serde(default = "default_2196")] pub over_input_limit: Option, } @@ -49112,25 +49953,25 @@ pub struct TuneProposal { pub title: String, pub rationale: String, pub current: String, - #[serde(default = "default_2164")] + #[serde(default = "default_2184")] pub current_revision: Option, pub proposed: String, pub evidence: TuneEvidence, - #[serde(default = "default_2170")] + #[serde(default = "default_2190")] pub affected_agents: Vec, - #[serde(default = "default_2171")] + #[serde(default = "default_2191")] pub affected_agents_total: Option, - #[serde(default = "default_2172")] + #[serde(default = "default_2192")] pub effect: TuneProposalEffect, pub historical: String, pub apply: TuneApply, - #[serde(default = "default_2175")] + #[serde(default = "default_2195")] pub apply_also: Vec, - #[serde(default = "default_2177")] + #[serde(default = "default_2197")] pub preview: Option, - #[serde(default = "default_2178")] + #[serde(default = "default_2198")] pub limits: String, - #[serde(default = "default_2179")] + #[serde(default = "default_2199")] pub refs: Vec, } @@ -49138,13 +49979,13 @@ pub struct TuneProposal { #[non_exhaustive] pub struct ChunkingSample { pub cap: Integer, - #[serde(default = "default_2185")] + #[serde(default = "default_2205")] pub population: Option, pub documents: Integer, pub unread: Integer, pub load_cap: Integer, pub embedder_model: String, - #[serde(default = "default_2186")] + #[serde(default = "default_2206")] pub input_token_limit: Option, pub current: ChunkStats, } @@ -49155,21 +49996,21 @@ pub struct NamespaceTuneOutput { pub org: String, pub namespace: String, pub computed_at: String, - #[serde(default = "default_2180")] + #[serde(default = "default_2200")] pub proposals: Vec, - #[serde(default = "default_2181")] + #[serde(default = "default_2201")] pub guide_revision: Option, - #[serde(default = "default_2182")] + #[serde(default = "default_2202")] pub categories_registered: Option, - #[serde(default = "default_2183")] + #[serde(default = "default_2203")] pub extraction_policy: Option, - #[serde(default = "default_2184")] + #[serde(default = "default_2204")] pub extraction_policy_unavailable: String, - #[serde(default = "default_2187")] + #[serde(default = "default_2207")] pub chunking: Option, - #[serde(default = "default_2188")] + #[serde(default = "default_2208")] pub skipped: Vec, - #[serde(default = "default_2189")] + #[serde(default = "default_2209")] pub model_used: bool, } @@ -49290,25 +50131,25 @@ pub struct NamespaceValidateFinding { pub kind: NamespaceValidateFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_2190")] + #[serde(default = "default_2210")] pub window_seconds: Option, - #[serde(default = "default_2191")] + #[serde(default = "default_2211")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_2192")] + #[serde(default = "default_2212")] pub evidence: Vec, - #[serde(default = "default_2193")] + #[serde(default = "default_2213")] pub exceptions: String, - #[serde(default = "default_2194")] + #[serde(default = "default_2214")] pub uncertainty: String, pub check: String, pub severity: NamespaceValidateFindingSeverity, pub count: Integer, - #[serde(default = "default_2195")] + #[serde(default = "default_2215")] pub samples: Vec>, pub detail: String, - #[serde(default = "default_2196")] + #[serde(default = "default_2216")] pub totals: std::collections::HashMap, } @@ -49322,9 +50163,9 @@ pub struct NamespaceValidateOutput { pub warnings: Integer, pub infos: Integer, pub findings: Vec, - #[serde(default = "default_2197")] + #[serde(default = "default_2217")] pub skipped: Vec, - #[serde(default = "default_2198")] + #[serde(default = "default_2218")] pub keys_scoped: Integer, pub coverage: ReportCoverage, pub checked_at: String, @@ -49444,9 +50285,9 @@ impl NamespaceValidateInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ObserveCrystallizeOutput { - #[serde(default = "default_2199")] + #[serde(default = "default_2219")] pub enqueued: Integer, - #[serde(default = "default_2200")] + #[serde(default = "default_2220")] pub session_id: String, } @@ -49543,23 +50384,23 @@ impl ObserveCrystallizeInput { #[non_exhaustive] pub struct ObserveRecordOutput { pub memory_key: String, - #[serde(default = "default_2201")] + #[serde(default = "default_2221")] pub memory_id: String, - #[serde(default = "default_2202")] + #[serde(default = "default_2222")] pub kind: String, - #[serde(default = "default_2203")] + #[serde(default = "default_2223")] pub tags: Vec, - #[serde(default = "default_2204")] + #[serde(default = "default_2224")] pub file_paths: Vec, - #[serde(default = "default_2205")] + #[serde(default = "default_2225")] pub content_sha256: String, - #[serde(default = "default_2206")] + #[serde(default = "default_2226")] pub tool_name: String, - #[serde(default = "default_2207")] + #[serde(default = "default_2227")] pub has_error: bool, - #[serde(default = "default_2208")] + #[serde(default = "default_2228")] pub narrative_chars: Integer, - #[serde(default = "default_2209")] + #[serde(default = "default_2229")] pub skipped_reason: String, } @@ -49758,26 +50599,26 @@ pub struct ProjectionFailureRow { pub failure_id: String, pub org: String, pub namespace: String, - #[serde(default = "default_2210")] + #[serde(default = "default_2230")] pub agent: String, pub projection: String, - #[serde(default = "default_2211")] + #[serde(default = "default_2231")] pub source_operation: String, - #[serde(default = "default_2212")] + #[serde(default = "default_2232")] pub source_resource_id: String, - #[serde(default = "default_2213")] + #[serde(default = "default_2233")] pub memory_keys: Vec, - #[serde(default = "default_2214")] + #[serde(default = "default_2234")] pub error_type: String, - #[serde(default = "default_2215")] + #[serde(default = "default_2235")] pub error_message: String, - #[serde(default = "default_2216")] + #[serde(default = "default_2236")] pub payload: std::collections::HashMap, - #[serde(default = "default_2217")] + #[serde(default = "default_2237")] pub status: String, - #[serde(default = "default_2218")] + #[serde(default = "default_2238")] pub created_at: Option, - #[serde(default = "default_2219")] + #[serde(default = "default_2239")] pub resolved_at: Option, } @@ -49931,22 +50772,22 @@ pub struct ProjectionFailureRetryRow { pub projection: String, pub retried: bool, pub resolved: bool, - #[serde(default = "default_2220")] + #[serde(default = "default_2240")] pub abandoned: bool, - #[serde(default = "default_2221")] + #[serde(default = "default_2241")] pub reason: String, - #[serde(default = "default_2222")] + #[serde(default = "default_2242")] pub error: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProjectionFailureRetryOutput { - #[serde(default = "default_2223")] + #[serde(default = "default_2243")] pub results: Vec, pub retried: Integer, pub resolved: Integer, - #[serde(default = "default_2224")] + #[serde(default = "default_2244")] pub abandoned: Integer, } @@ -50028,15 +50869,15 @@ impl ProjectionFailureRetryInput { pub struct OrgModelCallsOutput { pub org: String, pub enabled: bool, - #[serde(default = "default_2225")] + #[serde(default = "default_2245")] pub reason: String, - #[serde(default = "default_2226")] + #[serde(default = "default_2246")] pub updated_by: String, - #[serde(default = "default_2227")] + #[serde(default = "default_2247")] pub updated_at: Option, - #[serde(default = "default_2228")] + #[serde(default = "default_2248")] pub locked: bool, - #[serde(default = "default_2229")] + #[serde(default = "default_2249")] pub locked_by: String, } @@ -50375,7 +51216,7 @@ impl PolicyDecisionsInput { #[non_exhaustive] pub struct PolicyDeleteOutput { pub removed: bool, - #[serde(default = "default_2230")] + #[serde(default = "default_2250")] pub widening: bool, } @@ -50441,12 +51282,12 @@ pub struct PolicyRuleOut { pub condition: std::collections::HashMap, pub description: String, pub enabled: bool, - #[serde(default = "default_2231")] + #[serde(default = "default_2251")] pub mode: String, pub created_by: String, - #[serde(default = "default_2232")] + #[serde(default = "default_2252")] pub created_at: Option, - #[serde(default = "default_2233")] + #[serde(default = "default_2253")] pub updated_at: Option, } @@ -50518,9 +51359,9 @@ impl PolicyListInput { pub struct PolicySetOutput { pub rule: PolicyRuleOut, pub leaf_count: Integer, - #[serde(default = "default_2234")] + #[serde(default = "default_2254")] pub widening: bool, - #[serde(default = "default_2235")] + #[serde(default = "default_2255")] pub change: Vec, } @@ -50790,37 +51631,37 @@ pub struct ProcedureEvolveOutput { pub revision: Integer, pub changed: bool, pub template: bool, - #[serde(default = "default_2236")] + #[serde(default = "default_2256")] pub folded_runs: Integer, - #[serde(default = "default_2237")] + #[serde(default = "default_2257")] pub gate: ProcedureEvolveOutputGate, - #[serde(default = "default_2238")] + #[serde(default = "default_2258")] pub gate_mode: String, - #[serde(default = "default_2239")] + #[serde(default = "default_2259")] pub gate_llr: f64, - #[serde(default = "default_2240")] + #[serde(default = "default_2260")] pub gate_before: std::collections::HashMap, - #[serde(default = "default_2241")] + #[serde(default = "default_2261")] pub gate_after: std::collections::HashMap, - #[serde(default = "default_2242")] + #[serde(default = "default_2262")] pub gate_cost_before: std::collections::HashMap, - #[serde(default = "default_2243")] + #[serde(default = "default_2263")] pub gate_cost_after: std::collections::HashMap, - #[serde(default = "default_2244")] + #[serde(default = "default_2264")] pub gate_reason: String, - #[serde(default = "default_2245")] + #[serde(default = "default_2265")] pub dead_end_steps: Vec, - #[serde(default = "default_2246")] + #[serde(default = "default_2266")] pub fail_prone_steps: Vec, - #[serde(default = "default_2247")] + #[serde(default = "default_2267")] pub fail_prone_transitions: Vec, - #[serde(default = "default_2248")] + #[serde(default = "default_2268")] pub run_stats: std::collections::HashMap, - #[serde(default = "default_2249")] + #[serde(default = "default_2269")] pub strikes: Integer, - #[serde(default = "default_2250")] + #[serde(default = "default_2270")] pub quarantined: bool, - #[serde(default = "default_2251")] + #[serde(default = "default_2271")] pub retention: std::collections::HashMap, } @@ -51043,9 +51884,9 @@ pub struct ProcedureForkOutput { pub memory_key: String, pub version: Integer, pub name: String, - #[serde(default = "default_2252")] + #[serde(default = "default_2272")] pub steps: Vec, - #[serde(default = "default_2253")] + #[serde(default = "default_2273")] pub forked_from: std::collections::HashMap, } @@ -51305,32 +52146,32 @@ pub enum ProcedureLocateOutputStatus { #[non_exhaustive] pub struct ProcedureLocateOutput { pub memory_key: String, - #[serde(default = "default_2254")] + #[serde(default = "default_2274")] pub name: String, - #[serde(default = "default_2255")] + #[serde(default = "default_2275")] pub status: ProcedureLocateOutputStatus, pub matched: bool, - #[serde(default = "default_2256")] + #[serde(default = "default_2276")] pub active: Option>, - #[serde(default = "default_2257")] + #[serde(default = "default_2277")] pub hops: Vec>>, - #[serde(default = "default_2258")] + #[serde(default = "default_2278")] pub entry_nodes: Vec, - #[serde(default = "default_2259")] + #[serde(default = "default_2279")] pub dominant_next: Vec, - #[serde(default = "default_2260")] + #[serde(default = "default_2280")] pub revisits: std::collections::HashMap, - #[serde(default = "default_2261")] + #[serde(default = "default_2281")] pub looping: bool, - #[serde(default = "default_2262")] + #[serde(default = "default_2282")] pub exits: Vec, - #[serde(default = "default_2263")] + #[serde(default = "default_2283")] pub failure_notes: Vec>, - #[serde(default = "default_2264")] + #[serde(default = "default_2284")] pub rendered: String, - #[serde(default = "default_2265")] + #[serde(default = "default_2285")] pub run_stats: std::collections::HashMap, - #[serde(default = "default_2266")] + #[serde(default = "default_2286")] pub for_agent: std::collections::HashMap, } @@ -51485,43 +52326,43 @@ pub struct ProcedureMatch { pub name: String, pub situation: String, pub steps: Vec, - #[serde(default = "default_2267")] + #[serde(default = "default_2287")] pub tags: Vec, - #[serde(default = "default_2268")] + #[serde(default = "default_2288")] pub metadata: std::collections::HashMap, pub similarity: f64, pub memory_key: String, pub namespace: String, - #[serde(default = "default_2269")] + #[serde(default = "default_2289")] pub graph: Option>, - #[serde(default = "default_2270")] + #[serde(default = "default_2290")] pub template: bool, - #[serde(default = "default_2271")] + #[serde(default = "default_2291")] pub run_stats: std::collections::HashMap, - #[serde(default = "default_2272")] + #[serde(default = "default_2292")] pub status: ProcedureMatchStatus, - #[serde(default = "default_2273")] + #[serde(default = "default_2293")] pub quarantined: Option>, - #[serde(default = "default_2274")] + #[serde(default = "default_2294")] pub fail_prone_steps: Vec, - #[serde(default = "default_2275")] + #[serde(default = "default_2295")] pub revision: Integer, - #[serde(default = "default_2276")] + #[serde(default = "default_2296")] pub rejected_revisions: Vec>, - #[serde(default = "default_2277")] + #[serde(default = "default_2297")] pub tool_overlap: f64, - #[serde(default = "default_2278")] + #[serde(default = "default_2298")] pub score: f64, - #[serde(default = "default_2279")] + #[serde(default = "default_2299")] pub utility: f64, - #[serde(default = "default_2280")] + #[serde(default = "default_2300")] pub goal_similarity: Option, - #[serde(default = "default_2281")] + #[serde(default = "default_2301")] pub for_agent: std::collections::HashMap, - #[serde(default = "default_2282")] + #[serde(default = "default_2302")] pub run_stats_by_agent: std::collections::HashMap>, - #[serde(default = "default_2283")] + #[serde(default = "default_2303")] pub actor: String, } @@ -51529,11 +52370,11 @@ pub struct ProcedureMatch { #[non_exhaustive] pub struct ProcedureMatchOutput { pub matches: Vec, - #[serde(default = "default_2284")] + #[serde(default = "default_2304")] pub matched: Integer, - #[serde(default = "default_2285")] + #[serde(default = "default_2305")] pub procedure_key: String, - #[serde(default = "default_2286")] + #[serde(default = "default_2306")] pub score: f64, } @@ -51925,9 +52766,9 @@ pub struct ProcedureReviseOutput { pub revision: Integer, pub prior_revision: Integer, pub digest: String, - #[serde(default = "default_2287")] + #[serde(default = "default_2307")] pub steps: Vec, - #[serde(default = "default_2288")] + #[serde(default = "default_2308")] pub outcome: ProcedureReviseOutputOutcome, } @@ -52039,14 +52880,14 @@ pub struct ProfileActivityEntry { pub agent: String, pub last_activated_at: String, pub event_count: Integer, - #[serde(default = "default_2289")] + #[serde(default = "default_2309")] pub operations: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProfileActivityOutput { - #[serde(default = "default_2290")] + #[serde(default = "default_2310")] pub entries: Vec, } @@ -52154,17 +52995,17 @@ impl ProfileActivityInput { #[non_exhaustive] pub struct ProfileMutationOutput { pub version: Integer, - #[serde(default = "default_2291")] + #[serde(default = "default_2311")] pub memory_id: String, - #[serde(default = "default_2292")] + #[serde(default = "default_2312")] pub content_sha256: String, - #[serde(default = "default_2293")] + #[serde(default = "default_2313")] pub namespace: String, - #[serde(default = "default_2294")] + #[serde(default = "default_2314")] pub label: String, - #[serde(default = "default_2295")] + #[serde(default = "default_2315")] pub char_limit: Option, - #[serde(default = "default_2296")] + #[serde(default = "default_2316")] pub value_length: Integer, } @@ -52273,7 +53114,7 @@ pub struct ProfileRenderOutput { pub rendered: String, pub section_count: Integer, pub total_chars: Integer, - #[serde(default = "default_2297")] + #[serde(default = "default_2317")] pub labels: Vec, } @@ -52658,17 +53499,17 @@ pub enum ProfileStructuredOutputStatus { #[non_exhaustive] pub struct ProfileStructuredOutput { pub status: ProfileStructuredOutputStatus, - #[serde(default = "default_2298")] + #[serde(default = "default_2318")] pub profile: std::collections::HashMap, - #[serde(default = "default_2299")] + #[serde(default = "default_2319")] pub built_at: Option, - #[serde(default = "default_2300")] + #[serde(default = "default_2320")] pub memory_id: String, - #[serde(default = "default_2301")] + #[serde(default = "default_2321")] pub version: Integer, - #[serde(default = "default_2302")] + #[serde(default = "default_2322")] pub version_text: String, - #[serde(default = "default_2303")] + #[serde(default = "default_2323")] pub schema_sha256: String, } @@ -52785,13 +53626,13 @@ impl ProfileStructuredInput { #[non_exhaustive] pub struct ProfileSchemaOutput { pub found: bool, - #[serde(default = "default_2304")] + #[serde(default = "default_2324")] pub json_schema: std::collections::HashMap, - #[serde(default = "default_2305")] + #[serde(default = "default_2325")] pub schema_sha256: String, - #[serde(default = "default_2306")] + #[serde(default = "default_2326")] pub updated_by: String, - #[serde(default = "default_2307")] + #[serde(default = "default_2327")] pub updated_at: Option, } @@ -52944,10 +53785,10 @@ pub enum RunBeginOutputStatus { #[non_exhaustive] pub struct RunBeginOutput { pub run_id: String, - #[serde(default = "default_2308")] + #[serde(default = "default_2328")] pub status: RunBeginOutputStatus, pub started_at: String, - #[serde(default = "default_2309")] + #[serde(default = "default_2329")] pub next: String, } @@ -53155,29 +53996,29 @@ pub struct RunCompleteOutput { pub run_id: String, pub status: RunCompleteOutputStatus, pub duration_ms: Integer, - #[serde(default = "default_2310")] + #[serde(default = "default_2330")] pub used_applied: Integer, - #[serde(default = "default_2311")] + #[serde(default = "default_2331")] pub evidence_applied: Integer, - #[serde(default = "default_2312")] + #[serde(default = "default_2332")] pub harm_applied: Integer, - #[serde(default = "default_2313")] + #[serde(default = "default_2333")] pub memories_written: Vec, - #[serde(default = "default_2314")] + #[serde(default = "default_2334")] pub recalled: Integer, - #[serde(default = "default_2315")] + #[serde(default = "default_2335")] pub observations: Integer, - #[serde(default = "default_2316")] + #[serde(default = "default_2336")] pub procedure_runs_recorded: Integer, - #[serde(default = "default_2317")] + #[serde(default = "default_2337")] pub reflection_key: String, - #[serde(default = "default_2318")] + #[serde(default = "default_2338")] pub retain: String, - #[serde(default = "default_2319")] + #[serde(default = "default_2339")] pub retained: Integer, - #[serde(default = "default_2320")] + #[serde(default = "default_2340")] pub demoted: Integer, - #[serde(default = "default_2321")] + #[serde(default = "default_2341")] pub expiring: Integer, } @@ -53698,25 +54539,25 @@ pub enum RunGetOutputOverBudgetItem { #[non_exhaustive] pub struct RunGetOutput { pub found: bool, - #[serde(default = "default_2322")] + #[serde(default = "default_2342")] pub run: Option, - #[serde(default = "default_2323")] + #[serde(default = "default_2343")] pub recalled: Integer, - #[serde(default = "default_2324")] + #[serde(default = "default_2344")] pub recalled_keys: Vec, - #[serde(default = "default_2325")] + #[serde(default = "default_2345")] pub memories_written: Vec, - #[serde(default = "default_2326")] + #[serde(default = "default_2346")] pub observations: Integer, - #[serde(default = "default_2327")] + #[serde(default = "default_2347")] pub turns: Integer, - #[serde(default = "default_2328")] + #[serde(default = "default_2348")] pub unpriced_turns: Integer, - #[serde(default = "default_2329")] + #[serde(default = "default_2349")] pub cost_usd: f64, - #[serde(default = "default_2330")] + #[serde(default = "default_2350")] pub elapsed_seconds: Integer, - #[serde(default = "default_2331")] + #[serde(default = "default_2351")] pub over_budget: Vec, } @@ -53783,17 +54624,17 @@ pub struct RunGradeProposal { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct RunGradeOutput { - #[serde(default = "default_2332")] + #[serde(default = "default_2352")] pub graded: Integer, - #[serde(default = "default_2333")] + #[serde(default = "default_2353")] pub run_ids: Vec, - #[serde(default = "default_2334")] + #[serde(default = "default_2354")] pub skipped_active: Integer, - #[serde(default = "default_2335")] + #[serde(default = "default_2355")] pub unchanged: Integer, - #[serde(default = "default_2336")] + #[serde(default = "default_2356")] pub memories_counted: Integer, - #[serde(default = "default_2337")] + #[serde(default = "default_2357")] pub proposals_decided: Vec, } @@ -53908,7 +54749,7 @@ impl RunGradeInput { #[non_exhaustive] pub struct RunListOutput { pub runs: Vec, - #[serde(default = "default_2338")] + #[serde(default = "default_2358")] pub total: Option, } @@ -54185,39 +55026,39 @@ pub struct LiveSearchHit { pub title: String, pub url: String, pub provider: LiveSearchHitProvider, - #[serde(default = "default_2341")] + #[serde(default = "default_2361")] pub content: String, - #[serde(default = "default_2342")] + #[serde(default = "default_2362")] pub live: LiveSearchHitLive, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct LiveSearchResults { - #[serde(default = "default_2340")] + #[serde(default = "default_2360")] pub live: LiveSearchResultsLive, - #[serde(default = "default_2343")] + #[serde(default = "default_2363")] pub results: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SearchOutput { - #[serde(default = "default_2339")] + #[serde(default = "default_2359")] pub tracker: Option>, - #[serde(default = "default_2344")] + #[serde(default = "default_2364")] pub live: Option, - #[serde(default = "default_2345")] + #[serde(default = "default_2365")] pub memory: std::collections::HashMap, - #[serde(default = "default_2346")] + #[serde(default = "default_2366")] pub knowledge: std::collections::HashMap, - #[serde(default = "default_2347")] + #[serde(default = "default_2367")] pub profile: std::collections::HashMap, - #[serde(default = "default_2348")] + #[serde(default = "default_2368")] pub conversations: std::collections::HashMap, - #[serde(default = "default_2349")] + #[serde(default = "default_2369")] pub withheld: Option>, - #[serde(default = "default_2350")] + #[serde(default = "default_2370")] pub namespaces_skipped: Vec, } @@ -54410,7 +55251,7 @@ impl SearchInput { pub struct SessionBriefDeleteOutput { pub deleted: bool, pub brief_key: String, - #[serde(default = "default_2351")] + #[serde(default = "default_2371")] pub revision: Integer, } @@ -54503,67 +55344,67 @@ impl SessionBriefDeleteInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDecision { - #[serde(default = "default_2360")] + #[serde(default = "default_2380")] pub what: String, - #[serde(default = "default_2361")] + #[serde(default = "default_2381")] pub why: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDeadEnd { - #[serde(default = "default_2363")] + #[serde(default = "default_2383")] pub tried: String, - #[serde(default = "default_2364")] + #[serde(default = "default_2384")] pub why_not: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDone { - #[serde(default = "default_2366")] + #[serde(default = "default_2386")] pub what: String, - #[serde(rename = "ref", default = "default_2367")] + #[serde(rename = "ref", default = "default_2387")] pub r#ref: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefFile { - #[serde(default = "default_2371")] + #[serde(default = "default_2391")] pub path: String, - #[serde(default = "default_2372")] + #[serde(default = "default_2392")] pub role: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefSections { - #[serde(default = "default_2357")] + #[serde(default = "default_2377")] pub goal: String, - #[serde(default = "default_2358")] + #[serde(default = "default_2378")] pub status: String, - #[serde(default = "default_2359")] + #[serde(default = "default_2379")] pub verification: String, - #[serde(default = "default_2362")] + #[serde(default = "default_2382")] pub decisions: Vec, - #[serde(default = "default_2365")] + #[serde(default = "default_2385")] pub dead_ends: Vec, - #[serde(default = "default_2368")] + #[serde(default = "default_2388")] pub done: Vec, - #[serde(default = "default_2369")] + #[serde(default = "default_2389")] pub open_questions: Vec, - #[serde(default = "default_2370")] + #[serde(default = "default_2390")] pub next_steps: Vec, - #[serde(default = "default_2373")] + #[serde(default = "default_2393")] pub files: Vec, - #[serde(default = "default_2374")] + #[serde(default = "default_2394")] pub constraints: Vec, - #[serde(default = "default_2375")] + #[serde(default = "default_2395")] pub pointers: Vec, - #[serde(default = "default_2376")] + #[serde(default = "default_2396")] pub client_summary: String, - #[serde(default = "default_2377")] + #[serde(default = "default_2397")] pub client_summary_at: String, } @@ -54571,45 +55412,45 @@ pub struct BriefSections { #[non_exhaustive] pub struct SessionBriefGetOutput { pub found: bool, - #[serde(default = "default_2352")] + #[serde(default = "default_2372")] pub brief_key: String, - #[serde(default = "default_2353")] + #[serde(default = "default_2373")] pub revision: Integer, - #[serde(default = "default_2354")] + #[serde(default = "default_2374")] pub snapshot_id: String, - #[serde(default = "default_2355")] + #[serde(default = "default_2375")] pub snapshot_key: String, - #[serde(default = "default_2356")] + #[serde(default = "default_2376")] pub rendered: String, - #[serde(default = "default_2378")] + #[serde(default = "default_2398")] pub sections: Option, - #[serde(default = "default_2379")] + #[serde(default = "default_2399")] pub project: String, - #[serde(default = "default_2380")] + #[serde(default = "default_2400")] pub branch: String, - #[serde(default = "default_2381")] + #[serde(default = "default_2401")] pub head_sha: String, - #[serde(default = "default_2382")] + #[serde(default = "default_2402")] pub author: String, - #[serde(default = "default_2383")] + #[serde(default = "default_2403")] pub trigger: String, - #[serde(default = "default_2384")] + #[serde(default = "default_2404")] pub actor: String, - #[serde(default = "default_2385")] + #[serde(default = "default_2405")] pub source_sessions: Vec, - #[serde(default = "default_2386")] + #[serde(default = "default_2406")] pub updated_at: Option, - #[serde(default = "default_2387")] + #[serde(default = "default_2407")] pub age_seconds: Integer, - #[serde(default = "default_2388")] + #[serde(default = "default_2408")] pub revisions: Integer, - #[serde(default = "default_2389")] + #[serde(default = "default_2409")] pub events_total: Integer, - #[serde(default = "default_2390")] + #[serde(default = "default_2410")] pub source_chars: Integer, - #[serde(default = "default_2391")] + #[serde(default = "default_2411")] pub brief_chars: Integer, - #[serde(default = "default_2392")] + #[serde(default = "default_2412")] pub deleted: bool, } @@ -54784,34 +55625,34 @@ impl SessionBriefGetInput { pub struct SessionBriefSummary { pub brief_key: String, pub revision: Integer, - #[serde(default = "default_2393")] + #[serde(default = "default_2413")] pub project: String, - #[serde(default = "default_2394")] + #[serde(default = "default_2414")] pub branch: String, - #[serde(default = "default_2395")] + #[serde(default = "default_2415")] pub agent: String, - #[serde(default = "default_2396")] + #[serde(default = "default_2416")] pub goal: String, - #[serde(default = "default_2397")] + #[serde(default = "default_2417")] pub status: String, - #[serde(default = "default_2398")] + #[serde(default = "default_2418")] pub author: String, - #[serde(default = "default_2399")] + #[serde(default = "default_2419")] pub actor: String, - #[serde(default = "default_2400")] + #[serde(default = "default_2420")] pub updated_at: Option, - #[serde(default = "default_2401")] + #[serde(default = "default_2421")] pub age_seconds: Integer, - #[serde(default = "default_2402")] + #[serde(default = "default_2422")] pub brief_chars: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SessionBriefListOutput { - #[serde(default = "default_2403")] + #[serde(default = "default_2423")] pub briefs: Vec, - #[serde(default = "default_2404")] + #[serde(default = "default_2424")] pub rendered: String, } @@ -54951,25 +55792,25 @@ impl SessionBriefListInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SessionBriefStats { - #[serde(default = "default_2408")] + #[serde(default = "default_2428")] pub events_in: Integer, - #[serde(default = "default_2409")] + #[serde(default = "default_2429")] pub windows: Integer, - #[serde(default = "default_2410")] + #[serde(default = "default_2430")] pub events_total: Integer, - #[serde(default = "default_2411")] + #[serde(default = "default_2431")] pub source_chars: Integer, - #[serde(default = "default_2412")] + #[serde(default = "default_2432")] pub brief_chars: Integer, - #[serde(default = "default_2413")] + #[serde(default = "default_2433")] pub compression_ratio: f64, - #[serde(default = "default_2414")] + #[serde(default = "default_2434")] pub dropped_ungrounded: Integer, - #[serde(default = "default_2415")] + #[serde(default = "default_2435")] pub tokens_in: Integer, - #[serde(default = "default_2416")] + #[serde(default = "default_2436")] pub tokens_out: Integer, - #[serde(default = "default_2417")] + #[serde(default = "default_2437")] pub llm_model: String, } @@ -54979,13 +55820,13 @@ pub struct SessionBriefSaveOutput { pub brief_key: String, pub revision: Integer, pub changed: bool, - #[serde(default = "default_2405")] + #[serde(default = "default_2425")] pub author: String, - #[serde(default = "default_2406")] + #[serde(default = "default_2426")] pub reason: String, - #[serde(default = "default_2407")] + #[serde(default = "default_2427")] pub rendered: String, - #[serde(default = "default_2418")] + #[serde(default = "default_2438")] pub stats: SessionBriefStats, } @@ -55730,39 +56571,39 @@ pub struct TaskPayload { pub priority: Integer, pub disclosure: TaskPayloadDisclosure, pub status: TaskPayloadStatus, - #[serde(default = "default_2419")] + #[serde(default = "default_2439")] pub reason: String, - #[serde(default = "default_2420")] + #[serde(default = "default_2440")] pub blocked_on: String, - #[serde(default = "default_2421")] + #[serde(default = "default_2441")] pub not_before: Option, - #[serde(default = "default_2422")] + #[serde(default = "default_2442")] pub resume_at: Option, - #[serde(default = "default_2423")] + #[serde(default = "default_2443")] pub deadline: Option, - #[serde(default = "default_2424")] + #[serde(default = "default_2444")] pub defer_count: Integer, pub title: String, - #[serde(default = "default_2425")] + #[serde(default = "default_2445")] pub brief: std::collections::HashMap, pub from_agent: String, - #[serde(default = "default_2426")] + #[serde(default = "default_2446")] pub from_subject: String, - #[serde(default = "default_2427")] + #[serde(default = "default_2447")] pub origin: String, - #[serde(default = "default_2428")] + #[serde(default = "default_2448")] pub parent_task_id: Option, - #[serde(default = "default_2429")] + #[serde(default = "default_2449")] pub owner: String, - #[serde(default = "default_2430")] + #[serde(default = "default_2450")] pub attempt: Integer, - #[serde(default = "default_2431")] + #[serde(default = "default_2451")] pub fence: Integer, - #[serde(default = "default_2432")] + #[serde(default = "default_2452")] pub lease_until: Option, - #[serde(default = "default_2433")] + #[serde(default = "default_2453")] pub outcome: std::collections::HashMap, - #[serde(default = "default_2434")] + #[serde(default = "default_2454")] pub last_actor: String, pub created_at: String, pub updated_at: String, @@ -55773,7 +56614,7 @@ pub struct TaskPayload { #[non_exhaustive] pub struct TaskOutput { pub task: TaskPayload, - #[serde(default = "default_2435")] + #[serde(default = "default_2455")] pub seq: Integer, } @@ -56174,10 +57015,10 @@ impl TaskCompleteInput { pub struct InboxCount { pub inbox: String, pub status: String, - #[serde(default = "default_2436")] + #[serde(default = "default_2456")] pub blocked_on: String, pub n: Integer, - #[serde(default = "default_2437")] + #[serde(default = "default_2457")] pub oldest: Option, } @@ -56264,7 +57105,7 @@ pub struct TaskCreateOutput { pub task: TaskPayload, pub created: bool, pub seq: Integer, - #[serde(default = "default_2438")] + #[serde(default = "default_2458")] pub next: String, } @@ -56603,7 +57444,7 @@ impl TaskFailInput { #[non_exhaustive] pub struct TaskGetOutput { pub found: bool, - #[serde(default = "default_2439")] + #[serde(default = "default_2459")] pub task: Option, } @@ -56737,23 +57578,23 @@ pub struct TaskEventPayload { pub task_id: String, pub inbox: String, pub event: String, - #[serde(default = "default_2440")] + #[serde(default = "default_2460")] pub from_status: String, - #[serde(default = "default_2441")] + #[serde(default = "default_2461")] pub to_status: String, - #[serde(default = "default_2442")] + #[serde(default = "default_2462")] pub actor: String, - #[serde(default = "default_2443")] + #[serde(default = "default_2463")] pub agent: String, - #[serde(default = "default_2444")] + #[serde(default = "default_2464")] pub fence: Integer, - #[serde(default = "default_2445")] + #[serde(default = "default_2465")] pub version: Integer, - #[serde(default = "default_2446")] + #[serde(default = "default_2466")] pub reason: String, - #[serde(default = "default_2447")] + #[serde(default = "default_2467")] pub patch: std::collections::HashMap, - #[serde(default = "default_2448")] + #[serde(default = "default_2468")] pub note: String, pub ts: String, } @@ -57093,7 +57934,7 @@ pub struct TaskPullOutput { pub tasks: Vec, pub waited_ms: Integer, pub backend: String, - #[serde(default = "default_2449")] + #[serde(default = "default_2469")] pub note: String, } @@ -57489,7 +58330,7 @@ impl TaskUnblockInput { pub struct TaskUpdateOutput { pub task: TaskPayload, pub seq: Integer, - #[serde(default = "default_2450")] + #[serde(default = "default_2470")] pub conflict: bool, } @@ -57852,19 +58693,19 @@ impl TaskReasonInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerAnswerOutput { - #[serde(default = "default_2451")] + #[serde(default = "default_2471")] pub intent: String, - #[serde(default = "default_2452")] + #[serde(default = "default_2472")] pub anchors: std::collections::HashMap, - #[serde(default = "default_2453")] + #[serde(default = "default_2473")] pub sections: Vec>, - #[serde(default = "default_2454")] + #[serde(default = "default_2474")] pub searched: Vec, - #[serde(default = "default_2455")] + #[serde(default = "default_2475")] pub lines: Vec, - #[serde(default = "default_2456")] + #[serde(default = "default_2476")] pub restricted: bool, - #[serde(default = "default_2457")] + #[serde(default = "default_2477")] pub verdict: String, } @@ -57960,17 +58801,17 @@ impl TrackerAnswerInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerBindingOutput { - #[serde(default = "default_2458")] + #[serde(default = "default_2478")] pub tracker_namespace: String, - #[serde(default = "default_2459")] + #[serde(default = "default_2479")] pub tracker_namespaces: Vec, - #[serde(default = "default_2460")] + #[serde(default = "default_2480")] pub restricted: bool, - #[serde(default = "default_2461")] + #[serde(default = "default_2481")] pub kind: String, - #[serde(default = "default_2462")] + #[serde(default = "default_2482")] pub authorized: bool, - #[serde(default = "default_2463")] + #[serde(default = "default_2483")] pub templates: Vec, } @@ -58023,13 +58864,13 @@ impl TrackerBindingInput { #[non_exhaustive] pub struct TrackerComponentOutput { pub component: String, - #[serde(default = "default_2464")] + #[serde(default = "default_2484")] pub risk: std::collections::HashMap, - #[serde(default = "default_2465")] + #[serde(default = "default_2485")] pub open_issues: Vec>, - #[serde(default = "default_2466")] + #[serde(default = "default_2486")] pub known: bool, - #[serde(default = "default_2467")] + #[serde(default = "default_2487")] pub tracker_unavailable: bool, } @@ -58090,9 +58931,9 @@ impl TrackerComponentInput { #[non_exhaustive] pub struct TrackerContractOutput { pub database: String, - #[serde(default = "default_2468")] + #[serde(default = "default_2488")] pub tables: Vec>, - #[serde(default = "default_2469")] + #[serde(default = "default_2489")] pub templates: std::collections::HashMap, } @@ -58145,66 +58986,66 @@ impl TrackerContractInput { #[non_exhaustive] pub struct TrackerLegStatus { pub name: String, - #[serde(default = "default_2480")] + #[serde(default = "default_2500")] pub status: String, - #[serde(default = "default_2481")] + #[serde(default = "default_2501")] pub reason: String, - #[serde(default = "default_2482")] + #[serde(default = "default_2502")] pub message: String, - #[serde(default = "default_2483")] + #[serde(default = "default_2503")] pub retried: bool, - #[serde(default = "default_2484")] + #[serde(default = "default_2504")] pub ms: Integer, - #[serde(default = "default_2485")] + #[serde(default = "default_2505")] pub cause: String, - #[serde(default = "default_2486")] + #[serde(default = "default_2506")] pub namespace: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerDuplicateCheckOutput { - #[serde(default = "default_2470")] + #[serde(default = "default_2490")] pub verdict: String, - #[serde(default = "default_2471")] + #[serde(default = "default_2491")] pub items: Vec>, - #[serde(default = "default_2472")] + #[serde(default = "default_2492")] pub undecided: bool, - #[serde(default = "default_2473")] + #[serde(default = "default_2493")] pub epistemic: String, - #[serde(default = "default_2474")] + #[serde(default = "default_2494")] pub thresholds: std::collections::HashMap, - #[serde(default = "default_2475")] + #[serde(default = "default_2495")] pub judge: std::collections::HashMap, - #[serde(default = "default_2476")] + #[serde(default = "default_2496")] pub fit_at: String, - #[serde(default = "default_2477")] + #[serde(default = "default_2497")] pub fit: std::collections::HashMap, - #[serde(default = "default_2478")] + #[serde(default = "default_2498")] pub query: std::collections::HashMap, - #[serde(default = "default_2479")] + #[serde(default = "default_2499")] pub legs: std::collections::HashMap, - #[serde(default = "default_2487")] + #[serde(default = "default_2507")] pub leg_status: Vec, - #[serde(default = "default_2488")] + #[serde(default = "default_2508")] pub tracker_unavailable: bool, - #[serde(default = "default_2489")] + #[serde(default = "default_2509")] pub namespaces: Vec, - #[serde(default = "default_2490")] + #[serde(default = "default_2510")] pub by_namespace: std::collections::HashMap>, - #[serde(default = "default_2491")] + #[serde(default = "default_2511")] pub closest: Vec>, - #[serde(default = "default_2492")] + #[serde(default = "default_2512")] pub needs: Vec>, - #[serde(default = "default_2493")] + #[serde(default = "default_2513")] pub closest_note: String, - #[serde(default = "default_2494")] + #[serde(default = "default_2514")] pub nearest: Vec>, - #[serde(default = "default_2495")] + #[serde(default = "default_2515")] pub rerank: std::collections::HashMap, - #[serde(default = "default_2496")] + #[serde(default = "default_2516")] pub answer: String, - #[serde(default = "default_2497")] + #[serde(default = "default_2517")] pub related_prs: Vec>, } @@ -58411,17 +59252,17 @@ impl TrackerDuplicateCheckInput { #[non_exhaustive] pub struct TrackerFlakyOutput { pub test_name: String, - #[serde(default = "default_2498")] + #[serde(default = "default_2518")] pub known_flaky: bool, - #[serde(default = "default_2499")] + #[serde(default = "default_2519")] pub open_issues: Integer, - #[serde(default = "default_2500")] + #[serde(default = "default_2520")] pub issues: Vec>, - #[serde(default = "default_2501")] + #[serde(default = "default_2521")] pub verdict: String, - #[serde(default = "default_2502")] + #[serde(default = "default_2522")] pub tracker_unavailable: bool, - #[serde(default = "default_2503")] + #[serde(default = "default_2523")] pub signal: Option>, } @@ -58504,9 +59345,9 @@ impl TrackerFlakyInput { #[non_exhaustive] pub struct TrackerItemOutput { pub items: Vec>, - #[serde(default = "default_2504")] + #[serde(default = "default_2524")] pub unknown: Vec, - #[serde(default = "default_2505")] + #[serde(default = "default_2525")] pub tracker_unavailable: bool, } @@ -58555,19 +59396,19 @@ impl TrackerItemInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerLinksOutput { - #[serde(default = "default_2506")] + #[serde(default = "default_2526")] pub subject: std::collections::HashMap, - #[serde(default = "default_2507")] + #[serde(default = "default_2527")] pub verdict: String, - #[serde(default = "default_2508")] + #[serde(default = "default_2528")] pub items: Vec>, - #[serde(default = "default_2509")] + #[serde(default = "default_2529")] pub epistemic: String, - #[serde(default = "default_2510")] + #[serde(default = "default_2530")] pub record: std::collections::HashMap, - #[serde(default = "default_2511")] + #[serde(default = "default_2531")] pub computed_at: String, - #[serde(default = "default_2512")] + #[serde(default = "default_2532")] pub tracker_unavailable: bool, } @@ -58665,11 +59506,11 @@ impl TrackerLinksInput { pub struct TrackerReleaseOutput { pub version: String, pub blockers: Vec>, - #[serde(default = "default_2513")] + #[serde(default = "default_2533")] pub active_blockers: Integer, - #[serde(default = "default_2514")] + #[serde(default = "default_2534")] pub health: std::collections::HashMap, - #[serde(default = "default_2515")] + #[serde(default = "default_2535")] pub tracker_unavailable: bool, } @@ -58718,17 +59559,17 @@ impl TrackerReleaseInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerSimilarOutput { - #[serde(default = "default_2516")] + #[serde(default = "default_2536")] pub items: Vec>, - #[serde(default = "default_2517")] + #[serde(default = "default_2537")] pub query: std::collections::HashMap, - #[serde(default = "default_2518")] + #[serde(default = "default_2538")] pub legs: std::collections::HashMap, - #[serde(default = "default_2519")] + #[serde(default = "default_2539")] pub epistemic: String, - #[serde(default = "default_2520")] + #[serde(default = "default_2540")] pub tracker_unavailable: bool, - #[serde(default = "default_2521")] + #[serde(default = "default_2541")] pub namespaces: Vec, } @@ -58849,19 +59690,19 @@ pub struct TrackerSourceAddOutput { pub name: String, pub host: String, pub database: String, - #[serde(default = "default_2522")] + #[serde(default = "default_2542")] pub namespaces: Vec>, - #[serde(default = "default_2523")] + #[serde(default = "default_2543")] pub contract: std::collections::HashMap, - #[serde(default = "default_2524")] + #[serde(default = "default_2544")] pub roles: Vec, - #[serde(default = "default_2525")] + #[serde(default = "default_2545")] pub my_role: String, - #[serde(default = "default_2526")] + #[serde(default = "default_2546")] pub dry_run: bool, - #[serde(default = "default_2527")] + #[serde(default = "default_2547")] pub written: bool, - #[serde(default = "default_2528")] + #[serde(default = "default_2548")] pub view_templates: std::collections::HashMap, } @@ -59024,13 +59865,13 @@ impl TrackerSourceAddInput { #[non_exhaustive] pub struct TrackerSourceCheckOutput { pub name: String, - #[serde(default = "default_2529")] + #[serde(default = "default_2549")] pub database: String, - #[serde(default = "default_2530")] + #[serde(default = "default_2550")] pub reachable: bool, - #[serde(default = "default_2531")] + #[serde(default = "default_2551")] pub contract: std::collections::HashMap, - #[serde(default = "default_2532")] + #[serde(default = "default_2552")] pub view_templates: std::collections::HashMap, } @@ -59070,11 +59911,11 @@ impl TrackerSourceCheckInput { pub struct TrackerSourceInspectOutput { pub host: String, pub database: String, - #[serde(default = "default_2533")] + #[serde(default = "default_2553")] pub tables: Vec>, - #[serde(default = "default_2534")] + #[serde(default = "default_2554")] pub roles: Vec, - #[serde(default = "default_2535")] + #[serde(default = "default_2555")] pub proposal: std::collections::HashMap, } @@ -59203,9 +60044,9 @@ impl TrackerSourceInspectInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerSourceListOutput { - #[serde(default = "default_2536")] + #[serde(default = "default_2556")] pub sources: Vec>, - #[serde(default = "default_2537")] + #[serde(default = "default_2557")] pub self_service: bool, } @@ -59258,9 +60099,9 @@ impl TrackerSourceListInput { #[non_exhaustive] pub struct TrackerSourceRemoveOutput { pub name: String, - #[serde(default = "default_2538")] + #[serde(default = "default_2558")] pub deactivated: bool, - #[serde(default = "default_2539")] + #[serde(default = "default_2559")] pub namespaces_retired: Vec, } @@ -59301,9 +60142,9 @@ impl TrackerSourceRemoveInput { #[non_exhaustive] pub struct TrackerSourceRotateOutput { pub name: String, - #[serde(default = "default_2540")] + #[serde(default = "default_2560")] pub contract: std::collections::HashMap, - #[serde(default = "default_2541")] + #[serde(default = "default_2561")] pub rotated_at: String, } @@ -59350,11 +60191,11 @@ impl TrackerSourceRotateInput { #[non_exhaustive] pub struct TrackerSourceSetMappingOutput { pub name: String, - #[serde(default = "default_2542")] + #[serde(default = "default_2562")] pub contract: std::collections::HashMap, - #[serde(default = "default_2543")] + #[serde(default = "default_2563")] pub dry_run: bool, - #[serde(default = "default_2544")] + #[serde(default = "default_2564")] pub written: bool, } @@ -59421,45 +60262,45 @@ impl TrackerSourceSetMappingInput { #[non_exhaustive] pub struct TrackerTestSignalOutput { pub test_name: String, - #[serde(default = "default_2545")] + #[serde(default = "default_2565")] pub verdict: String, - #[serde(default = "default_2546")] + #[serde(default = "default_2566")] pub why: Vec, - #[serde(default = "default_2547")] + #[serde(default = "default_2567")] pub lower_bound: f64, - #[serde(default = "default_2548")] + #[serde(default = "default_2568")] pub window_days: Integer, - #[serde(default = "default_2549")] + #[serde(default = "default_2569")] pub since: String, - #[serde(default = "default_2550")] + #[serde(default = "default_2570")] pub features: std::collections::HashMap, - #[serde(default = "default_2551")] + #[serde(default = "default_2571")] pub infra: std::collections::HashMap, - #[serde(default = "default_2552")] + #[serde(default = "default_2572")] pub churn: std::collections::HashMap, - #[serde(default = "default_2553")] + #[serde(default = "default_2573")] pub thresholds: std::collections::HashMap, - #[serde(default = "default_2554")] + #[serde(default = "default_2574")] pub source: String, - #[serde(default = "default_2555")] + #[serde(default = "default_2575")] pub timings_ms: std::collections::HashMap, - #[serde(default = "default_2556")] + #[serde(default = "default_2576")] pub tracker_unavailable: bool, - #[serde(default = "default_2557")] + #[serde(default = "default_2577")] pub rollup: std::collections::HashMap, - #[serde(default = "default_2558")] + #[serde(default = "default_2578")] pub streak: std::collections::HashMap, - #[serde(default = "default_2559")] + #[serde(default = "default_2579")] pub smells: std::collections::HashMap, - #[serde(default = "default_2560")] + #[serde(default = "default_2580")] pub prior: std::collections::HashMap, - #[serde(default = "default_2561")] + #[serde(default = "default_2581")] pub unavailable_reason: String, - #[serde(default = "default_2562")] + #[serde(default = "default_2582")] pub candidates: Vec>, - #[serde(default = "default_2563")] + #[serde(default = "default_2583")] pub candidate_matches: Integer, - #[serde(default = "default_2564")] + #[serde(default = "default_2584")] pub resolved_from: String, } @@ -59563,9 +60404,9 @@ impl TrackerTestSignalInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct UiVitalsOutput { - #[serde(default = "default_2565")] + #[serde(default = "default_2585")] pub recorded: bool, - #[serde(default = "default_2566")] + #[serde(default = "default_2586")] pub route: String, } @@ -59749,7 +60590,7 @@ pub struct WebhookDelivery { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct WebhookDeliveriesOutput { - #[serde(default = "default_2567")] + #[serde(default = "default_2587")] pub deliveries: Vec, } @@ -59871,14 +60712,14 @@ pub struct WebhookInfo { pub secret_ref: String, pub events: Vec, pub created_at: String, - #[serde(default = "default_2568")] + #[serde(default = "default_2588")] pub secret_present: bool, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct WebhookListOutput { - #[serde(default = "default_2569")] + #[serde(default = "default_2589")] pub webhooks: Vec, } @@ -60060,7 +60901,7 @@ pub struct WorkingMemoryMutationOutput { pub version: Integer, pub char_limit: Integer, pub value_length: Integer, - #[serde(default = "default_2570")] + #[serde(default = "default_2590")] pub fill_ratio: f64, } @@ -60284,15 +61125,15 @@ impl WorkingMemoryDeleteInput { pub struct WorkingMemoryGetOutput { pub found: bool, pub block_key: String, - #[serde(default = "default_2571")] + #[serde(default = "default_2591")] pub content: String, - #[serde(default = "default_2572")] + #[serde(default = "default_2592")] pub char_limit: Integer, - #[serde(default = "default_2573")] + #[serde(default = "default_2593")] pub version: Integer, - #[serde(default = "default_2574")] + #[serde(default = "default_2594")] pub updated_at: Option, - #[serde(default = "default_2575")] + #[serde(default = "default_2595")] pub fill_ratio: f64, } @@ -60403,7 +61244,7 @@ pub struct WorkingMemoryBlock { pub content: String, pub char_limit: Integer, pub version: Integer, - #[serde(default = "default_2576")] + #[serde(default = "default_2596")] pub updated_at: Option, } @@ -60411,7 +61252,7 @@ pub struct WorkingMemoryBlock { #[non_exhaustive] pub struct WorkingMemoryRenderOutput { pub rendered: String, - #[serde(default = "default_2577")] + #[serde(default = "default_2597")] pub blocks: Vec, pub block_count: Integer, pub total_chars: Integer, @@ -64386,4145 +65227,4205 @@ fn default_1200() -> Vec { fn default_1201() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1202() -> KnowledgeRestoreOutputReason { +fn default_1202() -> KnowledgeReportDetailTargetKind { serde_json::from_str("\"\"").expect("schema default") } fn default_1203() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1204() -> Option { +fn default_1204() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_1205() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1206() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1207() -> bool { + serde_json::from_str("false").expect("schema default") +} +fn default_1208() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1209() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1210() -> Vec { + serde_json::from_str("[]").expect("schema default") +} +fn default_1211() -> Vec { + serde_json::from_str("[]").expect("schema default") +} +fn default_1212() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1213() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1214() -> bool { + serde_json::from_str("true").expect("schema default") +} +fn default_1215() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1205() -> Integer { +fn default_1216() -> KnowledgeReportTargetKind { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1217() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1218() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1206() -> KnowledgeRestoreOutputOriginal { +fn default_1219() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1220() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1221() -> Vec { + serde_json::from_str("[]").expect("schema default") +} +fn default_1222() -> KnowledgeRestoreOutputReason { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1223() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1224() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_1225() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_1226() -> KnowledgeRestoreOutputOriginal { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1207() -> Option { +fn default_1227() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1208() -> Vec> { +fn default_1228() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1209() -> Vec { +fn default_1229() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1210() -> std::collections::HashMap { +fn default_1230() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1211() -> Integer { +fn default_1231() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1212() -> bool { +fn default_1232() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1213() -> Vec { +fn default_1233() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1214() -> Integer { +fn default_1234() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1215() -> bool { +fn default_1235() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1216() -> KnowledgeSourceProbe { +fn default_1236() -> KnowledgeSourceProbe { serde_json::from_str( "{\"documents\":0,\"more\":false,\"sample\":[],\"checked\":0,\"sampled\":false}", ) .expect("schema default") } -fn default_1217() -> bool { +fn default_1237() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1218() -> bool { +fn default_1238() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1219() -> Integer { +fn default_1239() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1220() -> bool { +fn default_1240() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1221() -> Vec { +fn default_1241() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1222() -> Integer { +fn default_1242() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1223() -> bool { +fn default_1243() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1224() -> String { +fn default_1244() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1225() -> String { +fn default_1245() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1226() -> String { +fn default_1246() -> String { serde_json::from_str("\"shared\"").expect("schema default") } -fn default_1227() -> bool { +fn default_1247() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1228() -> String { +fn default_1248() -> String { serde_json::from_str("\"namespace\"").expect("schema default") } -fn default_1229() -> std::collections::HashMap { +fn default_1249() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1230() -> String { +fn default_1250() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1231() -> Vec> { +fn default_1251() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1232() -> Vec { +fn default_1252() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1233() -> std::collections::HashMap { +fn default_1253() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1234() -> String { +fn default_1254() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1235() -> String { +fn default_1255() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1236() -> String { +fn default_1256() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1237() -> String { +fn default_1257() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1238() -> String { +fn default_1258() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1239() -> Integer { +fn default_1259() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1240() -> Integer { +fn default_1260() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1241() -> Integer { +fn default_1261() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1242() -> Integer { +fn default_1262() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1243() -> std::collections::HashMap { +fn default_1263() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1244() -> Integer { +fn default_1264() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1245() -> String { +fn default_1265() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1246() -> Integer { +fn default_1266() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1247() -> String { +fn default_1267() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1248() -> Integer { +fn default_1268() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1249() -> Integer { +fn default_1269() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1250() -> Integer { +fn default_1270() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1251() -> String { +fn default_1271() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1252() -> KnowledgeSourceSync { +fn default_1272() -> 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_1253() -> String { +fn default_1273() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1254() -> String { +fn default_1274() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1255() -> String { +fn default_1275() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1256() -> Vec { +fn default_1276() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1257() -> String { +fn default_1277() -> String { serde_json::from_str("\"shared\"").expect("schema default") } -fn default_1258() -> bool { +fn default_1278() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1259() -> String { +fn default_1279() -> String { serde_json::from_str("\"namespace\"").expect("schema default") } -fn default_1260() -> std::collections::HashMap { +fn default_1280() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1261() -> String { +fn default_1281() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1262() -> Vec> { +fn default_1282() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1263() -> Vec { +fn default_1283() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1264() -> std::collections::HashMap { +fn default_1284() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1265() -> String { +fn default_1285() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1266() -> String { +fn default_1286() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1267() -> KnowledgeSourceSync { +fn default_1287() -> 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_1268() -> Vec { +fn default_1288() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1269() -> bool { +fn default_1289() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1270() -> bool { +fn default_1290() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1271() -> bool { +fn default_1291() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1272() -> String { +fn default_1292() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1273() -> std::collections::HashMap { +fn default_1293() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1274() -> String { +fn default_1294() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1275() -> Vec { +fn default_1295() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1276() -> bool { +fn default_1296() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1277() -> String { +fn default_1297() -> String { serde_json::from_str("\"disabled\"").expect("schema default") } -fn default_1278() -> String { +fn default_1298() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1279() -> String { +fn default_1299() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1280() -> String { +fn default_1300() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1281() -> String { +fn default_1301() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1282() -> String { +fn default_1302() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1283() -> String { +fn default_1303() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1284() -> Integer { +fn default_1304() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1285() -> f64 { +fn default_1305() -> f64 { serde_json::from_str("0").expect("schema default") } -fn default_1286() -> Integer { +fn default_1306() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1287() -> Option { +fn default_1307() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1288() -> KnowledgeSourceProbe { +fn default_1308() -> KnowledgeSourceProbe { serde_json::from_str( "{\"documents\":0,\"more\":false,\"sample\":[],\"checked\":0,\"sampled\":false}", ) .expect("schema default") } -fn default_1289() -> String { +fn default_1309() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1290() -> bool { +fn default_1310() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1291() -> Option { +fn default_1311() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1292() -> Vec> { +fn default_1312() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1293() -> Vec { +fn default_1313() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1294() -> std::collections::HashMap { +fn default_1314() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1295() -> Vec> { +fn default_1315() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1296() -> Vec> { +fn default_1316() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1297() -> KnowledgeSourceProbe { +fn default_1317() -> KnowledgeSourceProbe { serde_json::from_str( "{\"documents\":0,\"more\":false,\"sample\":[],\"checked\":0,\"sampled\":false}", ) .expect("schema default") } -fn default_1298() -> Vec { +fn default_1318() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1299() -> Integer { +fn default_1319() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1300() -> Option> { +fn default_1320() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_1301() -> Vec { +fn default_1321() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1302() -> Vec { +fn default_1322() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1303() -> bool { +fn default_1323() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1304() -> bool { +fn default_1324() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1305() -> String { +fn default_1325() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1306() -> String { +fn default_1326() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1307() -> Vec> { +fn default_1327() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1308() -> bool { +fn default_1328() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1309() -> Vec { +fn default_1329() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1310() -> Vec { +fn default_1330() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1311() -> String { +fn default_1331() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1312() -> String { +fn default_1332() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1313() -> String { +fn default_1333() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1314() -> Vec { +fn default_1334() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1315() -> Integer { +fn default_1335() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1316() -> String { +fn default_1336() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1317() -> Integer { +fn default_1337() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1318() -> String { +fn default_1338() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1319() -> String { +fn default_1339() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1320() -> Integer { +fn default_1340() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1321() -> Integer { +fn default_1341() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1322() -> String { +fn default_1342() -> String { serde_json::from_str("\"memory_supporters\"").expect("schema default") } -fn default_1323() -> String { +fn default_1343() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1324() -> String { +fn default_1344() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1325() -> Option { +fn default_1345() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1326() -> String { +fn default_1346() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1327() -> String { +fn default_1347() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1328() -> bool { +fn default_1348() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1329() -> bool { +fn default_1349() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1330() -> String { +fn default_1350() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1331() -> std::collections::HashMap { +fn default_1351() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1332() -> Vec { +fn default_1352() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1333() -> String { +fn default_1353() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1334() -> String { +fn default_1354() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1335() -> String { +fn default_1355() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1336() -> Vec { +fn default_1356() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1337() -> String { +fn default_1357() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1338() -> String { +fn default_1358() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1339() -> Vec { +fn default_1359() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1340() -> Vec { +fn default_1360() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1341() -> Vec { +fn default_1361() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1342() -> Vec { +fn default_1362() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1343() -> Integer { +fn default_1363() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1344() -> Vec { +fn default_1364() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1345() -> Vec { +fn default_1365() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1346() -> Vec { +fn default_1366() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1347() -> Integer { +fn default_1367() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1348() -> Vec { +fn default_1368() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1349() -> std::collections::HashMap { +fn default_1369() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1350() -> std::collections::HashMap { +fn default_1370() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1351() -> Integer { +fn default_1371() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1352() -> Integer { +fn default_1372() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1353() -> Integer { +fn default_1373() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1354() -> Integer { +fn default_1374() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1355() -> Integer { +fn default_1375() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1356() -> Integer { +fn default_1376() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1357() -> bool { +fn default_1377() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1358() -> String { +fn default_1378() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1359() -> String { +fn default_1379() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1360() -> String { +fn default_1380() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1361() -> String { +fn default_1381() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1362() -> Option { +fn default_1382() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1363() -> String { +fn default_1383() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1364() -> Vec { +fn default_1384() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1365() -> String { +fn default_1385() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1366() -> MemoryAskOutputSource { +fn default_1386() -> MemoryAskOutputSource { serde_json::from_str("\"synthesized\"").expect("schema default") } -fn default_1367() -> bool { +fn default_1387() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1368() -> String { +fn default_1388() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1369() -> Vec { +fn default_1389() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1370() -> Vec { +fn default_1390() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1371() -> Vec { +fn default_1391() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1372() -> String { +fn default_1392() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1373() -> String { +fn default_1393() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1374() -> MemoryAskOutputRouteTier { +fn default_1394() -> MemoryAskOutputRouteTier { serde_json::from_str("\"\"").expect("schema default") } -fn default_1375() -> String { +fn default_1395() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1376() -> Integer { +fn default_1396() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1377() -> Integer { +fn default_1397() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1378() -> bool { +fn default_1398() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1379() -> f64 { +fn default_1399() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1380() -> Option { +fn default_1400() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1381() -> Option { +fn default_1401() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1382() -> bool { +fn default_1402() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1383() -> String { +fn default_1403() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1384() -> Integer { +fn default_1404() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1385() -> Integer { +fn default_1405() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1386() -> Integer { +fn default_1406() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1387() -> Integer { +fn default_1407() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1388() -> String { +fn default_1408() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1389() -> Vec { +fn default_1409() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1390() -> Integer { +fn default_1410() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1391() -> MemoryAskOutputConsistency { +fn default_1411() -> MemoryAskOutputConsistency { serde_json::from_str("\"\"").expect("schema default") } -fn default_1392() -> f64 { +fn default_1412() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1393() -> String { +fn default_1413() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1394() -> Integer { +fn default_1414() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1395() -> Integer { +fn default_1415() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1396() -> String { +fn default_1416() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1397() -> String { +fn default_1417() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1398() -> String { +fn default_1418() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1399() -> String { +fn default_1419() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1400() -> MemoryAskOutputDepth { +fn default_1420() -> MemoryAskOutputDepth { serde_json::from_str("\"\"").expect("schema default") } -fn default_1401() -> bool { +fn default_1421() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1402() -> Vec { +fn default_1422() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1403() -> Integer { +fn default_1423() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1404() -> Integer { +fn default_1424() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1405() -> Integer { +fn default_1425() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1406() -> Vec { +fn default_1426() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1407() -> Integer { +fn default_1427() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1408() -> Integer { +fn default_1428() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1409() -> Integer { +fn default_1429() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1410() -> MemoryAskOutputGrounding { +fn default_1430() -> MemoryAskOutputGrounding { serde_json::from_str("\"\"").expect("schema default") } -fn default_1411() -> String { +fn default_1431() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1412() -> Vec { +fn default_1432() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1413() -> Integer { +fn default_1433() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1414() -> Integer { +fn default_1434() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1415() -> Integer { +fn default_1435() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1416() -> Integer { +fn default_1436() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1417() -> std::collections::HashMap { +fn default_1437() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1418() -> MemoryAskOutputDeepSelector { +fn default_1438() -> MemoryAskOutputDeepSelector { serde_json::from_str("\"\"").expect("schema default") } -fn default_1419() -> MemoryAskOutputDeepFirst { +fn default_1439() -> MemoryAskOutputDeepFirst { serde_json::from_str("\"\"").expect("schema default") } -fn default_1420() -> Integer { +fn default_1440() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1421() -> Integer { +fn default_1441() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1422() -> Integer { +fn default_1442() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1423() -> Integer { +fn default_1443() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1424() -> f64 { +fn default_1444() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1425() -> Integer { +fn default_1445() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1426() -> Integer { +fn default_1446() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1427() -> Integer { +fn default_1447() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1428() -> Integer { +fn default_1448() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1429() -> Integer { +fn default_1449() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1430() -> bool { +fn default_1450() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1431() -> String { +fn default_1451() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1432() -> String { +fn default_1452() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1433() -> String { +fn default_1453() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1434() -> String { +fn default_1454() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1435() -> String { +fn default_1455() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1436() -> String { +fn default_1456() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1437() -> bool { +fn default_1457() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1438() -> String { +fn default_1458() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1439() -> Option { +fn default_1459() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1440() -> String { +fn default_1460() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1441() -> String { +fn default_1461() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1442() -> Vec { +fn default_1462() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1443() -> Option { +fn default_1463() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1444() -> bool { +fn default_1464() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1445() -> String { +fn default_1465() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1446() -> String { +fn default_1466() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1447() -> Vec { +fn default_1467() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1448() -> String { +fn default_1468() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1449() -> Vec { +fn default_1469() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1450() -> String { +fn default_1470() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1451() -> String { +fn default_1471() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1452() -> Vec { +fn default_1472() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1453() -> Vec { +fn default_1473() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1454() -> Integer { +fn default_1474() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1455() -> Vec { +fn default_1475() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1456() -> Vec { +fn default_1476() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1457() -> String { +fn default_1477() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1458() -> String { +fn default_1478() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1459() -> bool { +fn default_1479() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1460() -> String { +fn default_1480() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1461() -> String { +fn default_1481() -> String { serde_json::from_str("\"fact\"").expect("schema default") } -fn default_1462() -> String { +fn default_1482() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1463() -> bool { +fn default_1483() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1464() -> String { +fn default_1484() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1465() -> String { +fn default_1485() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1466() -> String { +fn default_1486() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1467() -> Vec { +fn default_1487() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1468() -> Vec { +fn default_1488() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1469() -> Vec { +fn default_1489() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1470() -> std::collections::HashMap { +fn default_1490() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1471() -> Vec { +fn default_1491() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1472() -> Integer { +fn default_1492() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1473() -> Vec { +fn default_1493() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1474() -> Integer { +fn default_1494() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1475() -> Integer { +fn default_1495() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1476() -> Integer { +fn default_1496() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1477() -> Integer { +fn default_1497() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1478() -> Integer { +fn default_1498() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1479() -> Integer { +fn default_1499() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1480() -> Integer { +fn default_1500() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1481() -> String { +fn default_1501() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1482() -> String { +fn default_1502() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1483() -> String { +fn default_1503() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1484() -> String { +fn default_1504() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1485() -> bool { +fn default_1505() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1486() -> Integer { +fn default_1506() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1487() -> Integer { +fn default_1507() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1488() -> Integer { +fn default_1508() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1489() -> Integer { +fn default_1509() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1490() -> Integer { +fn default_1510() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1491() -> bool { +fn default_1511() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1492() -> Vec { +fn default_1512() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1493() -> String { +fn default_1513() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1494() -> String { +fn default_1514() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1495() -> Option { +fn default_1515() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1496() -> Vec { +fn default_1516() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1497() -> bool { +fn default_1517() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1498() -> bool { +fn default_1518() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1499() -> Vec { +fn default_1519() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1500() -> bool { +fn default_1520() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1501() -> Option { +fn default_1521() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1502() -> Vec { +fn default_1522() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1503() -> Option { +fn default_1523() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1504() -> Option { +fn default_1524() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1505() -> Vec { +fn default_1525() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1506() -> Integer { +fn default_1526() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1507() -> bool { +fn default_1527() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1508() -> String { +fn default_1528() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1509() -> Integer { +fn default_1529() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1510() -> Integer { +fn default_1530() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1511() -> std::collections::HashMap { +fn default_1531() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1512() -> String { +fn default_1532() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1513() -> f64 { +fn default_1533() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1514() -> bool { +fn default_1534() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1515() -> String { +fn default_1535() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1516() -> String { +fn default_1536() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1517() -> Integer { +fn default_1537() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1518() -> Integer { +fn default_1538() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1519() -> Option { +fn default_1539() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1520() -> Vec { +fn default_1540() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1521() -> Vec { +fn default_1541() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1522() -> Option { +fn default_1542() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1523() -> Option { +fn default_1543() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1524() -> Integer { +fn default_1544() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1525() -> bool { +fn default_1545() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1526() -> String { +fn default_1546() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1527() -> String { +fn default_1547() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1528() -> String { +fn default_1548() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1529() -> String { +fn default_1549() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1530() -> Option { +fn default_1550() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1531() -> String { +fn default_1551() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1532() -> Integer { +fn default_1552() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1533() -> Integer { +fn default_1553() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1534() -> String { +fn default_1554() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1535() -> Vec { +fn default_1555() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1536() -> bool { +fn default_1556() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1537() -> Integer { +fn default_1557() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1538() -> Integer { +fn default_1558() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1539() -> Integer { +fn default_1559() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1540() -> Integer { +fn default_1560() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1541() -> Integer { +fn default_1561() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1542() -> String { +fn default_1562() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1543() -> String { +fn default_1563() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1544() -> String { +fn default_1564() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1545() -> String { +fn default_1565() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1546() -> Vec { +fn default_1566() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1547() -> Integer { +fn default_1567() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1548() -> Integer { +fn default_1568() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1549() -> String { +fn default_1569() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1550() -> String { +fn default_1570() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1551() -> Vec { +fn default_1571() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1552() -> String { +fn default_1572() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1553() -> String { +fn default_1573() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1554() -> Vec { +fn default_1574() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1555() -> Vec { +fn default_1575() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1556() -> String { +fn default_1576() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1557() -> String { +fn default_1577() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1558() -> Vec { +fn default_1578() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1559() -> f64 { +fn default_1579() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1560() -> String { +fn default_1580() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1561() -> String { +fn default_1581() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1562() -> Vec { +fn default_1582() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1563() -> bool { +fn default_1583() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1564() -> String { +fn default_1584() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1565() -> Integer { +fn default_1585() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1566() -> Vec { +fn default_1586() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1567() -> Vec { +fn default_1587() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1568() -> Vec { +fn default_1588() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1569() -> Vec { +fn default_1589() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1570() -> Vec { +fn default_1590() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1571() -> Option { +fn default_1591() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1572() -> Option { +fn default_1592() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1573() -> Vec { +fn default_1593() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1574() -> Integer { +fn default_1594() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1575() -> Integer { +fn default_1595() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1576() -> Vec { +fn default_1596() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1577() -> Vec { +fn default_1597() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1578() -> Integer { +fn default_1598() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1579() -> Integer { +fn default_1599() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1580() -> bool { +fn default_1600() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1581() -> Vec { +fn default_1601() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1582() -> f64 { +fn default_1602() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1583() -> bool { +fn default_1603() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1584() -> String { +fn default_1604() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1585() -> String { +fn default_1605() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1586() -> Option { +fn default_1606() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1587() -> String { +fn default_1607() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1588() -> String { +fn default_1608() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1589() -> String { +fn default_1609() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1590() -> String { +fn default_1610() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1591() -> MemoryForFileHitSupersedesKind { +fn default_1611() -> MemoryForFileHitSupersedesKind { serde_json::from_str("\"\"").expect("schema default") } -fn default_1592() -> Vec { +fn default_1612() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1593() -> String { +fn default_1613() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1594() -> MemoryForFileHitVerification { +fn default_1614() -> MemoryForFileHitVerification { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1595() -> MemoryForFileHitCodeState { +fn default_1615() -> MemoryForFileHitCodeState { serde_json::from_str("\"\"").expect("schema default") } -fn default_1596() -> Vec { +fn default_1616() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1597() -> String { +fn default_1617() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1598() -> Integer { +fn default_1618() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1599() -> bool { +fn default_1619() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1600() -> bool { +fn default_1620() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1601() -> Vec { +fn default_1621() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1602() -> String { +fn default_1622() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1603() -> String { +fn default_1623() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1604() -> String { +fn default_1624() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1605() -> String { +fn default_1625() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1606() -> String { +fn default_1626() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1607() -> String { +fn default_1627() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1608() -> Option { +fn default_1628() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1609() -> Value { +fn default_1629() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1610() -> Option { +fn default_1630() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1611() -> Option { +fn default_1631() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1612() -> Option { +fn default_1632() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1613() -> Option { +fn default_1633() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1614() -> Option { +fn default_1634() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1615() -> Option { +fn default_1635() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1616() -> bool { +fn default_1636() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1617() -> String { +fn default_1637() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1618() -> String { +fn default_1638() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1619() -> Option { +fn default_1639() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1620() -> String { +fn default_1640() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1621() -> String { +fn default_1641() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1622() -> String { +fn default_1642() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1623() -> String { +fn default_1643() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1624() -> String { +fn default_1644() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1625() -> String { +fn default_1645() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1626() -> Option { +fn default_1646() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1627() -> String { +fn default_1647() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1628() -> String { +fn default_1648() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1629() -> String { +fn default_1649() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1630() -> Integer { +fn default_1650() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1631() -> Vec { +fn default_1651() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1632() -> Integer { +fn default_1652() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1633() -> Option { +fn default_1653() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1634() -> Vec { +fn default_1654() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1635() -> std::collections::HashMap { +fn default_1655() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1636() -> Integer { +fn default_1656() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1637() -> f64 { +fn default_1657() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1638() -> Integer { +fn default_1658() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1639() -> Integer { +fn default_1659() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1640() -> Integer { +fn default_1660() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1641() -> Integer { +fn default_1661() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1642() -> Integer { +fn default_1662() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1643() -> MemoryHealthStaleness { +fn default_1663() -> 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_1644() -> Integer { +fn default_1664() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1645() -> Integer { +fn default_1665() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1646() -> f64 { +fn default_1666() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1647() -> MemoryHealthFootprint { +fn default_1667() -> MemoryHealthFootprint { serde_json::from_str("{\"value_chars\":0,\"value_tokens_est\":0,\"tokens_per_row_est\":0.0}") .expect("schema default") } -fn default_1648() -> String { +fn default_1668() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1649() -> Value { +fn default_1669() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1650() -> String { +fn default_1670() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1651() -> bool { +fn default_1671() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1652() -> Option { +fn default_1672() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1653() -> Option { +fn default_1673() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1654() -> Option { +fn default_1674() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1655() -> String { +fn default_1675() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1656() -> String { +fn default_1676() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1657() -> String { +fn default_1677() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1658() -> String { +fn default_1678() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1659() -> String { +fn default_1679() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1660() -> Option { +fn default_1680() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1661() -> String { +fn default_1681() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1662() -> Vec { +fn default_1682() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1663() -> Vec { +fn default_1683() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1664() -> Option { +fn default_1684() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1665() -> String { +fn default_1685() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1666() -> String { +fn default_1686() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1667() -> String { +fn default_1687() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1668() -> String { +fn default_1688() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1669() -> Option { +fn default_1689() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1670() -> Integer { +fn default_1690() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1671() -> Integer { +fn default_1691() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1672() -> Integer { +fn default_1692() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1673() -> Integer { +fn default_1693() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1674() -> MemoryImportResultReason { +fn default_1694() -> MemoryImportResultReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_1675() -> String { +fn default_1695() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1676() -> MemoryImportResultNote { +fn default_1696() -> MemoryImportResultNote { serde_json::from_str("\"\"").expect("schema default") } -fn default_1677() -> bool { +fn default_1697() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1678() -> String { +fn default_1698() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1679() -> Option { +fn default_1699() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1680() -> Integer { +fn default_1700() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1681() -> Integer { +fn default_1701() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1682() -> Integer { +fn default_1702() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1683() -> String { +fn default_1703() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1684() -> Integer { +fn default_1704() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1685() -> Vec { +fn default_1705() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1686() -> Integer { +fn default_1706() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1687() -> Integer { +fn default_1707() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1688() -> Vec { +fn default_1708() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1689() -> Integer { +fn default_1709() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1690() -> Vec { +fn default_1710() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1691() -> Vec { +fn default_1711() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1692() -> Vec { +fn default_1712() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1693() -> Vec { +fn default_1713() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1694() -> Vec { +fn default_1714() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1695() -> Option { +fn default_1715() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1696() -> Option { +fn default_1716() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1697() -> String { +fn default_1717() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1698() -> Integer { +fn default_1718() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1699() -> String { +fn default_1719() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1700() -> Vec { +fn default_1720() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1701() -> bool { +fn default_1721() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1702() -> Vec { +fn default_1722() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1703() -> Option { +fn default_1723() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1704() -> Option { +fn default_1724() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1705() -> String { +fn default_1725() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1706() -> Integer { +fn default_1726() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1707() -> String { +fn default_1727() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1708() -> Integer { +fn default_1728() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1709() -> Option { +fn default_1729() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1710() -> String { +fn default_1730() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1711() -> String { +fn default_1731() -> 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_1712() -> Vec { +fn default_1732() -> Vec { serde_json::from_str("[\"memory.set_from_messages\",\"extraction_instructions\"]") .expect("schema default") } -fn default_1713() -> Vec { +fn default_1733() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1714() -> bool { +fn default_1734() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1715() -> String { +fn default_1735() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1716() -> String { +fn default_1736() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1717() -> Option { +fn default_1737() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1718() -> String { +fn default_1738() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1719() -> String { +fn default_1739() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1720() -> String { +fn default_1740() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1721() -> MemoryLineageOutputMechanism { +fn default_1741() -> MemoryLineageOutputMechanism { serde_json::from_str("\"unknown\"").expect("schema default") } -fn default_1722() -> Vec { +fn default_1742() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1723() -> String { +fn default_1743() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1724() -> String { +fn default_1744() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1725() -> Option { +fn default_1745() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1726() -> Vec { +fn default_1746() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1727() -> f64 { +fn default_1747() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1728() -> bool { +fn default_1748() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1729() -> bool { +fn default_1749() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1730() -> Integer { +fn default_1750() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1731() -> Integer { +fn default_1751() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1732() -> String { +fn default_1752() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1733() -> bool { +fn default_1753() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1734() -> Integer { +fn default_1754() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1735() -> String { +fn default_1755() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1736() -> String { +fn default_1756() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1737() -> String { +fn default_1757() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1738() -> Option { +fn default_1758() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1739() -> String { +fn default_1759() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1740() -> Option { +fn default_1760() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1741() -> String { +fn default_1761() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1742() -> String { +fn default_1762() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1743() -> String { +fn default_1763() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1744() -> Integer { +fn default_1764() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1745() -> String { +fn default_1765() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1746() -> Vec { +fn default_1766() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1747() -> bool { +fn default_1767() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1748() -> String { +fn default_1768() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1749() -> String { +fn default_1769() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1750() -> String { +fn default_1770() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1751() -> bool { +fn default_1771() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1752() -> std::collections::HashMap { +fn default_1772() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1753() -> String { +fn default_1773() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1754() -> String { +fn default_1774() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1755() -> Integer { +fn default_1775() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1756() -> Integer { +fn default_1776() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1757() -> Vec { +fn default_1777() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1758() -> Integer { +fn default_1778() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1759() -> Integer { +fn default_1779() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1760() -> Vec { +fn default_1780() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1761() -> String { +fn default_1781() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1762() -> Integer { +fn default_1782() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1763() -> String { +fn default_1783() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1764() -> Vec { +fn default_1784() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1765() -> Integer { +fn default_1785() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1766() -> Option { +fn default_1786() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1767() -> Vec { +fn default_1787() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1768() -> Integer { +fn default_1788() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1769() -> String { +fn default_1789() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1770() -> String { +fn default_1790() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1771() -> Vec { +fn default_1791() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1772() -> String { +fn default_1792() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1773() -> String { +fn default_1793() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1774() -> String { +fn default_1794() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1775() -> String { +fn default_1795() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1776() -> String { +fn default_1796() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1777() -> Vec { +fn default_1797() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1778() -> String { +fn default_1798() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1779() -> Integer { +fn default_1799() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1780() -> Integer { +fn default_1800() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1781() -> String { +fn default_1801() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1782() -> Integer { +fn default_1802() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1783() -> Integer { +fn default_1803() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1784() -> MemoryProposalReady { +fn default_1804() -> MemoryProposalReady { serde_json::from_str("\"\"").expect("schema default") } -fn default_1785() -> Vec { +fn default_1805() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1786() -> Vec { +fn default_1806() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1787() -> Integer { +fn default_1807() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1788() -> ProposalPolicyMode { +fn default_1808() -> ProposalPolicyMode { serde_json::from_str("\"manual\"").expect("schema default") } -fn default_1789() -> Integer { +fn default_1809() -> Integer { serde_json::from_str("2").expect("schema default") } -fn default_1790() -> Integer { +fn default_1810() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1791() -> Integer { +fn default_1811() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1792() -> ProposalPolicy { +fn default_1812() -> ProposalPolicy { serde_json::from_str( "{\"mode\":\"manual\",\"min_passes\":2,\"max_fails\":0,\"reject_after_fails\":0}", ) .expect("schema default") } -fn default_1793() -> String { +fn default_1813() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1794() -> String { +fn default_1814() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1795() -> String { +fn default_1815() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1796() -> String { +fn default_1816() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1797() -> String { +fn default_1817() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1798() -> String { +fn default_1818() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1799() -> bool { +fn default_1819() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1800() -> String { +fn default_1820() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1801() -> String { +fn default_1821() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1802() -> String { +fn default_1822() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1803() -> String { +fn default_1823() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1804() -> String { +fn default_1824() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1805() -> String { +fn default_1825() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1806() -> String { +fn default_1826() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1807() -> String { +fn default_1827() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1808() -> String { +fn default_1828() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1809() -> Vec { +fn default_1829() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1810() -> f64 { +fn default_1830() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1811() -> String { +fn default_1831() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1812() -> String { +fn default_1832() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1813() -> Vec { +fn default_1833() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1814() -> String { +fn default_1834() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1815() -> String { +fn default_1835() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1816() -> String { +fn default_1836() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1817() -> String { +fn default_1837() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1818() -> bool { +fn default_1838() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1819() -> Integer { +fn default_1839() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1820() -> Integer { +fn default_1840() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1821() -> Integer { +fn default_1841() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1822() -> bool { +fn default_1842() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1823() -> String { +fn default_1843() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1824() -> Integer { +fn default_1844() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_1825() -> MemoryRecallOutputOrder { +fn default_1845() -> MemoryRecallOutputOrder { serde_json::from_str("\"recent\"").expect("schema default") } -fn default_1826() -> Vec { +fn default_1846() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1827() -> Integer { +fn default_1847() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1828() -> Value { +fn default_1848() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1829() -> Value { +fn default_1849() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1830() -> String { +fn default_1850() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1831() -> String { +fn default_1851() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1832() -> Option { +fn default_1852() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1833() -> Option { +fn default_1853() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1834() -> bool { +fn default_1854() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1835() -> String { +fn default_1855() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1836() -> String { +fn default_1856() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1837() -> std::collections::HashMap { +fn default_1857() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1838() -> std::collections::HashMap { +fn default_1858() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1839() -> MemoryRecordRowStatus { +fn default_1859() -> MemoryRecordRowStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1840() -> Option { +fn default_1860() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1841() -> Option { +fn default_1861() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1842() -> bool { +fn default_1862() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1843() -> String { +fn default_1863() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1844() -> MemoryRecordWriteOutputKeySource { +fn default_1864() -> MemoryRecordWriteOutputKeySource { serde_json::from_str("\"anonymous\"").expect("schema default") } -fn default_1845() -> std::collections::HashMap { +fn default_1865() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1846() -> String { +fn default_1866() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1847() -> Integer { +fn default_1867() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1848() -> bool { +fn default_1868() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1849() -> Option { +fn default_1869() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1850() -> Integer { +fn default_1870() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1851() -> Integer { +fn default_1871() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1852() -> Option { +fn default_1872() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1853() -> String { +fn default_1873() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1854() -> Integer { +fn default_1874() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1855() -> Integer { +fn default_1875() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1856() -> bool { +fn default_1876() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1857() -> Vec { +fn default_1877() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1858() -> Option { +fn default_1878() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1859() -> Option { +fn default_1879() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1860() -> bool { +fn default_1880() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1861() -> bool { +fn default_1881() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1862() -> String { +fn default_1882() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1863() -> f64 { +fn default_1883() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1864() -> String { +fn default_1884() -> String { serde_json::from_str("\"fact\"").expect("schema default") } -fn default_1865() -> String { +fn default_1885() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1866() -> std::collections::HashMap { +fn default_1886() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1867() -> bool { +fn default_1887() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1868() -> Integer { +fn default_1888() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1869() -> String { +fn default_1889() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1870() -> Vec { +fn default_1890() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1871() -> Vec { +fn default_1891() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1872() -> Integer { +fn default_1892() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1873() -> Integer { +fn default_1893() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1874() -> String { +fn default_1894() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1875() -> String { +fn default_1895() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1876() -> Integer { +fn default_1896() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_1877() -> Integer { +fn default_1897() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1878() -> Integer { +fn default_1898() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1879() -> Vec { +fn default_1899() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1880() -> Integer { +fn default_1900() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1881() -> Integer { +fn default_1901() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1882() -> Integer { +fn default_1902() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1883() -> Integer { +fn default_1903() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1884() -> Vec { +fn default_1904() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1885() -> String { +fn default_1905() -> String { serde_json::from_str("\"whole\"").expect("schema default") } -fn default_1886() -> Integer { +fn default_1906() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1887() -> Vec { +fn default_1907() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1888() -> Vec { +fn default_1908() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1889() -> Integer { +fn default_1909() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1890() -> Vec { +fn default_1910() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1891() -> Integer { +fn default_1911() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1892() -> Vec { +fn default_1912() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1893() -> Vec { +fn default_1913() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1894() -> bool { +fn default_1914() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1895() -> String { +fn default_1915() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1896() -> String { +fn default_1916() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1897() -> std::collections::HashMap { +fn default_1917() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1898() -> String { +fn default_1918() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1899() -> bool { +fn default_1919() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1900() -> Vec { +fn default_1920() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1901() -> Integer { +fn default_1921() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1902() -> Integer { +fn default_1922() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1903() -> String { +fn default_1923() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1904() -> String { +fn default_1924() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1905() -> String { +fn default_1925() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1906() -> bool { +fn default_1926() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1907() -> Integer { +fn default_1927() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1908() -> Option { +fn default_1928() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1909() -> String { +fn default_1929() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1910() -> String { +fn default_1930() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1911() -> String { +fn default_1931() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1912() -> Vec { +fn default_1932() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1913() -> Integer { +fn default_1933() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1914() -> Integer { +fn default_1934() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1915() -> Integer { +fn default_1935() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1916() -> Integer { +fn default_1936() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1917() -> Integer { +fn default_1937() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1918() -> Integer { +fn default_1938() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1919() -> bool { +fn default_1939() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1920() -> Vec> { +fn default_1940() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1921() -> Vec { +fn default_1941() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1922() -> Option { +fn default_1942() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1923() -> String { +fn default_1943() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1924() -> Integer { +fn default_1944() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1925() -> Option { +fn default_1945() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1926() -> Option { +fn default_1946() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1927() -> Option { +fn default_1947() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1928() -> Option { +fn default_1948() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1929() -> Vec { +fn default_1949() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1930() -> Integer { +fn default_1950() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1931() -> String { +fn default_1951() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1932() -> String { +fn default_1952() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1933() -> Option { +fn default_1953() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1934() -> String { +fn default_1954() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1935() -> String { +fn default_1955() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1936() -> String { +fn default_1956() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1937() -> String { +fn default_1957() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1938() -> Option { +fn default_1958() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1939() -> String { +fn default_1959() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1940() -> String { +fn default_1960() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1941() -> Integer { +fn default_1961() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1942() -> String { +fn default_1962() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1943() -> String { +fn default_1963() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1944() -> String { +fn default_1964() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1945() -> String { +fn default_1965() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1946() -> String { +fn default_1966() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1947() -> Integer { +fn default_1967() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1948() -> String { +fn default_1968() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1949() -> Vec { +fn default_1969() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1950() -> String { +fn default_1970() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1951() -> Integer { +fn default_1971() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1952() -> String { +fn default_1972() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1953() -> Integer { +fn default_1973() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1954() -> String { +fn default_1974() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1955() -> String { +fn default_1975() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1956() -> Integer { +fn default_1976() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1957() -> String { +fn default_1977() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1958() -> bool { +fn default_1978() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1959() -> String { +fn default_1979() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1960() -> String { +fn default_1980() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1961() -> String { +fn default_1981() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1962() -> String { +fn default_1982() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1963() -> Option { +fn default_1983() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1964() -> String { +fn default_1984() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1965() -> Integer { +fn default_1985() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1966() -> String { +fn default_1986() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1967() -> String { +fn default_1987() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1968() -> String { +fn default_1988() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1969() -> bool { +fn default_1989() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1970() -> Vec { +fn default_1990() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1971() -> std::collections::HashMap { +fn default_1991() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1972() -> String { +fn default_1992() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1973() -> Vec { +fn default_1993() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1974() -> std::collections::HashMap { +fn default_1994() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1975() -> Integer { +fn default_1995() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1976() -> Option { +fn default_1996() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1977() -> String { +fn default_1997() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1978() -> bool { +fn default_1998() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1979() -> Vec { +fn default_1999() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1980() -> Vec { +fn default_2000() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1981() -> std::collections::HashMap { +fn default_2001() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1982() -> Option { +fn default_2002() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1983() -> Vec { +fn default_2003() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1984() -> Integer { +fn default_2004() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1985() -> Integer { +fn default_2005() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1986() -> Vec { +fn default_2006() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1987() -> Option { +fn default_2007() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1988() -> Vec { +fn default_2008() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1989() -> Option { +fn default_2009() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1990() -> Option { +fn default_2010() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1991() -> Vec { +fn default_2011() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1992() -> bool { +fn default_2012() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1993() -> Vec { +fn default_2013() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1994() -> bool { +fn default_2014() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1995() -> Integer { +fn default_2015() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1996() -> Integer { +fn default_2016() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1997() -> Integer { +fn default_2017() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1998() -> Integer { +fn default_2018() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1999() -> Integer { +fn default_2019() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2000() -> Integer { +fn default_2020() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2001() -> Integer { +fn default_2021() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2002() -> Integer { +fn default_2022() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2003() -> Integer { +fn default_2023() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2004() -> f64 { +fn default_2024() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2005() -> Integer { +fn default_2025() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2006() -> Integer { +fn default_2026() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2007() -> Integer { +fn default_2027() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2008() -> Integer { +fn default_2028() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2009() -> Option { +fn default_2029() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2010() -> Option { +fn default_2030() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2011() -> Vec { +fn default_2031() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2012() -> String { +fn default_2032() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2013() -> String { +fn default_2033() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2014() -> Integer { +fn default_2034() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2015() -> Vec> { +fn default_2035() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2016() -> Vec { +fn default_2036() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2017() -> String { +fn default_2037() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2018() -> bool { +fn default_2038() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2019() -> String { +fn default_2039() -> String { serde_json::from_str("\"approval\"").expect("schema default") } -fn default_2020() -> String { +fn default_2040() -> String { serde_json::from_str("\"public\"").expect("schema default") } -fn default_2021() -> BrowseEntryMyStatus { +fn default_2041() -> BrowseEntryMyStatus { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2022() -> String { +fn default_2042() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2023() -> String { +fn default_2043() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2024() -> String { +fn default_2044() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2025() -> Integer { +fn default_2045() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2026() -> String { +fn default_2046() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2027() -> Option { +fn default_2047() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2028() -> Option { +fn default_2048() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2029() -> Vec { +fn default_2049() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2030() -> Option { +fn default_2050() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2031() -> Option { +fn default_2051() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2032() -> Option { +fn default_2052() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2033() -> Option> { +fn default_2053() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2034() -> Option { +fn default_2054() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2035() -> Option { +fn default_2055() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2036() -> Option { +fn default_2056() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2037() -> Option { +fn default_2057() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2038() -> Option { +fn default_2058() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2039() -> Option { +fn default_2059() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2040() -> Option { +fn default_2060() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2041() -> Option { +fn default_2061() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2042() -> Option { +fn default_2062() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2043() -> Option { +fn default_2063() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2044() -> Option { +fn default_2064() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2045() -> Option { +fn default_2065() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2046() -> Option { +fn default_2066() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2047() -> Option { +fn default_2067() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2048() -> Option { +fn default_2068() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2049() -> Option> { +fn default_2069() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2050() -> Option { +fn default_2070() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2051() -> Option { +fn default_2071() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2052() -> Option { +fn default_2072() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2053() -> Option { +fn default_2073() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2054() -> Option { +fn default_2074() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2055() -> Option>> { +fn default_2075() -> Option>> { serde_json::from_str("null").expect("schema default") } -fn default_2056() -> Option { +fn default_2076() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2057() -> Option { +fn default_2077() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2058() -> Option { +fn default_2078() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2059() -> Option { +fn default_2079() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2060() -> Option { +fn default_2080() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2061() -> Integer { +fn default_2081() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2062() -> String { +fn default_2082() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2063() -> String { +fn default_2083() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2064() -> String { +fn default_2084() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2065() -> String { +fn default_2085() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2066() -> Option { +fn default_2086() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2067() -> bool { +fn default_2087() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2068() -> Integer { +fn default_2088() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2069() -> String { +fn default_2089() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2070() -> String { +fn default_2090() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2071() -> String { +fn default_2091() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2072() -> String { +fn default_2092() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2073() -> Option { +fn default_2093() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2074() -> Option { +fn default_2094() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2075() -> String { +fn default_2095() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2076() -> Vec { +fn default_2096() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2077() -> String { +fn default_2097() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2078() -> String { +fn default_2098() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2079() -> Option { +fn default_2099() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2080() -> Vec { +fn default_2100() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2081() -> Option { +fn default_2101() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2082() -> String { +fn default_2102() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2083() -> bool { +fn default_2103() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2084() -> f64 { +fn default_2104() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2085() -> f64 { +fn default_2105() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2086() -> String { +fn default_2106() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2087() -> Option { +fn default_2107() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2088() -> Integer { +fn default_2108() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2089() -> Integer { +fn default_2109() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2090() -> NamespaceEntryVisibility { +fn default_2110() -> NamespaceEntryVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2091() -> String { +fn default_2111() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2092() -> Option { +fn default_2112() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2093() -> Option { +fn default_2113() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2094() -> Vec { +fn default_2114() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2095() -> MineEntryVisibility { +fn default_2115() -> MineEntryVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2096() -> String { +fn default_2116() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2097() -> String { +fn default_2117() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2098() -> String { +fn default_2118() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2099() -> Option { +fn default_2119() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2100() -> bool { +fn default_2120() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2101() -> bool { +fn default_2121() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2102() -> String { +fn default_2122() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2103() -> NamespaceRegisterOutputVisibility { +fn default_2123() -> NamespaceRegisterOutputVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2104() -> bool { +fn default_2124() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2105() -> Integer { +fn default_2125() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2106() -> Integer { +fn default_2126() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2107() -> bool { +fn default_2127() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2108() -> Vec> { +fn default_2128() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2109() -> Option { +fn default_2129() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2110() -> Option { +fn default_2130() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2111() -> Vec { +fn default_2131() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2112() -> Integer { +fn default_2132() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2113() -> String { +fn default_2133() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2114() -> String { +fn default_2134() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2115() -> String { +fn default_2135() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2116() -> String { +fn default_2136() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2117() -> String { +fn default_2137() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2118() -> Option { +fn default_2138() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2119() -> String { +fn default_2139() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2120() -> String { +fn default_2140() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2121() -> String { +fn default_2141() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2122() -> Vec { +fn default_2142() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2123() -> Option { +fn default_2143() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2124() -> Option { +fn default_2144() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2125() -> Option { +fn default_2145() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2126() -> Option { +fn default_2146() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2127() -> String { +fn default_2147() -> String { serde_json::from_str("\"{}\"").expect("schema default") } -fn default_2128() -> NamespaceSnapshotOutputSnapshotMemoryRowStatus { +fn default_2148() -> NamespaceSnapshotOutputSnapshotMemoryRowStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2129() -> Option { +fn default_2149() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2130() -> Vec { +fn default_2150() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2131() -> String { +fn default_2151() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2132() -> Integer { +fn default_2152() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2133() -> Integer { +fn default_2153() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2134() -> Option { +fn default_2154() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2135() -> String { +fn default_2155() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2136() -> String { +fn default_2156() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2137() -> String { +fn default_2157() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2138() -> String { +fn default_2158() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2139() -> Option { +fn default_2159() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2140() -> f64 { +fn default_2160() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2141() -> Option { +fn default_2161() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2142() -> Option { +fn default_2162() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2143() -> Integer { +fn default_2163() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2144() -> Option { +fn default_2164() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2145() -> Option { +fn default_2165() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2146() -> String { +fn default_2166() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2147() -> Option { +fn default_2167() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2148() -> String { +fn default_2168() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2149() -> String { +fn default_2169() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2150() -> String { +fn default_2170() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2151() -> Option { +fn default_2171() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2152() -> String { +fn default_2172() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2153() -> Option { +fn default_2173() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2154() -> String { +fn default_2174() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2155() -> String { +fn default_2175() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2156() -> Vec { +fn default_2176() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2157() -> Vec { +fn default_2177() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2158() -> Option { +fn default_2178() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2159() -> Integer { +fn default_2179() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2160() -> String { +fn default_2180() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2161() -> Vec { +fn default_2181() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2162() -> Vec { +fn default_2182() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2163() -> String { +fn default_2183() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2164() -> Option { +fn default_2184() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2165() -> Vec { +fn default_2185() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2166() -> Integer { +fn default_2186() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2167() -> Vec { +fn default_2187() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2168() -> Option { +fn default_2188() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2169() -> Vec { +fn default_2189() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2170() -> Vec { +fn default_2190() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2171() -> Option { +fn default_2191() -> Option { serde_json::from_str("0").expect("schema default") } -fn default_2172() -> TuneProposalEffect { +fn default_2192() -> TuneProposalEffect { serde_json::from_str("\"future\"").expect("schema default") } -fn default_2173() -> TuneApplyVia { +fn default_2193() -> TuneApplyVia { serde_json::from_str("\"op\"").expect("schema default") } -fn default_2174() -> bool { +fn default_2194() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2175() -> Vec { +fn default_2195() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2176() -> Option { +fn default_2196() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2177() -> Option { +fn default_2197() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2178() -> String { +fn default_2198() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2179() -> Vec { +fn default_2199() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2180() -> Vec { +fn default_2200() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2181() -> Option { +fn default_2201() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2182() -> Option { +fn default_2202() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2183() -> Option { +fn default_2203() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2184() -> String { +fn default_2204() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2185() -> Option { +fn default_2205() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2186() -> Option { +fn default_2206() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2187() -> Option { +fn default_2207() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2188() -> Vec { +fn default_2208() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2189() -> bool { +fn default_2209() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2190() -> Option { +fn default_2210() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2191() -> Option { +fn default_2211() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2192() -> Vec { +fn default_2212() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2193() -> String { +fn default_2213() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2194() -> String { +fn default_2214() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2195() -> Vec> { +fn default_2215() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2196() -> std::collections::HashMap { +fn default_2216() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2197() -> Vec { +fn default_2217() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2198() -> Integer { +fn default_2218() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2199() -> Integer { +fn default_2219() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2200() -> String { +fn default_2220() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2201() -> String { +fn default_2221() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2202() -> String { +fn default_2222() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2203() -> Vec { +fn default_2223() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2204() -> Vec { +fn default_2224() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2205() -> String { +fn default_2225() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2206() -> String { +fn default_2226() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2207() -> bool { +fn default_2227() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2208() -> Integer { +fn default_2228() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2209() -> String { +fn default_2229() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2210() -> String { +fn default_2230() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2211() -> String { +fn default_2231() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2212() -> String { +fn default_2232() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2213() -> Vec { +fn default_2233() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2214() -> String { +fn default_2234() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2215() -> String { +fn default_2235() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2216() -> std::collections::HashMap { +fn default_2236() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2217() -> String { +fn default_2237() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2218() -> Option { +fn default_2238() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2219() -> Option { +fn default_2239() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2220() -> bool { +fn default_2240() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2221() -> String { +fn default_2241() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2222() -> String { +fn default_2242() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2223() -> Vec { +fn default_2243() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2224() -> Integer { +fn default_2244() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2225() -> String { +fn default_2245() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2226() -> String { +fn default_2246() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2227() -> Option { +fn default_2247() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2228() -> bool { +fn default_2248() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2229() -> String { +fn default_2249() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2230() -> bool { +fn default_2250() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2231() -> String { +fn default_2251() -> String { serde_json::from_str("\"inherit\"").expect("schema default") } -fn default_2232() -> Option { +fn default_2252() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2233() -> Option { +fn default_2253() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2234() -> bool { +fn default_2254() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2235() -> Vec { +fn default_2255() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2236() -> Integer { +fn default_2256() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2237() -> ProcedureEvolveOutputGate { +fn default_2257() -> ProcedureEvolveOutputGate { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2238() -> String { +fn default_2258() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2239() -> f64 { +fn default_2259() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2240() -> std::collections::HashMap { +fn default_2260() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2241() -> std::collections::HashMap { +fn default_2261() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2242() -> std::collections::HashMap { +fn default_2262() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2243() -> std::collections::HashMap { +fn default_2263() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2244() -> String { +fn default_2264() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2245() -> Vec { +fn default_2265() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2246() -> Vec { +fn default_2266() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2247() -> Vec { +fn default_2267() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2248() -> std::collections::HashMap { +fn default_2268() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2249() -> Integer { +fn default_2269() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2250() -> bool { +fn default_2270() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2251() -> std::collections::HashMap { +fn default_2271() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2252() -> Vec { +fn default_2272() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2253() -> std::collections::HashMap { +fn default_2273() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2254() -> String { +fn default_2274() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2255() -> ProcedureLocateOutputStatus { +fn default_2275() -> ProcedureLocateOutputStatus { serde_json::from_str("\"authored\"").expect("schema default") } -fn default_2256() -> Option> { +fn default_2276() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2257() -> Vec>> { +fn default_2277() -> Vec>> { serde_json::from_str("[]").expect("schema default") } -fn default_2258() -> Vec { +fn default_2278() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2259() -> Vec { +fn default_2279() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2260() -> std::collections::HashMap { +fn default_2280() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2261() -> bool { +fn default_2281() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2262() -> Vec { +fn default_2282() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2263() -> Vec> { +fn default_2283() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2264() -> String { +fn default_2284() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2265() -> std::collections::HashMap { +fn default_2285() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2266() -> std::collections::HashMap { +fn default_2286() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2267() -> Vec { +fn default_2287() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2268() -> std::collections::HashMap { +fn default_2288() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2269() -> Option> { +fn default_2289() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2270() -> bool { +fn default_2290() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2271() -> std::collections::HashMap { +fn default_2291() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2272() -> ProcedureMatchStatus { +fn default_2292() -> ProcedureMatchStatus { serde_json::from_str("\"authored\"").expect("schema default") } -fn default_2273() -> Option> { +fn default_2293() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2274() -> Vec { +fn default_2294() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2275() -> Integer { +fn default_2295() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2276() -> Vec> { +fn default_2296() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2277() -> f64 { +fn default_2297() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2278() -> f64 { +fn default_2298() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2279() -> f64 { +fn default_2299() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2280() -> Option { +fn default_2300() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2281() -> std::collections::HashMap { +fn default_2301() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2282() -> std::collections::HashMap> { +fn default_2302() -> std::collections::HashMap> { serde_json::from_str("{}").expect("schema default") } -fn default_2283() -> String { +fn default_2303() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2284() -> Integer { +fn default_2304() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2285() -> String { +fn default_2305() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2286() -> f64 { +fn default_2306() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2287() -> Vec { +fn default_2307() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2288() -> ProcedureReviseOutputOutcome { +fn default_2308() -> ProcedureReviseOutputOutcome { serde_json::from_str("\"opened\"").expect("schema default") } -fn default_2289() -> Vec { +fn default_2309() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2290() -> Vec { +fn default_2310() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2291() -> String { +fn default_2311() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2292() -> String { +fn default_2312() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2293() -> String { +fn default_2313() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2294() -> String { +fn default_2314() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2295() -> Option { +fn default_2315() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2296() -> Integer { +fn default_2316() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2297() -> Vec { +fn default_2317() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2298() -> std::collections::HashMap { +fn default_2318() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2299() -> Option { +fn default_2319() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2300() -> String { +fn default_2320() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2301() -> Integer { +fn default_2321() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2302() -> String { +fn default_2322() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2303() -> String { +fn default_2323() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2304() -> std::collections::HashMap { +fn default_2324() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2305() -> String { +fn default_2325() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2306() -> String { +fn default_2326() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2307() -> Option { +fn default_2327() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2308() -> RunBeginOutputStatus { +fn default_2328() -> RunBeginOutputStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2309() -> String { +fn default_2329() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2310() -> Integer { +fn default_2330() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2311() -> Integer { +fn default_2331() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2312() -> Integer { +fn default_2332() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2313() -> Vec { +fn default_2333() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2314() -> Integer { +fn default_2334() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_2315() -> Integer { +fn default_2335() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2316() -> Integer { +fn default_2336() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2317() -> String { +fn default_2337() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2318() -> String { +fn default_2338() -> String { serde_json::from_str("\"keep\"").expect("schema default") } -fn default_2319() -> Integer { +fn default_2339() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2320() -> Integer { +fn default_2340() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2321() -> Integer { +fn default_2341() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2322() -> Option { +fn default_2342() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2323() -> Integer { +fn default_2343() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_2324() -> Vec { +fn default_2344() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2325() -> Vec { +fn default_2345() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2326() -> Integer { +fn default_2346() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2327() -> Integer { +fn default_2347() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2328() -> Integer { +fn default_2348() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2329() -> f64 { +fn default_2349() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2330() -> Integer { +fn default_2350() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2331() -> Vec { +fn default_2351() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2332() -> Integer { +fn default_2352() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2333() -> Vec { +fn default_2353() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2334() -> Integer { +fn default_2354() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2335() -> Integer { +fn default_2355() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2336() -> Integer { +fn default_2356() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2337() -> Vec { +fn default_2357() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2338() -> Option { +fn default_2358() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2339() -> Option> { +fn default_2359() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2340() -> LiveSearchResultsLive { +fn default_2360() -> LiveSearchResultsLive { serde_json::from_str("true").expect("schema default") } -fn default_2341() -> String { +fn default_2361() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2342() -> LiveSearchHitLive { +fn default_2362() -> LiveSearchHitLive { serde_json::from_str("true").expect("schema default") } -fn default_2343() -> Vec { +fn default_2363() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2344() -> Option { +fn default_2364() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2345() -> std::collections::HashMap { +fn default_2365() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2346() -> std::collections::HashMap { +fn default_2366() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2347() -> std::collections::HashMap { +fn default_2367() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2348() -> std::collections::HashMap { +fn default_2368() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2349() -> Option> { +fn default_2369() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2350() -> Vec { +fn default_2370() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2351() -> Integer { +fn default_2371() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2352() -> String { +fn default_2372() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2353() -> Integer { +fn default_2373() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2354() -> String { +fn default_2374() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2355() -> String { +fn default_2375() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2356() -> String { +fn default_2376() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2357() -> String { +fn default_2377() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2358() -> String { +fn default_2378() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2359() -> String { +fn default_2379() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2360() -> String { +fn default_2380() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2361() -> String { +fn default_2381() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2362() -> Vec { +fn default_2382() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2363() -> String { +fn default_2383() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2364() -> String { +fn default_2384() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2365() -> Vec { +fn default_2385() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2366() -> String { +fn default_2386() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2367() -> String { +fn default_2387() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2368() -> Vec { +fn default_2388() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2369() -> Vec { +fn default_2389() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2370() -> Vec { +fn default_2390() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2371() -> String { +fn default_2391() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2372() -> String { +fn default_2392() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2373() -> Vec { +fn default_2393() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2374() -> Vec { +fn default_2394() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2375() -> Vec { +fn default_2395() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2376() -> String { +fn default_2396() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2377() -> String { +fn default_2397() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2378() -> Option { +fn default_2398() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2379() -> String { +fn default_2399() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2380() -> String { +fn default_2400() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2381() -> String { +fn default_2401() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2382() -> String { +fn default_2402() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2383() -> String { +fn default_2403() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2384() -> String { +fn default_2404() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2385() -> Vec { +fn default_2405() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2386() -> Option { +fn default_2406() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2387() -> Integer { +fn default_2407() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2388() -> Integer { +fn default_2408() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2389() -> Integer { +fn default_2409() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2390() -> Integer { +fn default_2410() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2391() -> Integer { +fn default_2411() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2392() -> bool { +fn default_2412() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2393() -> String { +fn default_2413() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2394() -> String { +fn default_2414() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2395() -> String { +fn default_2415() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2396() -> String { +fn default_2416() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2397() -> String { +fn default_2417() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2398() -> String { +fn default_2418() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2399() -> String { +fn default_2419() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2400() -> Option { +fn default_2420() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2401() -> Integer { +fn default_2421() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2402() -> Integer { +fn default_2422() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2403() -> Vec { +fn default_2423() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2404() -> String { +fn default_2424() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2405() -> String { +fn default_2425() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2406() -> String { +fn default_2426() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2407() -> String { +fn default_2427() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2408() -> Integer { +fn default_2428() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2409() -> Integer { +fn default_2429() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2410() -> Integer { +fn default_2430() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2411() -> Integer { +fn default_2431() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2412() -> Integer { +fn default_2432() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2413() -> f64 { +fn default_2433() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2414() -> Integer { +fn default_2434() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2415() -> Integer { +fn default_2435() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2416() -> Integer { +fn default_2436() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2417() -> String { +fn default_2437() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2418() -> SessionBriefStats { +fn default_2438() -> 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_2419() -> String { +fn default_2439() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2420() -> String { +fn default_2440() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2421() -> Option { +fn default_2441() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2422() -> Option { +fn default_2442() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2423() -> Option { +fn default_2443() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2424() -> Integer { +fn default_2444() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2425() -> std::collections::HashMap { +fn default_2445() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2426() -> String { +fn default_2446() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2427() -> String { +fn default_2447() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2428() -> Option { +fn default_2448() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2429() -> String { +fn default_2449() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2430() -> Integer { +fn default_2450() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2431() -> Integer { +fn default_2451() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2432() -> Option { +fn default_2452() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2433() -> std::collections::HashMap { +fn default_2453() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2434() -> String { +fn default_2454() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2435() -> Integer { +fn default_2455() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2436() -> String { +fn default_2456() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2437() -> Option { +fn default_2457() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2438() -> String { +fn default_2458() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2439() -> Option { +fn default_2459() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2440() -> String { +fn default_2460() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2441() -> String { +fn default_2461() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2442() -> String { +fn default_2462() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2443() -> String { +fn default_2463() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2444() -> Integer { +fn default_2464() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2445() -> Integer { +fn default_2465() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2446() -> String { +fn default_2466() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2447() -> std::collections::HashMap { +fn default_2467() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2448() -> String { +fn default_2468() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2449() -> String { +fn default_2469() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2450() -> bool { +fn default_2470() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2451() -> String { +fn default_2471() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2452() -> std::collections::HashMap { +fn default_2472() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2453() -> Vec> { +fn default_2473() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2454() -> Vec { +fn default_2474() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2455() -> Vec { +fn default_2475() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2456() -> bool { +fn default_2476() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2457() -> String { +fn default_2477() -> String { serde_json::from_str("\"unknown\"").expect("schema default") } -fn default_2458() -> String { +fn default_2478() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2459() -> Vec { +fn default_2479() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2460() -> bool { +fn default_2480() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2461() -> String { +fn default_2481() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2462() -> bool { +fn default_2482() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2463() -> Vec { +fn default_2483() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2464() -> std::collections::HashMap { +fn default_2484() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2465() -> Vec> { +fn default_2485() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2466() -> bool { +fn default_2486() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2467() -> bool { +fn default_2487() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2468() -> Vec> { +fn default_2488() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2469() -> std::collections::HashMap { +fn default_2489() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2470() -> String { +fn default_2490() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2471() -> Vec> { +fn default_2491() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2472() -> bool { +fn default_2492() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2473() -> String { +fn default_2493() -> String { serde_json::from_str("\"calibrated\"").expect("schema default") } -fn default_2474() -> std::collections::HashMap { +fn default_2494() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2475() -> std::collections::HashMap { +fn default_2495() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2476() -> String { +fn default_2496() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2477() -> std::collections::HashMap { +fn default_2497() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2478() -> std::collections::HashMap { +fn default_2498() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2479() -> std::collections::HashMap { +fn default_2499() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2480() -> String { +fn default_2500() -> String { serde_json::from_str("\"ok\"").expect("schema default") } -fn default_2481() -> String { +fn default_2501() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2482() -> String { +fn default_2502() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2483() -> bool { +fn default_2503() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2484() -> Integer { +fn default_2504() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2485() -> String { +fn default_2505() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2486() -> String { +fn default_2506() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2487() -> Vec { +fn default_2507() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2488() -> bool { +fn default_2508() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2489() -> Vec { +fn default_2509() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2490() -> std::collections::HashMap> { +fn default_2510() -> std::collections::HashMap> { serde_json::from_str("{}").expect("schema default") } -fn default_2491() -> Vec> { +fn default_2511() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2492() -> Vec> { +fn default_2512() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2493() -> String { +fn default_2513() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2494() -> Vec> { +fn default_2514() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2495() -> std::collections::HashMap { +fn default_2515() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2496() -> String { +fn default_2516() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2497() -> Vec> { +fn default_2517() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2498() -> bool { +fn default_2518() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2499() -> Integer { +fn default_2519() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2500() -> Vec> { +fn default_2520() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2501() -> String { +fn default_2521() -> String { serde_json::from_str("\"no_flaky_signal\"").expect("schema default") } -fn default_2502() -> bool { +fn default_2522() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2503() -> Option> { +fn default_2523() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2504() -> Vec { +fn default_2524() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2505() -> bool { +fn default_2525() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2506() -> std::collections::HashMap { +fn default_2526() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2507() -> String { +fn default_2527() -> String { serde_json::from_str("\"not_computed\"").expect("schema default") } -fn default_2508() -> Vec> { +fn default_2528() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2509() -> String { +fn default_2529() -> String { serde_json::from_str("\"candidate\"").expect("schema default") } -fn default_2510() -> std::collections::HashMap { +fn default_2530() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2511() -> String { +fn default_2531() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2512() -> bool { +fn default_2532() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2513() -> Integer { +fn default_2533() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2514() -> std::collections::HashMap { +fn default_2534() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2515() -> bool { +fn default_2535() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2516() -> Vec> { +fn default_2536() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2517() -> std::collections::HashMap { +fn default_2537() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2518() -> std::collections::HashMap { +fn default_2538() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2519() -> String { +fn default_2539() -> String { serde_json::from_str("\"lower_bound\"").expect("schema default") } -fn default_2520() -> bool { +fn default_2540() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2521() -> Vec { +fn default_2541() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2522() -> Vec> { +fn default_2542() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2523() -> std::collections::HashMap { +fn default_2543() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2524() -> Vec { +fn default_2544() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2525() -> String { +fn default_2545() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2526() -> bool { +fn default_2546() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2527() -> bool { +fn default_2547() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2528() -> std::collections::HashMap { +fn default_2548() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2529() -> String { +fn default_2549() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2530() -> bool { +fn default_2550() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2531() -> std::collections::HashMap { +fn default_2551() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2532() -> std::collections::HashMap { +fn default_2552() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2533() -> Vec> { +fn default_2553() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2534() -> Vec { +fn default_2554() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2535() -> std::collections::HashMap { +fn default_2555() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2536() -> Vec> { +fn default_2556() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2537() -> bool { +fn default_2557() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2538() -> bool { +fn default_2558() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2539() -> Vec { +fn default_2559() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2540() -> std::collections::HashMap { +fn default_2560() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2541() -> String { +fn default_2561() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2542() -> std::collections::HashMap { +fn default_2562() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2543() -> bool { +fn default_2563() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2544() -> bool { +fn default_2564() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2545() -> String { +fn default_2565() -> String { serde_json::from_str("\"no_signal\"").expect("schema default") } -fn default_2546() -> Vec { +fn default_2566() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2547() -> f64 { +fn default_2567() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2548() -> Integer { +fn default_2568() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2549() -> String { +fn default_2569() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2550() -> std::collections::HashMap { +fn default_2570() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2551() -> std::collections::HashMap { +fn default_2571() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2552() -> std::collections::HashMap { +fn default_2572() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2553() -> std::collections::HashMap { +fn default_2573() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2554() -> String { +fn default_2574() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2555() -> std::collections::HashMap { +fn default_2575() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2556() -> bool { +fn default_2576() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2557() -> std::collections::HashMap { +fn default_2577() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2558() -> std::collections::HashMap { +fn default_2578() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2559() -> std::collections::HashMap { +fn default_2579() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2560() -> std::collections::HashMap { +fn default_2580() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2561() -> String { +fn default_2581() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2562() -> Vec> { +fn default_2582() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2563() -> Integer { +fn default_2583() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2564() -> String { +fn default_2584() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2565() -> bool { +fn default_2585() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2566() -> String { +fn default_2586() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2567() -> Vec { +fn default_2587() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2568() -> bool { +fn default_2588() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2569() -> Vec { +fn default_2589() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2570() -> f64 { +fn default_2590() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2571() -> String { +fn default_2591() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2572() -> Integer { +fn default_2592() -> Integer { serde_json::from_str("4096").expect("schema default") } -fn default_2573() -> Integer { +fn default_2593() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2574() -> Option { +fn default_2594() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2575() -> f64 { +fn default_2595() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2576() -> Option { +fn default_2596() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2577() -> Vec { +fn default_2597() -> 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 78c3e6fcbaa..948ee619957 100644 --- a/sdk/rust/tests/registry_contracts.rs +++ b/sdk/rust/tests/registry_contracts.rs @@ -4622,6 +4622,81 @@ fn knowledge_gaps_draft() { assert!(encoded.is_object()); } #[test] +fn knowledge_reports_submit() { + let value: clickhouse_loom::KnowledgeReportsSubmitInput = serde_json::from_str( + "{\"org\":\"sample\",\"namespace\":\"sample\",\"kind\":\"missing\",\"problem\":\"sample\"}", + ) + .unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); + let value: clickhouse_loom::KnowledgeReportsSubmitOutput = + serde_json::from_str("{\"report_id\":\"sample\",\"state\":\"open\",\"version\":1}") + .unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); +} +#[test] +fn knowledge_reports_get() { + let value: clickhouse_loom::KnowledgeReportsGetInput = serde_json::from_str( + "{\"org\":\"sample\",\"namespace\":\"sample\",\"report_id\":\"sample\"}", + ) + .unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); + let value: clickhouse_loom::KnowledgeReportsGetOutput = + serde_json::from_str("{\"found\":false}").unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); + assert_eq!( + encoded["report"], + serde_json::from_str::("null").unwrap(), + "knowledge.reports.get:report" + ); +} +#[test] +fn knowledge_reports_list() { + let value: clickhouse_loom::KnowledgeReportsListInput = + 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::KnowledgeReportsListOutput = serde_json::from_str("{}").unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); + assert_eq!( + encoded["reports"], + serde_json::from_str::("[]").unwrap(), + "knowledge.reports.list:reports" + ); +} +#[test] +fn knowledge_reports_update() { + let value: clickhouse_loom::KnowledgeReportsUpdateInput = serde_json::from_str( + "{\"org\":\"sample\",\"namespace\":\"sample\",\"report_id\":\"sample\"}", + ) + .unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); + let value: clickhouse_loom::KnowledgeReportsUpdateOutput = + serde_json::from_str("{\"report_id\":\"sample\",\"state\":\"open\",\"version\":1}") + .unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); +} +#[test] +fn knowledge_reports_evidence() { + let value: clickhouse_loom::KnowledgeReportsEvidenceInput = serde_json::from_str( + "{\"org\":\"sample\",\"namespace\":\"sample\",\"report_id\":\"sample\",\"evidence\":[]}", + ) + .unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); + let value: clickhouse_loom::KnowledgeReportsEvidenceOutput = + serde_json::from_str("{\"report_id\":\"sample\",\"state\":\"open\",\"version\":1}") + .unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); +} +#[test] fn knowledge_query_history_add() { let value: clickhouse_loom::QueryHistoryAddInput = serde_json::from_str("{\"org\":\"sample\",\"namespace\":\"sample\",\"name\":\"sample\",\"host\":\"sample\",\"user\":\"sample\",\"password\":\"sample\",\"databases\":[]}").unwrap(); let encoded = serde_json::to_value(value).unwrap(); diff --git a/sdk/typescript/src/client.test.ts b/sdk/typescript/src/client.test.ts index 29151da440f..4c7959a511b 100644 --- a/sdk/typescript/src/client.test.ts +++ b/sdk/typescript/src/client.test.ts @@ -62,6 +62,44 @@ describe("LoomClient", () => { expect(sent[1].version).toBe(exact); }); + it("files and reads a report on a memory version above 2^53 exactly", async () => { + const exact = "1800000000000000001"; + const sent: Array> = []; + let stored = ""; + const fetch = async (url: string, init: RequestInit) => { + // Keep the version as text, as the server keeps it as an integer. + const raw = init.body as string; + sent.push(JSON.parse(raw)); + let body = `{"found":true,"memory_key":"k","version":${exact},"version_text":"${exact}"}`; + if (url.endsWith("/knowledge.reports.submit")) { + stored = /"target_version":"?(\d+)"?/.exec(raw)?.[1] ?? ""; + body = `{"report_id":"r1","state":"open","version":1}`; + } else if (url.endsWith("/knowledge.reports.get")) { + const changed = stored !== exact; + body = `{"found":true,"report":{"report_id":"r1","version":1,"kind":"outdated","state":"open","target_kind":"memory","target_key":"k","target_version":${stored},"target_version_text":"${stored}","target_changed":${changed},"reporter":"u","created_at":"2026-01-01T00:00:00Z","updated_at":"2026-01-01T00:00:00Z","problem":"p"}}`; + } + return new Response(body, { status: 200 }); + }; + const c = new LoomClient(new Transport({ baseUrl: "http://x", fetch })); + const scope = { org: "o", namespace: "n" }; + const got = await c.call("memory.get", { ...scope, agent: "a", memory_key: "k" }); + // The number the client parsed is already rounded; the text is exact. + expect(String(got.version)).not.toBe(exact); + await c.call("knowledge.reports.submit", { + ...scope, + agent: "a", + kind: "outdated", + target_kind: "memory", + target_key: "k", + target_version: got.version_text ?? "", + problem: "p", + }); + expect(sent[1].target_version).toBe(exact); + const read = await c.call("knowledge.reports.get", { ...scope, report_id: "r1" }); + expect(read.report?.target_version_text).toBe(exact); + expect(read.report?.target_changed).toBe(false); + }); + it("exposes every generated group as a property", () => { const { c } = client(); for (const g of new Set(OPS.map((o) => o.group))) { diff --git a/sdk/typescript/src/generated/ops.ts b/sdk/typescript/src/generated/ops.ts index 799a2581b40..a49b13bfc6a 100644 --- a/sdk/typescript/src/generated/ops.ts +++ b/sdk/typescript/src/generated/ops.ts @@ -4412,6 +4412,137 @@ export interface KnowledgeReadsOutput { reads?: Array>; } +export interface KnowledgeReportsEvidenceInput { + org: string; + namespace: string; + report_id: string; + /** References only, never copied text: gap:, reflection: or run:. */ + evidence: string[]; +} + +export interface KnowledgeReportsEvidenceOutput { + report_id: string; + state: "open" | "taken" | "needs_evidence" | "resolved" | "dismissed"; + version: number; +} + +export interface KnowledgeReportsGetInput { + org: string; + namespace: string; + report_id: string; +} + +export interface KnowledgeReportDetail { + report_id: string; + version: number; + kind: "missing" | "incorrect" | "outdated"; + state: "open" | "taken" | "needs_evidence" | "resolved" | "dismissed"; + target_kind?: "" | "memory" | "document"; + target_key?: string; + target_version?: number; + target_version_text?: string; + reporter: string; + assignee?: string; + created_at: string; // date-time + updated_at: string; // date-time + target_changed?: boolean; + problem: string; + suggested_correction?: string; + run_id?: string; + evidence?: string[]; + related?: string[]; + reason?: string; + resolution_revision?: string; + target_readable?: boolean; +} + +export interface KnowledgeReportsGetOutput { + found: boolean; + report?: KnowledgeReportDetail | null; +} + +export interface KnowledgeReportsListInput { + org: string; + namespace: string; + states?: Array<"open" | "taken" | "needs_evidence" | "resolved" | "dismissed">; + kinds?: Array<"missing" | "incorrect" | "outdated">; + target_kind?: "" | "memory" | "document"; + target_key?: string; + assignee?: string; + reporter?: string; + limit?: number; +} + +export interface KnowledgeReport { + report_id: string; + version: number; + kind: "missing" | "incorrect" | "outdated"; + state: "open" | "taken" | "needs_evidence" | "resolved" | "dismissed"; + target_kind?: "" | "memory" | "document"; + target_key?: string; + target_version?: number; + target_version_text?: string; + reporter: string; + assignee?: string; + created_at: string; // date-time + updated_at: string; // date-time +} + +export interface KnowledgeReportsListOutput { + reports?: KnowledgeReport[]; +} + +export interface KnowledgeReportsSubmitInput { + org: string; + namespace: string; + agent?: string; + user_id?: string; + session_id?: string; + /** The run that hit the problem. */ + run_id?: string; + kind: "missing" | "incorrect" | "outdated"; + /** memory or document; empty for a missing-knowledge report. */ + target_kind?: "" | "memory" | "document"; + /** The memory key, or the document's source URI. */ + target_key?: string; + /** The memory version or document revision you read; a decimal string keeps a memory version exact in JavaScript. */ + target_version?: number | string; + /** Hash of the content you read, when you have it. */ + target_sha256?: string; + /** What is wrong or missing. */ + problem: string; + suggested_correction?: string; + /** References only, never copied text: gap:, reflection: or run:. */ + evidence?: string[]; + /** Other report ids about the same problem. */ + related?: string[]; +} + +export interface KnowledgeReportsSubmitOutput { + report_id: string; + state: "open" | "taken" | "needs_evidence" | "resolved" | "dismissed"; + version: number; +} + +export interface KnowledgeReportsUpdateInput { + org: string; + namespace: string; + report_id: string; + action?: "take" | "release" | "request_evidence" | "resolve" | "dismiss" | "reopen" | null; + reason?: string; + resolution_revision?: string; + /** Report ids to link. */ + related?: string[]; + /** Refuse when the report changed since this version. */ + expected_version?: number | null; +} + +export interface KnowledgeReportsUpdateOutput { + report_id: string; + state: "open" | "taken" | "needs_evidence" | "resolved" | "dismissed"; + version: number; +} + export interface KnowledgeRestoreInput { org: string; namespace: string; @@ -10927,6 +11058,11 @@ export type OpName = | "knowledge.query_history.list" | "knowledge.query_history.remove" | "knowledge.reads" + | "knowledge.reports.evidence" + | "knowledge.reports.get" + | "knowledge.reports.list" + | "knowledge.reports.submit" + | "knowledge.reports.update" | "knowledge.restore" | "knowledge.search" | "knowledge.source.add" @@ -11309,6 +11445,11 @@ export interface OpMap { "knowledge.query_history.list": { input: KnowledgeQueryHistoryListInput; output: KnowledgeQueryHistoryListOutput }; "knowledge.query_history.remove": { input: KnowledgeQueryHistoryRemoveInput; output: KnowledgeQueryHistoryRemoveOutput }; "knowledge.reads": { input: KnowledgeReadsInput; output: KnowledgeReadsOutput }; + "knowledge.reports.evidence": { input: KnowledgeReportsEvidenceInput; output: KnowledgeReportsEvidenceOutput }; + "knowledge.reports.get": { input: KnowledgeReportsGetInput; output: KnowledgeReportsGetOutput }; + "knowledge.reports.list": { input: KnowledgeReportsListInput; output: KnowledgeReportsListOutput }; + "knowledge.reports.submit": { input: KnowledgeReportsSubmitInput; output: KnowledgeReportsSubmitOutput }; + "knowledge.reports.update": { input: KnowledgeReportsUpdateInput; output: KnowledgeReportsUpdateOutput }; "knowledge.restore": { input: KnowledgeRestoreInput; output: KnowledgeRestoreOutput }; "knowledge.search": { input: KnowledgeSearchInput; output: KnowledgeSearchOutput }; "knowledge.source.add": { input: KnowledgeSourceAddInput; output: KnowledgeSourceAddOutput }; @@ -11691,6 +11832,11 @@ export const OPS: readonly OpSpec[] = [ { name: "knowledge.query_history.list", group: "knowledge", method: "queryHistoryList", idempotent: true, role: "admin", maturity: "experimental", budgetP99Ms: 250, audit: false, readOnly: false }, { name: "knowledge.query_history.remove", group: "knowledge", method: "queryHistoryRemove", idempotent: true, role: "admin", maturity: "experimental", budgetP99Ms: 1000, audit: true, readOnly: false }, { name: "knowledge.reads", group: "knowledge", method: "reads", idempotent: true, role: "viewer", maturity: "experimental", budgetP99Ms: 500, audit: false, readOnly: true }, + { name: "knowledge.reports.evidence", group: "knowledge", method: "reportsEvidence", idempotent: false, role: "writer", maturity: "experimental", budgetP99Ms: 300, audit: false, readOnly: false }, + { name: "knowledge.reports.get", group: "knowledge", method: "reportsGet", idempotent: true, role: "viewer", maturity: "experimental", budgetP99Ms: 100, audit: false, readOnly: true }, + { name: "knowledge.reports.list", group: "knowledge", method: "reportsList", idempotent: true, role: "admin", maturity: "experimental", budgetP99Ms: 200, audit: false, readOnly: false }, + { name: "knowledge.reports.submit", group: "knowledge", method: "reportsSubmit", idempotent: true, role: "writer", maturity: "experimental", budgetP99Ms: 400, audit: false, readOnly: false }, + { name: "knowledge.reports.update", group: "knowledge", method: "reportsUpdate", idempotent: false, role: "admin", maturity: "experimental", budgetP99Ms: 300, audit: true, readOnly: false }, { name: "knowledge.restore", group: "knowledge", method: "restore", idempotent: true, role: "writer", maturity: "experimental", budgetP99Ms: 200, audit: true, readOnly: false }, { name: "knowledge.search", group: "knowledge", method: "search", idempotent: true, role: "viewer", maturity: "stable", budgetP99Ms: 250, audit: false, readOnly: true }, { name: "knowledge.source.add", group: "knowledge", method: "sourceAdd", idempotent: false, role: "writer", maturity: "experimental", budgetP99Ms: 60000, audit: true, readOnly: false }, @@ -11922,4 +12068,4 @@ export const OP_BY_NAME: Readonly> = Object.fromEntries( OPS.map((o) => [o.name, o]), ) as Readonly>; -export const GENERATED_OP_COUNT = 379; +export const GENERATED_OP_COUNT = 384; diff --git a/server/core/ratelimit.py b/server/core/ratelimit.py index 8951361253d..96b92b36764 100644 --- a/server/core/ratelimit.py +++ b/server/core/ratelimit.py @@ -94,6 +94,7 @@ "knowledge.list", "knowledge.outline", "knowledge.reads", + "knowledge.reports.get", "knowledge.source.inspect", "knowledge.source.list", "knowledge.source.parse_links", diff --git a/server/erasure/app/saga_steps.py b/server/erasure/app/saga_steps.py index 0058447ede1..c8d05965db7 100644 --- a/server/erasure/app/saga_steps.py +++ b/server/erasure/app/saga_steps.py @@ -143,6 +143,13 @@ async def _step_delete_search_misses_by_user(org: str, user_id: str) -> int: return n + await ledger_steps.delete_search_misses_by_user(org, spellings) +async def _step_delete_knowledge_reports_by_user(org: str, user_id: str) -> int: + """The reports the user filed, and the user's name on the reports they took.""" + return await ledger_steps.delete_knowledge_reports_by_user( + org, await folded_spellings(org, user_id) + ) + + async def _step_delete_code_links_by_user(org: str, user_id: str) -> int: """The user's code links, erased under the link worker's queue lease, which every cursor write is under: no pass then publishes a cursor it read before the erasure.""" @@ -289,6 +296,7 @@ async def _step_erase_blobs_by_ns(org: str, namespace: _NS) -> int: ("code_search_trace.delete", ledger_steps.delete_code_search_trace_by_namespace), ("search_misses.delete", ledger_steps.delete_search_misses_by_namespace), ("knowledge_gaps.delete", ledger_steps.delete_knowledge_gaps_by_namespace), + ("knowledge_reports.delete", ledger_steps.delete_knowledge_reports_by_namespace), ("events.delete", ledger_steps.delete_events_by_namespace), ("memory_drops.delete", ledger_steps.delete_memory_drops_by_namespace), ("delete_version_checks.delete", ledger_steps.delete_delete_version_checks_by_namespace), @@ -311,6 +319,7 @@ async def _step_erase_blobs_by_ns(org: str, namespace: _NS) -> int: ("memory_exposures.delete", ledger_steps.delete_memory_exposures_by_user), ("code_search_trace.delete", ledger_steps.delete_code_search_trace_by_user), ("search_misses.delete", _step_delete_search_misses_by_user), + ("knowledge_reports.delete", _step_delete_knowledge_reports_by_user), ("events.delete", ledger_steps.delete_events_by_user), ("delete_version_checks.delete", ledger_steps.delete_delete_version_checks_by_user), ("memory_webhook_outbox.delete", ledger_steps.delete_memory_webhook_outbox_by_user), diff --git a/server/erasure/store/census.py b/server/erasure/store/census.py index a5f3323c14d..2aa6b81bb5e 100644 --- a/server/erasure/store/census.py +++ b/server/erasure/store/census.py @@ -27,6 +27,7 @@ NS_EQ, ORPHAN_LEARNINGS, PAYLOAD_UID, + REPORT_PERSON, UID, USER_CHUNKS, USER_COMMUNITY_ROWS, @@ -329,6 +330,15 @@ def owner(self, scope_type: str) -> str | None: # A gap names no user, so the census counts it in the namespace scope only; the # user's search_misses.delete step also deletes the builds of the user's namespaces. Substrate("loom.knowledge_gaps", "1", None, "knowledge_gaps.delete", None), + # A report holds its reporter's words; the user scope also counts the reports the user + # took, until the step clears their name from them. + Substrate( + "loom.knowledge_reports", + "1", + REPORT_PERSON, + "knowledge_reports.delete", + "knowledge_reports.delete", + ), # When each mirrored source last listed, under its mirror's name: names and times. Substrate( "loom.knowledge_source_listings", "1", None, "knowledge_source_listings.delete", None diff --git a/server/erasure/store/predicates.py b/server/erasure/store/predicates.py index c2765b859a7..89d0eb517dc 100644 --- a/server/erasure/store/predicates.py +++ b/server/erasure/store/predicates.py @@ -186,6 +186,21 @@ MISS_ASKER = ( "(has({spellings:Array(String)}, asker) OR has({spellings:Array(String)}, lowerUTF8(user_id)))" ) +# A knowledge report the user filed, as its reporter or under their user id, under any of +# the user's spellings, compared as MISS_ASKER compares them. +REPORT_FILED = ( + "(has({spellings:Array(String)}, lowerUTF8(reporter))" + " OR has({spellings:Array(String)}, lowerUTF8(user_id)))" +) +# A knowledge report the user maintained: took it, wrote a version (`written_by`, the person +# its token stood for, folded as the reporter is: a service account's `actor` names the +# account, not its creator) or gave its reason or the resolution of a report with no target +# (`reason_by`). The report stays its reporter's. +REPORT_TAKEN = "has({spellings:Array(String)}, lowerUTF8(assignee))" +REPORT_REASON_BY = "has({spellings:Array(String)}, lowerUTF8(reason_by))" +REPORT_WRITER = "has({spellings:Array(String)}, lowerUTF8(written_by))" +REPORT_MAINTAINED = f"({REPORT_TAKEN} OR {REPORT_REASON_BY} OR {REPORT_WRITER})" +REPORT_PERSON = f"({REPORT_FILED} OR {REPORT_MAINTAINED})" # A projection failure's writer: its payload's identity (a bulk write's, a replay's), or # the identity of a retired row it owes the record of. PAYLOAD_UID = ( diff --git a/server/erasure/store/steps_ledgers.py b/server/erasure/store/steps_ledgers.py index a4ae59f1335..14263967e66 100644 --- a/server/erasure/store/steps_ledgers.py +++ b/server/erasure/store/steps_ledgers.py @@ -16,17 +16,28 @@ from server.core.lease_writes import fenced from server.core.repo_base import _CHClient, _default_client, query_all_sliced from server.erasure.store import mutations as erasure_mutations -from server.erasure.store.mutations import delete_scoped, namespaces_of, tombstone_scoped +from server.erasure.store.mutations import ( + count_then_mutate, + delete_scoped, + namespaces_of, + tombstone_scoped, +) from server.erasure.store.predicates import ( MISS_ASKER, NS_EQ, NS_IN, ORPHAN_LEARNINGS, PAYLOAD_UID, + REPORT_FILED, + REPORT_MAINTAINED, + REPORT_REASON_BY, + REPORT_TAKEN, + REPORT_WRITER, SUPPORTED_LEARNINGS, UID, ) from server.erasure.store.steps_pg import delete_pg_idempotency +from server.knowledge.domain.reports import writer_lease_name as report_writer_lease_name from server.knowledge.domain.source_push import writer_lease_name as push_writer_lease_name from server.observability import events_stream from server.observability.budget_notifications import writer_lease_name @@ -279,6 +290,58 @@ async def delete_knowledge_gaps_by_user( ) +# Knowledge reports: the reporter's words, and what a maintainer wrote on them. Each +# column is cleared only where it names the user; every assignment reads the old row. A +# target's resolution is a checked revision number and stays; one with no target is words. +_REPORT_SCRUB = ( + f"UPDATE assignee = if({REPORT_TAKEN}, '', assignee)," + f" reason = if({REPORT_REASON_BY}, '', reason)," + f" resolution_revision = if(target_kind = '' AND {REPORT_REASON_BY}, '', resolution_revision)," + f" reason_by = if({REPORT_REASON_BY}, '', reason_by)," + f" actor = if({REPORT_WRITER}, '', actor)," + f" written_by = if({REPORT_WRITER}, '', written_by)" +) + + +async def delete_knowledge_reports_by_user( + org: str, spellings: Sequence[str], *, ch: _CHClient | None = None +) -> int: + """Every version of the reports the user filed. On a report the user maintained, every + version loses the user's name as assignee or writer and the reason they gave; the + reporter's words stay. Runs inside the reports' write fence, after any write in flight.""" + params = {"spellings": list(spellings)} + where = f"org = {{org:String}} AND {REPORT_MAINTAINED}" + async with lease_writes.fenced(report_writer_lease_name(org), ch=ch) as uncertain: + uncertain(True) + n = await delete_scoped( + "loom.knowledge_reports", org=org, scope_where=REPORT_FILED, params=params, ch=ch + ) + n += await count_then_mutate( + "loom.knowledge_reports", + count_where=where, + mutation=_REPORT_SCRUB, + mutation_where=where, + params={"org": org, **params}, + final=False, + ch=ch, + ) + uncertain(False) + return n + + +async def delete_knowledge_reports_by_namespace( + org: str, namespace: str | Sequence[str], *, ch: _CHClient | None = None +) -> int: + """Runs inside the reports' write fence, after any write in flight.""" + async with lease_writes.fenced(report_writer_lease_name(org), ch=ch) as uncertain: + uncertain(True) + n = await delete_scoped( + "loom.knowledge_reports", org=org, scope_where=NS_EQ, params={"ns": namespace}, ch=ch + ) + uncertain(False) + return n + + async def delete_knowledge_gaps_by_namespace( org: str, namespace: str | Sequence[str], *, ch: _CHClient | None = None ) -> int: diff --git a/server/identity/domain/read_scope.py b/server/identity/domain/read_scope.py index 36db3b4d644..2e111d7ff03 100644 --- a/server/identity/domain/read_scope.py +++ b/server/identity/domain/read_scope.py @@ -506,8 +506,12 @@ def with_read_identity[M: BaseModel](input: M, scope: ReadFilters) -> M: # Ops under a NARROW_SAFE_OPS prefix that still refuse a narrowed token: a knowledge -# gap lists other people's questions. -NARROW_REFUSED_PREFIXES: tuple[str, ...] = ("knowledge.gaps.", "knowledge.query_history.") +# gap lists other people's questions, and a knowledge report holds other people's words. +NARROW_REFUSED_PREFIXES: tuple[str, ...] = ( + "knowledge.gaps.", + "knowledge.query_history.", + "knowledge.reports.", +) def honours_read_scope(op_name: str) -> bool: diff --git a/server/knowledge/api/models_reports.py b/server/knowledge/api/models_reports.py new file mode 100644 index 00000000000..1ff0ced35ad --- /dev/null +++ b/server/knowledge/api/models_reports.py @@ -0,0 +1,181 @@ +"""Wire models of `knowledge.reports.*`.""" + +from __future__ import annotations + +from datetime import datetime +from typing import Literal + +from pydantic import BaseModel, Field, field_validator, model_validator + +ReportKindWire = Literal["missing", "incorrect", "outdated"] +ReportStateWire = Literal["open", "taken", "needs_evidence", "resolved", "dismissed"] +TargetKindWire = Literal["", "memory", "document"] +ReportActionWire = Literal["take", "release", "request_evidence", "resolve", "dismiss", "reopen"] + +_EVIDENCE_HELP = "References only, never copied text: gap:, reflection: or run:." + + +class KnowledgeReportsSubmitInput(BaseModel): + """Report that a memory claim or a document passage is incorrect or outdated, or that + knowledge is missing. A report never edits its target: a maintainer reviews it and + resolves it with the revision that fixed the target, or dismisses it with a reason. + A retry with the same Idempotency-Key returns the same report.""" + + org: str + namespace: str + agent: str = "-" + user_id: str = "-" + session_id: str = "-" + run_id: str = Field(default="", max_length=128, description="The run that hit the problem.") + kind: ReportKindWire + target_kind: TargetKindWire = Field( + default="", description="memory or document; empty for a missing-knowledge report." + ) + target_key: str = Field( + default="", max_length=512, description="The memory key, or the document's source URI." + ) + # The column is UInt64: a larger number must fail here, not at the insert. A decimal + # string is accepted, as memory.delete_version's version: a memory version is a + # nanosecond timestamp above 2^53, which a JavaScript number rounds. + target_version: int | str = Field( + default=0, + description="The memory version or document revision you read; a decimal string" + " keeps a memory version exact in JavaScript.", + ) + target_sha256: str = Field( + default="", + pattern=r"^([0-9a-f]{64})?$", + description="Hash of the content you read, when you have it.", + ) + problem: str = Field(min_length=1, max_length=2000, description="What is wrong or missing.") + suggested_correction: str = Field(default="", max_length=4000) + evidence: list[str] = Field(default_factory=list, description=_EVIDENCE_HELP) + related: list[str] = Field( + default_factory=list, description="Other report ids about the same problem." + ) + + @field_validator("target_version") + @classmethod + def _decimal(cls, v: int | str) -> int: + if isinstance(v, str): + if not (v.isascii() and v.isdigit()): + raise ValueError("`target_version` is a version number") + v = int(v) + if not 0 <= v < 2**64: + raise ValueError("`target_version` is a version number") + return v + + +class KnowledgeReportsSubmitOutput(BaseModel): + report_id: str + state: ReportStateWire + version: int + + +class KnowledgeReportsGetInput(BaseModel): + """One report, with the problem, the suggested correction and the evidence, when you + can read its target.""" + + org: str + namespace: str + report_id: str = Field(min_length=1, max_length=64) + + +class KnowledgeReport(BaseModel): + report_id: str + version: int + kind: ReportKindWire + state: ReportStateWire + target_kind: TargetKindWire = "" + target_key: str = "" + target_version: int = 0 + # The same version as a decimal string, exact for a JavaScript caller (a memory + # version is above 2^53, which JSON.parse rounds). Set from `target_version`. + target_version_text: str = "" + reporter: str + assignee: str = "" + created_at: datetime + updated_at: datetime + + @model_validator(mode="after") + def _target_version_text(self) -> KnowledgeReport: + self.target_version_text = str(self.target_version) + return self + + +class KnowledgeReportDetail(KnowledgeReport): + # True when the target changed or was deleted since the report was filed. + target_changed: bool = False + problem: str + suggested_correction: str = "" + run_id: str = "" + evidence: list[str] = Field(default_factory=list) + related: list[str] = Field(default_factory=list) + reason: str = "" + resolution_revision: str = "" + # False when the caller cannot read the target now, or it is gone: a maintainer then + # sees the report without the problem and the correction. + target_readable: bool = True + + +class KnowledgeReportsGetOutput(BaseModel): + found: bool + report: KnowledgeReportDetail | None = None + + +class KnowledgeReportsListInput(BaseModel): + """The namespace's report queue for maintainers, newest change first. Rows carry no + problem text, correction or target state: open one with knowledge.reports.get.""" + + org: str + namespace: str + states: list[ReportStateWire] = Field(default_factory=list) + kinds: list[ReportKindWire] = Field(default_factory=list) + target_kind: TargetKindWire = "" + target_key: str = Field(default="", max_length=512) + assignee: str = Field(default="", max_length=256) + reporter: str = Field(default="", max_length=256) + limit: int = Field(default=50, ge=1, le=200) + + +class KnowledgeReportsListOutput(BaseModel): + reports: list[KnowledgeReport] = Field(default_factory=list) + + +class KnowledgeReportsUpdateInput(BaseModel): + """A maintainer takes, releases, asks for evidence on, resolves, dismisses or reopens + a report, or links related reports. dismiss, request_evidence and reopen need a + reason. resolve names the published revision that corrected the target.""" + + org: str + namespace: str + report_id: str = Field(min_length=1, max_length=64) + action: ReportActionWire | None = None + reason: str = Field(default="", max_length=2000) + resolution_revision: str = Field(default="", max_length=128) + related: list[str] = Field(default_factory=list, description="Report ids to link.") + expected_version: int | None = Field( + default=None, ge=1, description="Refuse when the report changed since this version." + ) + + +class KnowledgeReportsUpdateOutput(BaseModel): + report_id: str + state: ReportStateWire + version: int + + +class KnowledgeReportsEvidenceInput(BaseModel): + """The reporter adds evidence to their own report, for example after a maintainer + asked for it. The report goes back to its maintainer, or to the queue.""" + + org: str + namespace: str + report_id: str = Field(min_length=1, max_length=64) + evidence: list[str] = Field(min_length=1, description=_EVIDENCE_HELP) + + +class KnowledgeReportsEvidenceOutput(BaseModel): + report_id: str + state: ReportStateWire + version: int diff --git a/server/knowledge/api/ops_reports.py b/server/knowledge/api/ops_reports.py new file mode 100644 index 00000000000..7bd9794ef20 --- /dev/null +++ b/server/knowledge/api/ops_reports.py @@ -0,0 +1,87 @@ +"""The `knowledge.reports.*` operation declarations; their wire models are in +`models_reports`.""" + +from __future__ import annotations + +from server.knowledge.api.models_reports import ( + KnowledgeReportsEvidenceInput, + KnowledgeReportsEvidenceOutput, + KnowledgeReportsGetInput, + KnowledgeReportsGetOutput, + KnowledgeReportsListInput, + KnowledgeReportsListOutput, + KnowledgeReportsSubmitInput, + KnowledgeReportsSubmitOutput, + KnowledgeReportsUpdateInput, + KnowledgeReportsUpdateOutput, +) +from server.knowledge.app.reports import ( + handle_knowledge_reports_evidence, + handle_knowledge_reports_get, + handle_knowledge_reports_list, + handle_knowledge_reports_submit, + handle_knowledge_reports_update, +) +from server.operations.base import Operation, Role + +# Idempotent on (reporter, kind, target, problem): a retry files the same report. +knowledge_reports_submit = Operation( + name="knowledge.reports.submit", + maturity="experimental", + input_model=KnowledgeReportsSubmitInput, + output_model=KnowledgeReportsSubmitOutput, + handler=handle_knowledge_reports_submit, + idempotent=True, + required_role=Role.WRITER, +) + +# A reporter reads their own report; a maintainer reads any. +knowledge_reports_get = Operation( + name="knowledge.reports.get", + maturity="experimental", + input_model=KnowledgeReportsGetInput, + output_model=KnowledgeReportsGetOutput, + handler=handle_knowledge_reports_get, + idempotent=True, + required_role=Role.VIEWER, +) + +# Admin: the queue names other people's reports. +knowledge_reports_list = Operation( + name="knowledge.reports.list", + maturity="experimental", + input_model=KnowledgeReportsListInput, + output_model=KnowledgeReportsListOutput, + handler=handle_knowledge_reports_list, + idempotent=True, + required_role=Role.ADMIN, +) + +knowledge_reports_update = Operation( + name="knowledge.reports.update", + maturity="experimental", + input_model=KnowledgeReportsUpdateInput, + output_model=KnowledgeReportsUpdateOutput, + handler=handle_knowledge_reports_update, + idempotent=False, + required_role=Role.ADMIN, + audit=True, +) + +knowledge_reports_evidence = Operation( + name="knowledge.reports.evidence", + maturity="experimental", + input_model=KnowledgeReportsEvidenceInput, + output_model=KnowledgeReportsEvidenceOutput, + handler=handle_knowledge_reports_evidence, + idempotent=False, + required_role=Role.WRITER, +) + +OPERATIONS = [ + knowledge_reports_submit, + knowledge_reports_get, + knowledge_reports_list, + knowledge_reports_update, + knowledge_reports_evidence, +] diff --git a/server/knowledge/app/document_reads.py b/server/knowledge/app/document_reads.py index f4d0649361c..2d0113ffbf2 100644 --- a/server/knowledge/app/document_reads.py +++ b/server/knowledge/app/document_reads.py @@ -396,6 +396,24 @@ async def handle_knowledge_get(input: KnowledgeGetInput) -> KnowledgeGetOutput: ) +async def known_documents(org: str, namespace: str, source_uris: list[str]) -> set[str]: + """The source URIs among `source_uris` whose documents the caller may know of: the + namespace's own, deleted ones included, as `knowledge.get` serves them to every reader, + and mirrored copies the caller's access list admits now, read once for all of them + (`source_documents.admitted_uris`). No text is read or served.""" + from server.knowledge.app import source_access, source_documents + from server.knowledge.store import documents as documents_repo + + uris = list(dict.fromkeys(source_uris)) + plan = await source_access.prepare(org, [namespace]) + rows = await documents_repo.get_many_by_uris(org, namespace, uris, include_superseded=True) + known = {row.source_uri for row in rows} + rest = [uri for uri in uris if uri not in known] + if plan.marked and rest: + known |= await source_documents.admitted_uris(plan, namespace, rest) + return known + + async def ordinary_get(input: KnowledgeGetInput) -> KnowledgeGetOutput: """Read an ordinary document for mining without preparing a mirror leg.""" return _get_output(await _ordinary_get_row(input), input.source_uri) diff --git a/server/knowledge/app/gaps.py b/server/knowledge/app/gaps.py index b57663b65c8..e8f013b6c21 100644 --- a/server/knowledge/app/gaps.py +++ b/server/knowledge/app/gaps.py @@ -5,7 +5,7 @@ memory section abstained. A miss stores the query, so it is recorded only when the operator opted in (`knowledge_gaps_enabled`) and the request's capture level is not `off`, the answer the trace log reads for its query column (an unreadable consent reads as -`off`). The asker is the person the token stands for (`_asker`), never a body field, so +`off`). The asker is the person the token stands for (`token_person`), never a body field, so tokens a person mints for themselves count once. A user erasure deletes the misses whose asker or `user_id` is the user. """ @@ -24,6 +24,7 @@ KnowledgeGapsListOutput, _KnowledgeGap, ) +from server.knowledge.app.people import one_person, token_person from server.knowledge.domain.gaps import normalize_query from server.knowledge.store import gaps as gaps_store from server.memory.domain.sensitivity import detect_sensitivity, reads_high @@ -73,7 +74,7 @@ def record_miss( if settings.effective_identity_provider() == "single-user": # One identity for every caller: a gap, which needs several askers, never forms. return - asker, end_user = _asker() + asker, end_user = token_person() if not asker or not _capturing(): return normalized = normalize_query(query) @@ -131,7 +132,7 @@ async def _insert(row: dict[str, Any], started_s: int) -> None: unfinished at `started_s` or has finished since, and delete it if one starts before the row lands.""" try: - asker = await _person(row["org"], row["asker"]) + asker = await one_person(row["org"], row["asker"]) if not asker: return org, namespace = row["org"], row["namespace"] @@ -207,71 +208,6 @@ def _invoked(op: str) -> bool: return current_operation() == op -def _asker() -> tuple[str, str]: - """(asker, end user): the person the token stands for. The end user of an end-user - token; else the token's `creator` claim, the person at the root of a delegated token - or service account, so the tokens a person mints for themselves count once; else the - token's subject. ('', '') without a token.""" - from server.auth.context import current_auth - from server.core.principals import USER, principal_id - - auth = current_auth() - if auth is None: - return "", "" - end_user = principal_id(auth.subject, USER) - if end_user: - return end_user, end_user - root = auth.creator or auth.subject - return root or "", "" - - -async def _person(org: str, asker: str) -> str: - """The asker folded onto one spelling per person: a service account's creator, and a - human's spelling as the directory ties it (the login handle for a contact email), so - one person's two spellings count once and a user erasure finds them. '' when either - cannot be read.""" - from server.auth.aliases import login_handle - - asker = await _registered_creator(org, asker) - if not asker: - return "" - try: - folded = await login_handle(org, asker) - if folded is None: # tied to two accounts: not one person - return "" - return folded - except Exception as e: # noqa: BLE001 — an unreadable tie records no miss, never a guess - log.warning("knowledge gap asker not resolved: %s", type(e).__name__) - return "" - - -# Service accounts a creator chain may climb before it is treated as unresolved. -_MAX_CREATOR_HOPS = 8 # not a setting: a bound on a registry walk, not a deployment's capacity - - -async def _registered_creator(org: str, asker: str) -> str: - """The person behind a service account, for a token minted without the `creator` - claim: the first subject in its creator chain that is not a service account, as the - registry records it; any other asker as given. '' when the chain cannot be read, has - no person in it, or is longer than `_MAX_CREATOR_HOPS`: an unknown principal is - never counted as a separate person.""" - from server.auth.service_accounts import sa_creator - - subject = asker - for _ in range(_MAX_CREATOR_HOPS): - if not subject.startswith("sa:"): - return subject - creator = await sa_creator(org, subject) - if creator is None or not creator.subject: - return "" - if creator.kind == "agent": - # An agent sign-up: the namespace made its own account, and no person stands - # behind it. - return "" - subject = creator.subject - return "" - - def every_replica_erases_gaps() -> bool: """Whether every live replica runs a build whose erasure knows the gap tables: a row written while an older one serves could outlive an erasure it runs. Unknown (no diff --git a/server/knowledge/app/people.py b/server/knowledge/app/people.py new file mode 100644 index 00000000000..45d29b95af5 --- /dev/null +++ b/server/knowledge/app/people.py @@ -0,0 +1,91 @@ +"""The person a request's token stands for, folded onto one spelling per person. + +Knowledge gaps count askers and knowledge reports name reporters this way, so one +person's tokens count once and a user erasure finds their rows by their spellings. +""" + +from __future__ import annotations + +import logging + +log = logging.getLogger(__name__) + +# Service accounts a creator chain may climb before it is treated as unresolved. +_MAX_CREATOR_HOPS = 8 # not a setting: a bound on a registry walk, not a deployment's capacity + + +def token_person() -> tuple[str, str]: + """(person, end user): the person the token stands for. The end user of an end-user + token; else the token's `creator` claim, the person at the root of a delegated token + or service account, so the tokens a person mints for themselves count once; else the + token's subject. ('', '') without a token.""" + from server.auth.context import current_auth + from server.core.principals import USER, principal_id + + auth = current_auth() + if auth is None: + return "", "" + end_user = principal_id(auth.subject, USER) + if end_user: + return end_user, end_user + root = auth.creator or auth.subject + return root or "", "" + + +class PersonUnresolved(Exception): + """The directory could not be read, or ties the subject to two accounts.""" + + def __init__(self, message: str, *, tied: bool = False) -> None: + super().__init__(message) + self.tied = tied + + +async def one_person(org: str, subject: str) -> str: + """`subject` folded onto one spelling per person: a service account's creator, and a + human's spelling as the directory ties it (the login handle for a contact email), so + one person's two spellings count once and a user erasure finds them. '' when either + cannot be read.""" + try: + return await folded_person(org, subject) + except PersonUnresolved: + return "" + + +async def folded_person(org: str, subject: str) -> str: + """`one_person`, raising `PersonUnresolved` where the directory fails or ties the + subject to two accounts. '' only when no person stands behind the subject.""" + from server.auth.aliases import login_handle + + subject = await _registered_creator(org, subject) + if not subject: + return "" + try: + folded = await login_handle(org, subject) + except Exception as e: + log.warning("token person not resolved: %s", type(e).__name__) + raise PersonUnresolved("the directory could not be read") from e + if folded is None: + raise PersonUnresolved("the directory ties the token to two accounts", tied=True) + return folded + + +async def _registered_creator(org: str, subject: str) -> str: + """The person behind a service account, for a token minted without the `creator` + claim: the first subject in its creator chain that is not a service account, as the + registry records it; any other subject as given. '' when the chain cannot be read, has + no person in it, or is longer than `_MAX_CREATOR_HOPS`: an unknown principal is + never counted as a separate person.""" + from server.auth.service_accounts import sa_creator + + for _ in range(_MAX_CREATOR_HOPS): + if not subject.startswith("sa:"): + return subject + creator = await sa_creator(org, subject) + if creator is None or not creator.subject: + return "" + if creator.kind == "agent": + # An agent sign-up: the namespace made its own account, and no person stands + # behind it. + return "" + subject = creator.subject + return "" diff --git a/server/knowledge/app/report_refs.py b/server/knowledge/app/report_refs.py new file mode 100644 index 00000000000..939f345af00 --- /dev/null +++ b/server/knowledge/app/report_refs.py @@ -0,0 +1,47 @@ +"""What a knowledge report's references point at, checked as the caller would read it. + +A run is one of the namespace's runs, read as `run.get` reads it. A reflection is the +reflection memory at that key (`reflection:`), read under the report's identity +tuple as `memory.get` would serve it. A gap is in the namespace's latest gap build, and +only its admins read one, as `knowledge.gaps.list` is theirs: a gap's samples are other +people's questions. Nothing a reference points at is served or copied. +""" + +from __future__ import annotations + +import asyncio +from typing import Any + +from server.knowledge.store import gaps as gaps_store + + +async def readable(row: dict[str, Any], refs: list[str], *, admin: bool) -> list[str]: + """The references in `refs` the caller reads now, in their order. `row` holds the + report's org, namespace and identity tuple.""" + found = await asyncio.gather(*(_readable(row, ref, admin=admin) for ref in refs)) + return [ref for ref, ok in zip(refs, found, strict=True) if ok] + + +async def _readable(row: dict[str, Any], ref: str, *, admin: bool) -> bool: + kind, _, ident = ref.partition(":") + org, namespace = row["org"], row["namespace"] + if kind == "run": + from server.tasks.app.run import run_exists + + return await run_exists(org, namespace, ident) + if kind == "reflection": + from server.memory.api.models_crud import MemoryGetInput + from server.memory.app.handlers import readable_version + + lookup = MemoryGetInput( + org=org, + namespace=namespace, + agent=row["agent"], + user_id=row["user_id"], + session_id=row["session_id"], + memory_key=ref, + ) + return await readable_version(lookup) is not None + if kind == "gap": + return admin and await gaps_store.gap_for_draft(org, namespace, ident) is not None + return False diff --git a/server/knowledge/app/reports.py b/server/knowledge/app/reports.py new file mode 100644 index 00000000000..4e3b0878bda --- /dev/null +++ b/server/knowledge/app/reports.py @@ -0,0 +1,595 @@ +"""`knowledge.reports.*`: problem reports about memory claims and document passages. + +A reporter says a memory claim or a document is incorrect or outdated, or that knowledge +is missing. Maintainers (namespace admins) take a report, ask for evidence, resolve it +with the revision that corrected the target, or dismiss it with a reason. A report never +edits its target. The reporter is the person the token stands for (`token_person`), +never a body field, so a user erasure finds their reports. Every get checks that the +caller can read the target now; a report whose target the caller cannot read hides the +words written about it. Rules live in `server.knowledge.domain.reports`, statements in +`server.knowledge.store.reports` (docs/architecture/knowledge-reports.md). +""" + +from __future__ import annotations + +import hashlib +import json +import time +from contextlib import AbstractAsyncContextManager +from typing import Any, NamedTuple + +from server.auth import machines +from server.core import ch, lease_writes, leases +from server.core.datetimes import naive_utc_now +from server.core.errors import ( + AuthInsufficientError, + BackendUnavailableError, + ErasureRunningError, + NotFoundError, + OverloadedError, + PreconditionFailedError, + ValidationError, +) +from server.knowledge.api.models_reports import ( + KnowledgeReport, + KnowledgeReportDetail, + KnowledgeReportsEvidenceInput, + KnowledgeReportsEvidenceOutput, + KnowledgeReportsGetInput, + KnowledgeReportsGetOutput, + KnowledgeReportsListInput, + KnowledgeReportsListOutput, + KnowledgeReportsSubmitInput, + KnowledgeReportsSubmitOutput, + KnowledgeReportsUpdateInput, + KnowledgeReportsUpdateOutput, +) +from server.knowledge.app import report_refs +from server.knowledge.app.people import PersonUnresolved, folded_person, token_person +from server.knowledge.domain import reports as rules +from server.knowledge.store import reports as reports_store +from server.memory.app.provenance import writer_actor +from server.memory.domain.provenance import source_class_for + +# The migration that adds loom.knowledge_reports; an older replica's erasure saga has no +# step for it, so no report is written while one serves in any deployment kind. +REPORTS_MIGRATION = 120 # tests/unit/test_knowledge_reports.py ties it to the file + +# A report's changes are read-modify-write under this claim, one writer at a time. +_CLAIM_TTL_S = 30.0 # not a setting: one change's bound, not a capacity +_CLAIM_WAIT_S = 5.0 # not a setting: how long a second writer waits its turn + + +async def every_replica_stores_reports() -> bool: + """Whether every live replica of every deployment kind runs a build whose erasure + knows loom.knowledge_reports. An unread fleet counts as no.""" + return await machines.fleet_at(ch.get_client(), REPORTS_MIGRATION) + + +async def _require_rollout() -> None: + if not await every_replica_stores_reports(): + raise OverloadedError( + "not every replica serves knowledge reports yet; retry once the rollout is done", + retry_after_s=30, + ) + + +def _stamped(row: dict[str, Any], writer: str) -> dict[str, Any]: + """The version with its writer stamped from the token, never the body: `actor` is the + token's principal and `written_by` the person it stands for (`writer`, from `_person`), + whom a user erasure matches. With auth off `writer` is the identity's agent or '-'.""" + return { + **row, + "actor": writer_actor(writer), + "written_by": writer, + "source_class": source_class_for(default="asserted"), + } + + +def _refusal(e: rules.ReportRefused) -> ValidationError: + return ValidationError(str(e)) + + +def _cited(evidence: list[str], run_id: str) -> list[str]: + return [*evidence, f"run:{run_id}"] if run_id else list(evidence) + + +def _cites_gaps(refs: list[str]) -> bool: + return any(ref.startswith("gap:") for ref in refs) + + +async def _check_cited(row: dict[str, Any], refs: list[str]) -> None: + """Refuse a reference the caller cannot read, answered as not found whether it is + missing or only unreadable.""" + admin = _cites_gaps(refs) and await _maintainer(row["org"], row["namespace"]) + readable = set(await report_refs.readable(row, refs, admin=admin)) + unread = [ref for ref in refs if ref not in readable] + if unread: + raise ValidationError(f"evidence {unread[0][:80]!r} was not found") + + +async def _person(org: str) -> str: + """The person the token stands for, folded onto one spelling; the token's own principal + when no person stands behind it (an agent's own account); '' with auth off. An unfolded + person is refused, never stored under a spelling that stops matching once it folds.""" + person, _ = token_person() + if not person: + return "" + try: + return await folded_person(org, person) or person + except PersonUnresolved as e: + if e.tied: + raise AuthInsufficientError( + "the directory ties the token to two accounts; a report needs one person" + ) from e + raise BackendUnavailableError("the directory could not be read; retry") from e + + +async def _maintainer(org: str, namespace: str) -> bool: + """Whether the caller administers the namespace now, as the gate decides it: a lowered + grant ends an older token's admin claim. With auth off everyone does.""" + from server.auth.authz import row_in_scope + from server.operations.base import Role + + return await row_in_scope(org, namespace, Role.ADMIN) + + +class _Target(NamedTuple): + """A target as the caller can read it: its version or revision, its content hash and, + for a memory target, the identity tuple of the row it is in.""" + + version: int + sha256: str + identity: tuple[str, str, str] | None = None + + +async def _target_now(row: dict[str, Any], *, exact: bool = True) -> _Target | None: + """The target as the caller can read it now, `_Target(0, '')` for a report with no + target, None when the caller cannot read it or it is gone. A memory target is read + under the report's identity tuple: `exact` reads only the row stored under it, the one + the report is about; otherwise as `memory.get` reads it, which may find another agent's + or session's row of the same user, never another user's.""" + if not row["target_kind"]: + return _Target(0, "") + if row["target_kind"] == "memory": + from server.memory.api.models_crud import MemoryGetInput + from server.memory.app.handlers import readable_version + + found = await readable_version( + MemoryGetInput( + org=row["org"], + namespace=row["namespace"], + agent=row["agent"], + user_id=row["user_id"], + session_id=row["session_id"], + memory_key=row["target_key"], + ), + exact=exact, + ) + # Agent "*" reads the key across users: a report keeps its user, as `same_user` does. + if found is None or found.user_id != row["user_id"]: + return None + return _Target( + found.version, found.content_sha256, (found.agent, found.user_id, found.session_id) + ) + from server.knowledge.api.models_knowledge import KnowledgeGetInput + from server.knowledge.app.document_reads import handle_knowledge_get + + doc = await handle_knowledge_get( + KnowledgeGetInput(org=row["org"], namespace=row["namespace"], source_uri=row["target_key"]) + ) + if not doc.found: + return None + return _Target(int(doc.revision or 0), hashlib.sha256((doc.content or "").encode()).hexdigest()) + + +def _changed(row: dict[str, Any], now: _Target | None) -> bool: + if not row["target_kind"]: + return False + if now is None: + return True + return bool( + (row["target_version"] and int(row["target_version"]) != now.version) + or (row["target_sha256"] and row["target_sha256"] != now.sha256) + ) + + +async def _known_documents(org: str, namespace: str, rows: list[dict[str, Any]]) -> set[str]: + """The addresses of the documents `rows` are about that the caller may know of: a + mirrored document's address belongs to its readers alone.""" + from server.knowledge.app.document_reads import known_documents + + uris = [r["target_key"] for r in rows if r["target_kind"] == "document"] + return await known_documents(org, namespace, uris) if uris else set() + + +def _addressed(row: dict[str, Any], known: set[str]) -> bool: + """Whether the caller may read the report's target address: any memory key (the + namespace's readers read every one) or a document in `known`.""" + return row["target_kind"] != "document" or row["target_key"] in known + + +def _is_reporter(row: dict[str, Any], person: str) -> bool: + """Whether the caller filed the report. With auth off no token names a caller, so every + caller is its reporter, as every caller is a maintainer.""" + return not person or row["reporter"] == person + + +def _summary(row: dict[str, Any], *, known: bool = True) -> KnowledgeReport: + """A report's row; `known` False leaves out its document's address and revision, which + a caller who may not know of the document does not read (`known_documents`).""" + return KnowledgeReport( + report_id=row["report_id"], + version=int(row["version"]), + kind=row["kind"], + state=row["state"], + target_kind=row["target_kind"], + target_key=row["target_key"] if known else "", + target_version=int(row["target_version"]) if known else 0, + reporter=row["reporter"], + assignee=row["assignee"], + created_at=row["created_at"], + updated_at=row["updated_at"], + ) + + +def _report_id(row: dict[str, Any]) -> str: + """The same reporter filing the same problem about the same target gets the same id, so + a retry without an Idempotency-Key still files one report. A memory target is the row + its key was read in, named by that row's identity tuple: two reads that find one row + file one report, and the same key in two users' rows is two targets.""" + basis = [ + row["org"], + row["namespace"], + row["reporter"], + row["kind"], + row["target_kind"], + row["target_key"], + " ".join(row["problem"].split()), + ] + if row["target_kind"] == "memory": + basis += [row["agent"], row["user_id"], row["session_id"]] + return hashlib.sha256(json.dumps(basis).encode()).hexdigest()[:32] + + +async def _readable_reports( + org: str, namespace: str, ids: list[str], person: str | None, *, admin: bool | None = None +) -> set[str]: + """The ids in `ids` of reports the caller reads as `get` decides it: their own, or any + that exists for a maintainer. `person` None matches no reporter; `admin` None asks.""" + rows = await reports_store.latest_many(org, namespace, ids) + found = {r["report_id"] for r in rows if person is not None and _is_reporter(r, person)} + # The admin check reads grants: it is asked only where the answer depends on it. + if len(found) < len(rows) and ( + admin if admin is not None else await _maintainer(org, namespace) + ): + found = {r["report_id"] for r in rows} + return found + + +async def _linked( + org: str, namespace: str, own: str, linked: list[str], adding: list[str], person: str +) -> list[str]: + """`linked` followed by the ids in `adding` it lacks, each a report the caller reads + (`_readable_reports`); a missing and an unreadable one get the same refusal. A link + already held stays even if its report was erased.""" + new = [i for i in dict.fromkeys(adding) if i and i not in linked] + if own in new: + raise ValidationError("a report cannot be related to itself") + if len(linked) + len(new) > rules.MAX_RELATED: + raise ValidationError(f"at most {rules.MAX_RELATED} related reports") + found = await _readable_reports(org, namespace, new, person) + missing = [i for i in new if i not in found] + if missing: + raise ValidationError(f"related report {missing[0][:64]!r} was not found") + return [*linked, *new] + + +async def _fenced_insert(row: dict[str, Any], started_s: int, people: set[str]) -> None: + """Insert a report version inside the write fence both report erasers take, refusing + while an erasure reaching the report is unfinished or has finished since `started_s`. + A send whose outcome is unknown keeps the fence until it settles, so an eraser never + runs before it lands. `people`: everyone the version names (`_named`) and its writer.""" + from server.knowledge.app.gaps import erasure_since + + org, namespace = row["org"], row["namespace"] + reaching = {p for p in people if p and p != "-"} + name = rules.writer_lease_name(org) + async with lease_writes.fenced_many([name], wait_s=_CLAIM_WAIT_S) as uncertain: + if await erasure_since(org, namespace, started_s, reaching): + raise ErasureRunningError("an erasure reaching this report is running; retry after it") + uncertain(True) + await reports_store.insert_version(row) + uncertain(False) + + +def _named(row: dict[str, Any]) -> set[str]: + """The people a stored version names, whose erasure a write carrying it forward must + wait for: the reporter, the row's user, the assignee and the reason's author.""" + return {row["reporter"], row["user_id"], row["assignee"], row["reason_by"]} + + +def _claim(org: str, namespace: str, report_id: str) -> AbstractAsyncContextManager[bool]: + """One writer of a report at a time, across replicas.""" + return leases.holding( + f"knowledge-report:{org}:{namespace}:{report_id}", ttl_s=_CLAIM_TTL_S, wait_s=_CLAIM_WAIT_S + ) + + +def _first_version( + input: KnowledgeReportsSubmitInput, reporter: str, problem: str, evidence: list[str] +) -> dict[str, Any]: + """Version 1 of a report under the body's identity tuple, before its id, its links + and the target it read are known.""" + now = naive_utc_now() + return { + "org": input.org, + "namespace": input.namespace, + "agent": input.agent, + "user_id": input.user_id, + "session_id": input.session_id, + "report_id": "", + "version": 1, + "kind": input.kind, + "state": "open", + "target_kind": input.target_kind, + "target_key": input.target_key, + "target_version": int(input.target_version), # the validator made it an int + "target_sha256": input.target_sha256, + "problem": problem, + "suggested_correction": input.suggested_correction.strip(), + "run_id": input.run_id, + "evidence": evidence, + "related": [], + "reporter": reporter, + "assignee": "", + "reason": "", + "reason_by": "", + "resolution_revision": "", + "written_by": "", + "created_at": now, + "updated_at": now, + "deleted": False, + } + + +def _busy() -> OverloadedError: + return OverloadedError("another change to this report is running; retry", retry_after_s=1) + + +async def handle_knowledge_reports_submit( + input: KnowledgeReportsSubmitInput, +) -> KnowledgeReportsSubmitOutput: + """File a report, or return the one the same reporter already filed about the same + problem, in the state it is in now. The caller must be able to read the target; one + they cannot read answers as not found.""" + await _require_rollout() + started_s = int(time.time()) + try: + rules.check_target(input.kind, input.target_kind, input.target_key) + problem = rules.check_problem(input.problem) + evidence = rules.check_evidence(input.evidence) + except rules.ReportRefused as e: + raise _refusal(e) from e + person = await _person(input.org) + row = _first_version(input, person or input.agent, problem, evidence) + # Read before the id: a memory key binds the report to the row memory.get finds it in, + # which may be another agent's or session's row of the same user. + target = await _target_now(row, exact=False) + if target is not None and target.identity is not None: + row["agent"], row["user_id"], row["session_id"] = target.identity + report_id = row["report_id"] = _report_id(row) + # A repeat is answered before the checks that could have changed since the first filing. + existing = await reports_store.latest(input.org, input.namespace, report_id) + if existing is not None: + return KnowledgeReportsSubmitOutput( + report_id=report_id, state=existing["state"], version=int(existing["version"]) + ) + if target is None: + raise NotFoundError(f"{input.target_kind} {input.target_key[:200]!r} was not found") + row["related"] = await _linked(input.org, input.namespace, report_id, [], input.related, person) + # What the reporter read, else what is there now. + row["target_version"] = int(input.target_version) or target.version + row["target_sha256"] = input.target_sha256 or target.sha256 + await _check_cited(row, _cited(evidence, input.run_id)) + async with _claim(input.org, input.namespace, report_id) as held: + if not held: + raise _busy() + existing = await reports_store.latest(input.org, input.namespace, report_id) + if existing is not None: + return KnowledgeReportsSubmitOutput( + report_id=report_id, state=existing["state"], version=int(existing["version"]) + ) + people = {row["reporter"], row["user_id"]} + await _fenced_insert(_stamped(row, row["reporter"]), started_s, people) + return KnowledgeReportsSubmitOutput(report_id=report_id, state="open", version=1) + + +async def handle_knowledge_reports_get( + input: KnowledgeReportsGetInput, +) -> KnowledgeReportsGetOutput: + """One report for its reporter or a maintainer; anyone else is answered not found. A + maintainer who cannot read the target now sees the report without its words.""" + # Resolved before the read, so a refusal never says whether the report exists. + person: str | None + try: + person = await _person(input.org) + except (AuthInsufficientError, BackendUnavailableError): + # A maintainer reads any report, so only the reporter match is lost. + if not await _maintainer(input.org, input.namespace): + raise + person = None + row = await reports_store.latest(input.org, input.namespace, input.report_id) + if row is None: + return KnowledgeReportsGetOutput(found=False) + mine = person is not None and _is_reporter(row, person) + # The admin check reads grants: it is asked only where the answer depends on it. + admin: bool | None = None + if not mine or _cites_gaps(row["evidence"]): + admin = await _maintainer(input.org, input.namespace) + if not mine and not admin: + return KnowledgeReportsGetOutput(found=False) + target = await _target_now(row) + readable = target is not None + # The reporter wrote the address; anyone else reads it only if they may know of it. + known = ( + mine + or readable + or _addressed(row, await _known_documents(input.org, input.namespace, [row])) + ) + # Each reference and related report is served only while this caller reads it. + cited = set( + await report_refs.readable(row, _cited(row["evidence"], row["run_id"]), admin=bool(admin)) + ) + related = await _readable_reports( + input.org, input.namespace, list(row["related"]), person, admin=admin + ) + # Words about the target may quote it: the reporter reads their own, and anyone reads + # the rest only while they read the target. + detail = KnowledgeReportDetail( + **_summary(row, known=known).model_dump(), + target_changed=_changed(row, target), + problem=row["problem"] if mine or readable else "", + suggested_correction=row["suggested_correction"] if mine or readable else "", + run_id=row["run_id"] if f"run:{row['run_id']}" in cited else "", + evidence=[ref for ref in row["evidence"] if ref in cited], + related=[i for i in row["related"] if i in related], + reason=row["reason"] if readable else "", + resolution_revision=row["resolution_revision"] if known else "", + target_readable=readable, + ) + return KnowledgeReportsGetOutput(found=True, report=detail) + + +async def handle_knowledge_reports_list( + input: KnowledgeReportsListInput, +) -> KnowledgeReportsListOutput: + """The namespace's queue, newest change first, without anyone's words. A row about a + document the caller may not know of carries no address.""" + rows = await reports_store.list_reports( + input.org, + input.namespace, + states=list(input.states), + kinds=list(input.kinds), + target_kind=input.target_kind, + target_key=input.target_key, + assignee=input.assignee, + reporter=input.reporter, + limit=input.limit, + ) + known = await _known_documents(input.org, input.namespace, rows) + if input.target_key: + # A filter on an address the caller may not know of finds nothing, as on a missing one. + rows = [r for r in rows if _addressed(r, known)] + return KnowledgeReportsListOutput( + reports=[_summary(r, known=_addressed(r, known)) for r in rows] + ) + + +async def handle_knowledge_reports_update( + input: KnowledgeReportsUpdateInput, +) -> KnowledgeReportsUpdateOutput: + """A maintainer's action on a report, and links to related reports. A report about a + target that changed can still be resolved; one that is gone can be dismissed.""" + await _require_rollout() + started_s = int(time.time()) + if input.action is None and not input.related: + raise ValidationError("name an action or related reports to link") + try: + if input.action is not None: + rules.check_action( + input.action, + reason=input.reason, + resolution_revision=input.resolution_revision, + ) + elif input.reason or input.resolution_revision: + raise rules.ReportRefused("reason and resolution_revision go with an action") + except rules.ReportRefused as e: + raise _refusal(e) from e + person = await _person(input.org) + maintainer = person or "-" + async with _claim(input.org, input.namespace, input.report_id) as held: + if not held: + raise _busy() + row = await reports_store.latest(input.org, input.namespace, input.report_id) + if row is None: + raise NotFoundError(f"report {input.report_id!r} was not found") + if input.expected_version is not None and int(row["version"]) != input.expected_version: + raise PreconditionFailedError( + f"report {input.report_id!r} is at version {row['version']}," + f" not {input.expected_version}" + ) + next_row = dict(row) + if input.action is not None: + try: + next_row["state"] = rules.next_state(row["state"], input.action) + if input.action == "resolve" and row["target_kind"]: + served = await _target_now(row) + rules.check_resolution( + input.resolution_revision.strip(), + int(row["target_version"]), + None if served is None else served.version, + ) + except rules.ReportRefused as e: + raise _refusal(e) from e + if input.action == "take": + next_row["assignee"] = maintainer + elif input.action in ("release", "reopen"): + next_row["assignee"] = "" + next_row["reason"] = input.reason.strip() + next_row["resolution_revision"] = input.resolution_revision.strip() + # Who wrote the maintainer's words, which later versions carry: the reason, and a + # resolution with no target, which no revision check bounds. Erasure clears both. + words = next_row["reason"] or ( + not row["target_kind"] and next_row["resolution_revision"] + ) + next_row["reason_by"] = maintainer if words else "" + if input.related: + next_row["related"] = await _linked( + input.org, + input.namespace, + row["report_id"], + list(row["related"]), + input.related, + person, + ) + next_row["version"] = int(row["version"]) + 1 + next_row["updated_at"] = naive_utc_now() + await _fenced_insert(_stamped(next_row, maintainer), started_s, {*_named(row), maintainer}) + return KnowledgeReportsUpdateOutput( + report_id=row["report_id"], state=next_row["state"], version=next_row["version"] + ) + + +async def handle_knowledge_reports_evidence( + input: KnowledgeReportsEvidenceInput, +) -> KnowledgeReportsEvidenceOutput: + """The reporter adds evidence to their own report; another caller is answered not + found. A report waiting for evidence goes back to its maintainer, or to the queue.""" + await _require_rollout() + started_s = int(time.time()) + # Resolved before the read, so a refusal never says whether the report exists. + person = await _person(input.org) + async with _claim(input.org, input.namespace, input.report_id) as held: + if not held: + raise _busy() + row = await reports_store.latest(input.org, input.namespace, input.report_id) + if row is None or not _is_reporter(row, person): + raise NotFoundError(f"report {input.report_id!r} was not found") + try: + evidence = rules.check_evidence(list(row["evidence"]) + input.evidence) + state = rules.after_evidence(row["state"], row["assignee"]) + except rules.ReportRefused as e: + raise _refusal(e) from e + await _check_cited(row, [ref for ref in evidence if ref not in row["evidence"]]) + next_row = { + **row, + "evidence": evidence, + "state": state, + "version": int(row["version"]) + 1, + "updated_at": naive_utc_now(), + } + await _fenced_insert(_stamped(next_row, row["reporter"]), started_s, _named(row)) + return KnowledgeReportsEvidenceOutput( + report_id=row["report_id"], state=state, version=next_row["version"] + ) diff --git a/server/knowledge/app/source_documents.py b/server/knowledge/app/source_documents.py index 25dececb3b6..5dfbeee5465 100644 --- a/server/knowledge/app/source_documents.py +++ b/server/knowledge/app/source_documents.py @@ -122,6 +122,31 @@ async def get(plan: ReadPlan, namespace: str, source_uri: str) -> CheckedDocumen return None +async def admitted_uris(plan: ReadPlan, namespace: str, source_uris: list[str]) -> set[str]: + """The URIs among `source_uris` with a mirrored copy the reader's access list admits + now, decided from metadata in bounded batches: no text is read. A failed read admits + none, as every mirror leg fails closed.""" + by_pair = { + (mirror, uri + "#" + source): uri + for uri in source_uris + for (mirror, source), original in plan.discovery_sources.items() + if original == namespace + } + set_query_tag("knowledge.mirror.document_admission") + with private_work(), sequential_reads(): + candidates = await _discover(plan, sorted(by_pair)) + admitted: list[Admitted] = [] + for start in range(0, len(candidates), 64): + admitted.extend(await plan.check(candidates[start : start + 64])) + if plan.failed or plan.unread: + return set() + return { + by_pair[(item.candidate["namespace"], item.candidate["source_uri"])] + for item in admitted + if plan.current(item) + } + + async def _chunk_batch(plan: ReadPlan, batch: list[dict[str, Any]], model: str) -> list[Hydrated]: admitted = await plan.check(batch, chunks=True) hydrated = await source_search.hydrate( diff --git a/server/knowledge/domain/reports.py b/server/knowledge/domain/reports.py new file mode 100644 index 00000000000..5ca7899321e --- /dev/null +++ b/server/knowledge/domain/reports.py @@ -0,0 +1,132 @@ +"""Knowledge problem reports: kinds, states and the transitions between them. + +A report says that a memory claim or a document passage is incorrect or outdated, or +that knowledge is missing. Maintainers take it, ask for evidence, resolve it with the +revision that corrected the target, or dismiss it with a reason. A report never edits +its target. No I/O here; the handlers in `server/knowledge/app/reports.py` load and +store rows. +""" + +from __future__ import annotations + +import re +from typing import Literal + +ReportKind = Literal["missing", "incorrect", "outdated"] +ReportState = Literal["open", "taken", "needs_evidence", "resolved", "dismissed"] +TargetKind = Literal["memory", "document"] +MaintainerAction = Literal["take", "release", "request_evidence", "resolve", "dismiss", "reopen"] + +FINAL_STATES: frozenset[str] = frozenset({"resolved", "dismissed"}) + +# Evidence a report may cite, by prefix: a knowledge gap, a reflection, a graded run. +EVIDENCE_PREFIXES: tuple[str, ...] = ("gap", "reflection", "run") +_EVIDENCE_ID = re.compile(r"^[A-Za-z0-9._:-]{1,128}$") +MAX_EVIDENCE = 20 # not a setting: a bound on one report's citations, not a capacity +MAX_RELATED = 20 # not a setting: a bound on one report's links + + +def writer_lease_name(org: str) -> str: + """The durable write fence every report write and both report erasers take.""" + return f"knowledge_reports.writer/{org}" + + +class ReportRefused(ValueError): + """The request breaks a report rule; the message says which.""" + + +def check_target(kind: str, target_kind: str, target_key: str) -> None: + """Incorrect and outdated reports name what is wrong; a missing-knowledge report may + name nothing.""" + if target_kind and not target_key: + raise ReportRefused("a target names its memory key or document source URI") + if target_key and not target_kind: + raise ReportRefused("a target key needs target_kind memory or document") + if kind in ("incorrect", "outdated") and not target_kind: + raise ReportRefused(f"an {kind} report names the memory or document it is about") + + +def check_problem(problem: str) -> str: + """The problem as stored: trimmed, and never empty.""" + text = problem.strip() + if not text: + raise ReportRefused("a report says what is wrong or missing") + return text + + +def check_evidence(refs: list[str]) -> list[str]: + """Each reference is `gap:`, `reflection:` or `run:`. Returns them in + order with duplicates dropped; a repeat does not count toward `MAX_EVIDENCE`.""" + seen: dict[str, None] = {} + for ref in refs: + if ref in seen: + continue + prefix, _, ident = ref.partition(":") + if prefix not in EVIDENCE_PREFIXES or not _EVIDENCE_ID.match(ident): + raise ReportRefused( + f"evidence reference {ref[:40]!r} is not gap:, reflection: or run:" + ) + seen[ref] = None + if len(seen) > MAX_EVIDENCE: + raise ReportRefused(f"at most {MAX_EVIDENCE} evidence references") + return list(seen) + + +def next_state(state: ReportState, action: str) -> ReportState: + """The state a maintainer action moves a report to. Refuses an action that does not + apply in the current state.""" + if action == "reopen": + if state not in FINAL_STATES: + raise ReportRefused(f"only a resolved or dismissed report reopens, not {state}") + return "open" + if state in FINAL_STATES: + raise ReportRefused(f"a {state} report changes only by reopen") + if action == "take": + return "taken" + if action == "release": + if state != "taken": + raise ReportRefused("only a taken report is released") + return "open" + if action == "request_evidence": + return "needs_evidence" + if action == "resolve": + return "resolved" + if action == "dismiss": + return "dismissed" + raise ReportRefused(f"unknown action {action!r}") + + +def check_action(action: str, *, reason: str, resolution_revision: str) -> None: + """A dismissal and an evidence request say why. A resolution names the published + revision that corrected the target: a draft or a recommendation is not a fix.""" + if action in ("dismiss", "request_evidence", "reopen") and not reason.strip(): + raise ReportRefused(f"{action} needs a reason") + if action == "resolve" and not resolution_revision.strip(): + raise ReportRefused("resolve names the published revision that corrected the target") + if action != "resolve" and resolution_revision: + raise ReportRefused("resolution_revision is only for resolve") + + +def check_resolution(revision: str, reported: int, served: int | None) -> None: + """A resolution of a report about a target names the revision readers are served now, + which is newer than the reported one. Memory versions come from the clock, so a number + between the two may never have been published.""" + if served is None: + raise ReportRefused("the target is gone, so no published revision corrects it") + # isdigit() alone passes digits int() refuses, such as '²'. + if not (revision.isascii() and revision.isdigit()): + raise ReportRefused("resolution_revision is the target's revision number") + if served <= reported: + raise ReportRefused(f"the target has no revision newer than reported revision {reported}") + if int(revision) != served: + raise ReportRefused(f"readers are served revision {served}, not {revision}") + + +def after_evidence(state: ReportState, assignee: str) -> ReportState: + """Where a report goes when its reporter adds evidence: back to its maintainer when + one took it, else back to the queue.""" + if state in FINAL_STATES: + raise ReportRefused(f"a {state} report takes no more evidence") + if state != "needs_evidence": + return state + return "taken" if assignee else "open" diff --git a/server/knowledge/store/reports.py b/server/knowledge/store/reports.py new file mode 100644 index 00000000000..554d2c5335c --- /dev/null +++ b/server/knowledge/store/reports.py @@ -0,0 +1,133 @@ +"""Every statement over loom.knowledge_reports. + +A ReplacingMergeTree(version) sorted by (org, namespace, report_id): submit writes +version 1 and each change the next version of the whole row, so a read takes the latest +with FINAL. Every read filters on the (org, namespace) prefix. +""" + +from __future__ import annotations + +from typing import Any + +from server.core.repo_base import _CHClient, _default_client + +TABLE = "loom.knowledge_reports" + +COLUMNS: tuple[str, ...] = ( + "org", + "namespace", + "agent", + "user_id", + "session_id", + "report_id", + "version", + "kind", + "state", + "target_kind", + "target_key", + "target_version", + "target_sha256", + "problem", + "suggested_correction", + "run_id", + "evidence", + "related", + "reporter", + "assignee", + "reason", + "reason_by", + "resolution_revision", + "actor", + "written_by", + "source_class", + "created_at", + "updated_at", + "deleted", +) +_SELECT = ", ".join(f"`{c}`" for c in COLUMNS) +# A change reads the head another replica just wrote: a stale head would pass a version +# check and write a second version with the same number. +_SEQUENTIAL = " SETTINGS select_sequential_consistency = 1" + + +async def insert_version(row: dict[str, Any], *, ch: _CHClient | None = None) -> None: + """One version of a report, every column, inserted synchronously so it is written + before the change answers; a sequential read on any replica then sees it.""" + await (ch or _default_client()).insert( + TABLE, + [{c: row[c] for c in COLUMNS}], + settings={"async_insert": 0, "wait_for_async_insert": 1}, + ) + + +async def latest( + org: str, namespace: str, report_id: str, *, ch: _CHClient | None = None +) -> dict[str, Any] | None: + """The latest version of one report, or None when it does not exist or was deleted, + read with sequential consistency.""" + row = await (ch or _default_client()).query_one( + f"SELECT {_SELECT} FROM {TABLE} FINAL" + " WHERE org = {org:String} AND namespace = {ns:String} AND report_id = {id:String}" + " AND NOT deleted LIMIT 1" + _SEQUENTIAL, + params={"org": org, "ns": namespace, "id": report_id}, + ) + return dict(row) if row else None + + +async def latest_many( + org: str, namespace: str, report_ids: list[str], *, ch: _CHClient | None = None +) -> list[dict[str, Any]]: + """The latest versions of the given reports that exist, read with sequential + consistency.""" + if not report_ids: + return [] + rows = await (ch or _default_client()).query_all( + f"SELECT {_SELECT} FROM {TABLE} FINAL" + " WHERE org = {org:String} AND namespace = {ns:String}" + " AND report_id IN {ids:Array(String)} AND NOT deleted" + _SEQUENTIAL, + params={"org": org, "ns": namespace, "ids": report_ids}, + ) + return [dict(r) for r in rows] + + +async def list_reports( + org: str, + namespace: str, + *, + states: list[str], + kinds: list[str], + target_kind: str, + target_key: str, + assignee: str, + reporter: str, + limit: int, + ch: _CHClient | None = None, +) -> list[dict[str, Any]]: + """The namespace's reports, newest change first. An empty filter matches every + report; `reporter` and `assignee` compare exactly.""" + where = ["org = {org:String}", "namespace = {ns:String}", "NOT deleted"] + params: dict[str, Any] = {"org": org, "ns": namespace, "limit": limit} + if states: + where.append("state IN {states:Array(String)}") + params["states"] = states + if kinds: + where.append("kind IN {kinds:Array(String)}") + params["kinds"] = kinds + if target_kind: + where.append("target_kind = {tk:String}") + params["tk"] = target_kind + if target_key: + where.append("target_key = {tkey:String}") + params["tkey"] = target_key + if assignee: + where.append("assignee = {assignee:String}") + params["assignee"] = assignee + if reporter: + where.append("reporter = {reporter:String}") + params["reporter"] = reporter + rows = await (ch or _default_client()).query_all( + f"SELECT {_SELECT} FROM {TABLE} FINAL WHERE {' AND '.join(where)}" + " ORDER BY updated_at DESC, report_id LIMIT {limit:UInt32}", + params=params, + ) + return [dict(r) for r in rows] diff --git a/server/memory/app/handlers.py b/server/memory/app/handlers.py index f876254dce7..5ebe42a2aab 100644 --- a/server/memory/app/handlers.py +++ b/server/memory/app/handlers.py @@ -10,7 +10,7 @@ import asyncio import logging from datetime import UTC, datetime, timedelta -from typing import Any +from typing import Any, NamedTuple from fastapi import HTTPException @@ -325,9 +325,9 @@ def same_user(row: Any, identity: Any) -> bool: return str(getattr(row, "user_id", "") or "") == str(getattr(identity, "user_id", "") or "") -async def _point_lookup(identity: Any, input: MemoryGetInput) -> Any: - """The row at `input.memory_key` for this identity, else the same user's - row under any agent. +async def _point_lookup(identity: Any, input: MemoryGetInput, *, wide: bool = True) -> Any: + """The row at `input.memory_key` for this identity, else, when `wide`, the same + user's row under any agent. A get names a key, not the agent that wrote it: a Claude Code session (agent `claude-code`) asking for a key loom_search just served must find the row even when the @@ -355,9 +355,9 @@ async def _point_lookup(identity: Any, input: MemoryGetInput) -> Any: include_expired=False, # an expired fact reads as gone, like search scope=request_scope(), ) - if row is not None or identity.agent == "*": + if row is not None or identity.agent == "*" or not wide: return row - wide = memory_repo.Identity( + namespace_wide = memory_repo.Identity( org=identity.org, namespace=identity.namespace, agent="*", @@ -366,7 +366,7 @@ async def _point_lookup(identity: Any, input: MemoryGetInput) -> Any: ) with traced("ch.query.memory", op="point_lookup_wide", memory_key=input.memory_key): row = await memory_repo.get_by_key( - wide, + namespace_wide, input.memory_key, as_of=input.as_of, include_usage_totals=True, @@ -399,13 +399,11 @@ def _verdict_from_status(status: Any, duplicate_of: Any = "") -> str: return _STATUS_VERDICT.get(s, s) -async def handle_memory_get(input: MemoryGetInput) -> MemoryGetOutput: - # Exact-key reads are still reads: apply the same token read-scope ceiling - # as search before constructing the point-lookup identity. Without this, - # a token pinned to one end user could name another user in the body and - # retrieve that row by key. +def _within_read_scope(input: MemoryGetInput) -> MemoryGetInput: + """Exact-key reads are still reads: the token's read-scope ceiling applies before the + point-lookup identity is built, so a token pinned to one end user cannot name another + user in the body and read that row by key.""" from server.identity.domain.read_scope import resolve_read_filters - from server.operations import read_projection filters = resolve_read_filters( requested="namespace", @@ -418,8 +416,55 @@ async def handle_memory_get(input: MemoryGetInput) -> MemoryGetOutput: identity_updates["user_id"] = filters.user_id if filters.session_id is not None and filters.session_id != input.session_id: identity_updates["session_id"] = filters.session_id - if identity_updates: - input = input.model_copy(update=identity_updates) + return input.model_copy(update=identity_updates) if identity_updates else input + + +class ReadableRow(NamedTuple): + """A row `readable_version` found: its version, its served content hash and the + identity tuple it is stored under, never its value.""" + + version: int + content_sha256: str + agent: str + user_id: str + session_id: str + + +async def readable_version(input: MemoryGetInput, *, exact: bool = False) -> ReadableRow | None: + """The row `memory.get` would serve the caller at `input.memory_key`, or None when it + serves none; with `exact`, only a row stored under the input's own identity tuple. + Nothing of the row is served, so no read exposure or sensitive-read audit is + recorded.""" + import server.memory.store as memory_repo + from server.core.ch import own_write_reads + + if input.memory_key.startswith("chunk:"): + return None + input = _within_read_scope(input) + identity = memory_repo.Identity( + org=input.org, + namespace=input.namespace, + agent=input.agent, + user_id=input.user_id, + session_id=input.session_id, + ) + with own_write_reads(): + row = await _point_lookup(identity, input, wide=not exact) + if row is None: + return None + return ReadableRow( + int(row.version or 0), + served_content_sha256(row.value), + row.agent, + row.user_id, + row.session_id, + ) + + +async def handle_memory_get(input: MemoryGetInput) -> MemoryGetOutput: + from server.operations import read_projection + + input = _within_read_scope(input) # Resolve the field whitelist before the read so an unknown name is a 422 that cost no # statement; None = every field. diff --git a/server/operations/dashboard.py b/server/operations/dashboard.py index b842ff826a9..9c9217e8d97 100644 --- a/server/operations/dashboard.py +++ b/server/operations/dashboard.py @@ -250,5 +250,25 @@ def _named_once(*groups: dict[str, str]) -> dict[str, str]: "the assistant agent's SQL tool; no dashboard page calls it until the Assistant " "page's chat" ), + "knowledge.reports.submit": ( + "an agent or client files a report when it finds a claim or passage wrong, " + "outdated or missing while it works" + ), + "knowledge.reports.evidence": ( + "the reporter, an agent or client, adds evidence to its own report when a " + "maintainer asks for it" + ), + "knowledge.reports.get": ( + "maintainers read a report through the API and SDKs; no dashboard page calls it " + "until the report queue page" + ), + "knowledge.reports.list": ( + "maintainers read the queue through the API and SDKs; no dashboard page calls it " + "until the report queue page" + ), + "knowledge.reports.update": ( + "maintainers act on a report through the API and SDKs; no dashboard page calls it " + "until the report queue page" + ), }, ) diff --git a/server/operations/reach_manifest.py b/server/operations/reach_manifest.py index df5e640e8f2..dc6a8e7932e 100644 --- a/server/operations/reach_manifest.py +++ b/server/operations/reach_manifest.py @@ -506,6 +506,11 @@ "sdk_method", "dashboard", ), + "knowledge.reports.evidence": ("sdk_method",), + "knowledge.reports.get": ("sdk_method",), + "knowledge.reports.list": ("sdk_method",), + "knowledge.reports.submit": ("sdk_method",), + "knowledge.reports.update": ("sdk_method",), "knowledge.restore": ( "sdk_method", "dashboard", diff --git a/server/operations/registry.py b/server/operations/registry.py index 4d06fc2e18b..b3e93a37436 100644 --- a/server/operations/registry.py +++ b/server/operations/registry.py @@ -33,6 +33,7 @@ from server.knowledge.api import ops_gaps as knowledge_gaps from server.knowledge.api import ops_knowledge as knowledge from server.knowledge.api import ops_query_history as query_history +from server.knowledge.api import ops_reports as knowledge_reports from server.knowledge.api import ops_source_push as knowledge_source_push from server.knowledge.api import ops_sources as knowledge_sources from server.memory.api import ops_blacklist as blacklist @@ -70,6 +71,7 @@ connections, knowledge_source_push, knowledge_gaps, + knowledge_reports, query_history, help_docs, conversations, diff --git a/server/settings/catalog.py b/server/settings/catalog.py index f084f1a0c23..2db7145d011 100644 --- a/server/settings/catalog.py +++ b/server/settings/catalog.py @@ -6579,6 +6579,14 @@ class TrackerSettings(BaseModel): "knowledge.query_history.list": 250, "knowledge.query_history.remove": 1000, "knowledge.gaps.list": 300, + # server/knowledge/app/reports.py: a write takes the report's claim (Keeper round trips), + # reads it with FINAL and inserts synchronously; submit and get add the target's read + # (a memory point lookup or the document's get), list a FINAL read and its documents'. + "knowledge.reports.submit": 400, + "knowledge.reports.get": 100, + "knowledge.reports.list": 200, + "knowledge.reports.update": 300, + "knowledge.reports.evidence": 300, "knowledge.get": 30, "knowledge.ingest": 60, "knowledge.ingest_cancel": 60, diff --git a/server/tasks/app/run.py b/server/tasks/app/run.py index 229079e6a4e..837071756ed 100644 --- a/server/tasks/app/run.py +++ b/server/tasks/app/run.py @@ -950,6 +950,12 @@ async def handle_run_grade(input: RunGradeInput) -> RunGradeOutput: ) +async def run_exists(org: str, namespace: str, run_id: str) -> bool: + """Whether the namespace holds the run `run.get` would answer for, read without + serving it.""" + return await runs_store.fetch_run(get_client(), org, namespace, run_id) is not None + + async def handle_run_get(input: RunGetInput) -> RunGetOutput: ch = get_client() existing = await runs_store.fetch_run(ch, input.org, input.namespace, input.run_id) diff --git a/tests/analyzer/shapes.txt b/tests/analyzer/shapes.txt index 8e63c4ac1e3..c911b8ba82b 100644 --- a/tests/analyzer/shapes.txt +++ b/tests/analyzer/shapes.txt @@ -173,6 +173,7 @@ 145aca79b883 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, -- Multi-vector axis: min(value_dist, key_dist). CH?t g 14697ca6bfd3 ALTER TABLE loom.dataset_rows DELETE WHERE (org = {org:String} AND namespace IN {ns:Array(String)}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? 147a8c9b17f2 SELECT sum(upstream_cost_usd) AS spent, sumIf(upstream_cost_usd, operation = {op:String}) AS own, sumIf(upstream_cost_usd, user_id = {uid:String}) AS user_spent, sumIf(upstream_cost_usd, user_id = {ui +14c45bec17a4 SELECT count() AS n FROM loom.knowledge_reports WHERE org = {org:String} AND namespace = {ns:String} AND ? 14c924c1ec78 SELECT agent, user_id, session_id, memory_key, arrayReverseSort(groupArray((version, deleted, target))) AS versions FROM ( SELECT agent, user_id, session_id, memory_key, version, tombstoned_at IS NOT 15107eb3cae0 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, -- Multi-vector axis: min(value_dist, key_dist). CH?t g 15305ed67ee3 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, -- Multi-vector axis: min(value_dist, key_dist). CH?t g @@ -215,6 +216,7 @@ 190702c74f85 SELECT ts, actor, subject FROM loom.audit_log WHERE org = ? AND namespace = ? AND event_type = {event:String} AND ({name:String} = ? OR JSONExtractString(subject, ?) = {name:String}) ORDER BY ts DESC 190758ec6ba2 SELECT count() AS n FROM loom.memory_drops WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? 19091cfef8cd SELECT memory_key, memory_type, content_excerpt, valid_at, created_at, namespace, count() OVER () AS total_matching FROM loom.memory_embeddings FINAL WHERE org = {org:String} AND namespace = {ns:Strin +19323c5c6650 SELECT count() AS n FROM loom.knowledge_reports WHERE org = {org:String} AND namespace = {ns:String} 19660391746f SELECT count() AS n FROM loom.chunks WHERE org = {org:String} AND namespace = {ns:String} AND source_uri = {uri:String} AND doc_superseded_at IS NULL AND (org, namespace, embedding_model, source_uri, 1987660b5a9d ALTER TABLE loom.entity_edge_rows DELETE WHERE (org = {org:String} AND user_id = {uid:String}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? 19acdb7285ea SELECT count() AS n FROM loom.namespace_guides WHERE org = {org:String} AND namespace IN {ns:Array(String)} @@ -458,6 +460,7 @@ 342f026b3008 SELECT count() AS n FROM loom.memory_code_link_queue WHERE org = {org:String} AND namespace = {ns:String} AND ? 343b7c396165 SELECT count() AS n FROM loom.session_brief_revisions WHERE org = {org:String} AND namespace IN {ns:Array(String)} 345bb4f0bdc6 SELECT count() AS n FROM loom.learnings_supporters WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? +34601f272cdd ALTER TABLE loom.knowledge_reports UPDATE assignee = if(has({spellings:Array(String)}, lowerUTF8(assignee)), ?, assignee), reason = if(has({spellings:Array(String)}, lowerUTF8(reason_by)), ?, reason), 348ab5a553ad SELECT org, namespace, source_uri, chunk_idx, content, tags, doc_metadata, chunk_metadata, ingested_at, doc_superseded_at, embedding_model, embedding_dim, embedding, created_at, embed_attempts, embed_ 34912ecbbcb8 SELECT count() AS n FROM loom.memory_chunk_sources FINAL WHERE org = {org:String} AND tombstoned_at IS NULL AND (namespace, memory_key) IN {keys:Array(Tuple(String, String))} 349d1b15dfc4 SELECT count() AS n FROM loom.dataset_rows WHERE org = {org:String} AND user_id = {uid:String} @@ -657,6 +660,7 @@ 4a536b32504b SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, ? - cosineDistance(e.embedding, {qv:Array(Float32)}) AS similarity, toString(coalesce(e.temporal_ 4aeabb5d4edf SELECT count() AS n FROM loom.namespace_guides WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? 4b65a7bc66f1 SELECT count() AS n FROM loom.memory_records FINAL WHERE org = {org:String} AND tombstoned_at IS NULL AND user_id = {uid:String} +4ba463d0c1ac ALTER TABLE loom.knowledge_reports DELETE WHERE (org = {org:String} AND namespace IN {ns:Array(String)}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? 4baa66e24a1e SELECT pr_number, title, author, labels, merged_at, merge_commit_sha, linked_issues, body_excerpt FROM loom.code_pr_history FINAL WHERE org = {org:String} AND namespace = {ns:String} AND has(files, {p 4bcc327f9556 ALTER TABLE loom.knowledge_gaps DELETE WHERE (org = {org:String} AND namespace IN {ns:Array(String)}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? 4bfcae48a0ba ALTER TABLE loom.query_history_sources DELETE WHERE (org = {org:String} AND namespace = {ns:String}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? @@ -673,6 +677,7 @@ 4cbab38c8950 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, -- Multi-vector axis: min(value_dist, key_dist). CH?t g 4cffb3ebff8e ALTER TABLE loom.conversations UPDATE is_saved = true, user_id = {uid:String}, saved_at = coalesce(saved_at, {at:DateTime64(?, ?)}) WHERE org = {org:String} AND namespace = {ns:String} AND agent = {ag 4d19c2282f56 ALTER TABLE loom.session_brief_revisions DELETE WHERE (org = {org:String} AND namespace IN {ns:Array(String)}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sy +4d35b2bfae9a SELECT count() AS n FROM loom.knowledge_reports WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? 4d76718ea54e ALTER TABLE loom.memory DELETE 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))})) A 4d7bac78429c ALTER TABLE loom.memory_record_versions DELETE WHERE (org = {org:String} AND namespace = {ns:String}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? 4d9ea3bc8811 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, cosineDistance(e.embedding, {q:Array(Float32)}) AS dist @@ -869,6 +874,7 @@ 6285f383b808 SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, ? - cosineDistance(e.embedding, {qv:Array(Float32)}) AS similarity, toString(coalesce(e.temporal_ 62958ba7ae8e SELECT uniqExact(path) AS n FROM loom.code_chunks FINAL WHERE org = {org:String} AND namespace = {ns:String} AND embedding_model = {model:String} AND tombstoned_at IS NULL AND lower(content) LIKE {sc_ 62b8af846501 SELECT count() AS n FROM loom.consolidation_runs WHERE org = {org:String} AND namespace = {ns:String} +62cdbe0c18eb SELECT count() AS n FROM loom.knowledge_reports WHERE org = {org:String} AND (has({spellings:Array(String)}, lowerUTF8(assignee)) OR has({spellings:Array(String)}, lowerUTF8(reason_by)) OR has({spelli 6337dbb0bbab SELECT path, scope, symbol_ids, kind, start_line, end_line, content, embedding_model, toString(indexed_commit) AS indexed_commit FROM ( SELECT path, scope, symbol_ids, kind, start_line, end_line, cont 634c9f0bfb3a 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, -- Multi-vector axis: min(value_dist, key_dist). CH?t g 63a839f81adb SELECT namespace, source_uri, title, description, tags, ingested_at, superseded_at, blob_path, blob_size, toString(blob_content_type) AS blob_content_type, original_filename, content_preview FROM loom @@ -960,6 +966,7 @@ 6e894706d089 SELECT count() AS n FROM loom.code_search_outcome WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? 6e90fc205193 SELECT org, namespace, agent, user_id, session_id, memory_key FROM ( SELECT DISTINCT org, namespace, agent, user_id, session_id, memory_key FROM loom.memory WHERE tombstoned_at IS NULL AND (arrayExist 6eac9c7cf08e DELETE FROM loom.session_summaries WHERE (org = {org:String} AND namespace IN {ns:Array(String)}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS lightweight_deletes_sync +6efc23485447 -- 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 6f025f927273 SELECT count() AS n FROM loom.knowledge_ingestions WHERE org = {org:String} AND user_id = {uid:String} 6f11f5e87057 SELECT DISTINCT path FROM loom.code_symbols FINAL WHERE org = {org:String} AND namespace = {ns:String} AND symbol_id IN {ids:Array(String)} AND tombstoned_at IS NULL 6f4a2a751075 SELECT count() AS n FROM loom.operator_edges FINAL WHERE org = {org:String} AND tombstoned_at IS NULL AND namespace IN {ns:Array(String)} @@ -1064,6 +1071,7 @@ 7aab1cf5e970 SELECT *, hex(SHA256(toJSONString((value_json, value)))) AS body_sha FROM (SELECT org, namespace, agent, user_id, session_id, ? AS actor, concat(?, session_id) AS memory_key, version, ? AS value_json, 7aad3247f4a7 SELECT count() AS n FROM loom.session_summaries FINAL WHERE org = {org:String} AND user_id = {uid:String} AND tombstoned_at IS NULL 7ad2d6cd3530 SELECT brief_key, revision, agent, user_id, session_id, head_sha, trigger, author, sections, rendered, events_total, source_chars, brief_chars, actor, updated_at, tombstoned_at, version FROM loom.sess +7ad6bd2d2d2d SELECT count() AS n FROM loom.knowledge_reports WHERE org = {org:String} AND (has({spellings:Array(String)}, lowerUTF8(reporter)) OR has({spellings:Array(String)}, lowerUTF8(user_id))) 7ada090d2235 ALTER TABLE loom.shared UPDATE tombstoned_at = {now:DateTime} WHERE (org = {org:String} AND tombstoned_at IS NULL AND namespace = {ns:String}) AND ({erasure_mutation_tag:String} = {erasure_mutation_ta 7ae5fa2ffa15 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, -- Multi-vector axis: min(value_dist, key_dist). CH?t g 7b00f0e38432 SELECT namespace, source_id, `group`, members, read_at, deleted FROM loom.knowledge_group_members FINAL WHERE org = {org:String} AND (namespace, source_id, `group`) IN {groups:Array(Tuple(String, Stri @@ -1248,6 +1256,7 @@ 8d8144c55065 SELECT count() AS n FROM loom.conversations WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND tombstoned_at IS NULL 8d8ef51731bc SELECT count() AS n FROM loom.learnings_queue WHERE org = {org:String} AND namespace = {ns:String} AND ? 8daebcf8169c SELECT count() AS n FROM loom.entity_triple_rows WHERE org = {org:String} AND (user_id = {uid:String} OR (namespace, memory_id) IN (SELECT toString(namespace), memory_id FROM (SELECT namespace, agent, +8db56f6f9c2d SELECT count() AS n FROM loom.knowledge_reports WHERE org = {org:String} AND namespace IN {ns:Array(String)} 8dba6a4f2a78 ALTER TABLE loom.memory_reinforcement DELETE WHERE (org = {org:String} AND namespace = {ns:String}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? 8defed91c48e SELECT chunk_id, path, scope, kind, start_line, end_line, content, symbol_ids, context_description, cosineDistance(embedding, {q:Array(Float32)}) AS distance FROM loom.code_chunks FINAL WHERE org = {o 8df9f540d745 SELECT countIf(tombstoned_at IS NULL) AS live, countIf(tombstoned_at IS NOT NULL) AS dead, max(updated_at) AS last_updated, groupUniqArray(embedding_dim) AS dims FROM loom.qa_item_embeddings FINAL WHE @@ -1564,6 +1573,7 @@ ae4e819b95ea SELECT count() AS n FROM loom.entity_edge_rows WHERE org = {org:Str ae5b8ffb587a SELECT l.memory_key AS memory_key, toString(l.memory_id) AS memory_id, l.code_namespace AS code_namespace, l.path AS path, l.qualified_name AS qualified_name, l.state AS state, l.changed_since AS chan ae7d2da05030 SELECT count() AS n FROM loom.memory_extraction_queue WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? ae99c20b3d1e 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 +af259ff33f9d ALTER TABLE loom.knowledge_reports DELETE WHERE (org = {org:String} AND namespace = {ns:String}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? af399844e950 ALTER TABLE loom.memory_record_fields DELETE WHERE (org = {org:String} AND record_id IN {ids:Array(UUID)}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = af8aae57db93 SELECT count() AS n FROM loom.memory_chunk_sources FINAL WHERE org = {org:String} AND tombstoned_at IS NULL AND namespace = {ns:String} afdcda2bf23a SELECT count() AS n FROM loom.memory_ask_precedents WHERE org = {org:String} AND hasAny(arrayConcat(window_keys, cited_keys), arrayConcat((SELECT groupUniqArray(memory_key) FROM loom.memory WHERE org @@ -1743,7 +1753,6 @@ c1f9002b82f4 SELECT chunk_id, path, scope, kind, start_line, end_line, content, c1fc173ac609 SELECT pr_number, title, author, merged_at, files, linked_issues, (match(title, {revert_re:String}) OR positionCaseInsensitive(body_excerpt, ?) > ? ) AS is_revert FROM loom.code_pr_history FINAL WHERE c23ce268d788 SELECT DISTINCT start_line, end_line, content, kind, scope, symbol_ids, toString(indexed_commit) AS indexed_commit FROM loom.code_chunks FINAL WHERE org = {org:String} AND namespace = {ns:String} AND c23f3a6975c8 ALTER TABLE loom.memory_embeddings UPDATE tombstoned_at = {now:DateTime} WHERE (org = {org:String} AND tombstoned_at IS NULL AND scope = ? AND (namespace, memory_key) IN {keys:Array(Tuple(String, Stri -c25cec2435d6 -- 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 c266319cd4ad SELECT count() AS n FROM loom.conversation_threads FINAL WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND tombstoned_at IS NULL c26ddee98bc8 SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, ? - cosineDistance(e.embedding, {qv:Array(Float32)}) AS similarity, toString(coalesce(e.temporal_ c271f531ca3b SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, ? - cosineDistance(e.embedding, {qv:Array(Float32)}) AS similarity, toString(coalesce(e.temporal_ @@ -1877,6 +1886,7 @@ cea581143d39 SELECT DISTINCT org, namespace, agent, user_id, session_id, memory_ cec032d1cb17 SELECT user_id FROM loom.conversation_embeddings FINAL WHERE org = {org:String} AND namespace = {ns:String} AND agent = {agent:String} AND thread_id = {tid:String} AND msg_id = {mid:String} AND is_sav cec3f5ad060e SELECT org, namespace, agent, user_id, session_id, memory_id, memory_key, memory_type, value, confidence, source_trace, version, tombstoned_at, created_at, expires_at, sensitivity FROM loom.memory FIN cee7e1df6fac SELECT jti, revoked_at, expires_at, reason, revoked_by, issued_before, version FROM loom.revoked_tokens FINAL WHERE jti = {j:String} AND expires_at > now() +cefd6e74a08f ALTER TABLE loom.knowledge_reports DELETE WHERE (org = {org:String} AND (has({spellings:Array(String)}, lowerUTF8(reporter)) OR has({spellings:Array(String)}, lowerUTF8(user_id)))) AND ({erasure_mutat cf06ff759823 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, -- Multi-vector axis: min(value_dist, key_dist). CH?t g cf0cc9e2222f SELECT count() AS n FROM loom.derived_facts WHERE org = {org:String} AND namespace = {ns:String} cf104f8e96d5 SELECT ? FROM loom.memory_extraction_queue FINAL WHERE org={org:String} AND namespace={namespace:String} AND agent={agent:String} AND user_id={user_id:String} AND session_id={session_id:String} AND qu @@ -2070,6 +2080,7 @@ e0f548d3f7a8 SELECT agent, user_id, session_id, embedding_model, summary_text, k e0f90e7e0243 ALTER TABLE loom.memory_embeddings UPDATE tombstoned_at = {now:DateTime} WHERE (org = {org:String} AND tombstoned_at IS NULL AND namespace = {ns:String}) AND ({erasure_mutation_tag:String} = {erasure_ e107d944ecff SELECT n.namespace AS namespace, n.description AS description, n.kind AS kind, n.owner_email AS owner_email, n.requires_approval AS requires_approval, toString(n.visibility) AS visibility, toString(n. e10df0e1e1d9 SELECT count() AS n FROM loom.memory_chunk_sources FINAL WHERE org = {org:String} AND tombstoned_at IS NULL AND namespace IN {ns:Array(String)} +e11b0dbecfc9 SELECT count() AS n FROM loom.knowledge_reports WHERE org = {org:String} AND ((has({spellings:Array(String)}, lowerUTF8(reporter)) OR has({spellings:Array(String)}, lowerUTF8(user_id))) OR (has({spell e12eb5c134dc SELECT {literals:Array(String)}[held] AS literal, chunk_id, path, scope, kind, start_line, end_line, content, symbol_ids, context_description FROM loom.code_chunks FINAL ARRAY JOIN arrayFilter( i -> m e1357e7c3edf 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 content_sha256 NOT IN {live:A e1458e7f082a SELECT namespace, count() AS n FROM loom.documents FINAL WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND superseded_at IS NULL GROUP BY namespace LIMIT {lim:UInt32} diff --git a/tests/integration/test_knowledge_reports.py b/tests/integration/test_knowledge_reports.py new file mode 100644 index 00000000000..56a118190f2 --- /dev/null +++ b/tests/integration/test_knowledge_reports.py @@ -0,0 +1,350 @@ +"""Knowledge reports against a real ClickHouse: a report version stored and read back with +every column, the latest version winning, the queue's filters, the handlers' submit, +update and evidence under the per-report claim, and both erasure steps. The handlers run +in-process with auth off, where the reporter is the identity's agent.""" + +from __future__ import annotations + +import sys +from datetime import datetime, timedelta +from pathlib import Path +from typing import Any +from unittest.mock import AsyncMock + +import pytest + +ROOT = Path(__file__).resolve().parents[2] +sys.path.insert(0, str(ROOT)) + +from server.core.ch import get_client # noqa: E402 +from server.erasure.store import steps_ledgers # noqa: E402 +from server.erasure.store.predicates import REPORT_PERSON # noqa: E402 +from server.knowledge.api.models_reports import ( # noqa: E402 + KnowledgeReportsEvidenceInput, + KnowledgeReportsGetInput, + KnowledgeReportsSubmitInput, + KnowledgeReportsUpdateInput, +) +from server.knowledge.app import reports as reports_app # noqa: E402 +from server.knowledge.store import reports as reports_store # noqa: E402 +from server.memory.api.models_crud import MemoryGetInput, MemorySetInput # noqa: E402 +from server.memory.app.handlers import handle_memory_get # noqa: E402 +from server.memory.app.write import handle_memory_set # noqa: E402 +from server.tasks.api.models_run import RunBeginInput # noqa: E402 +from server.tasks.app.run import handle_run_begin # noqa: E402 +from tests.integration._resources import unique_org # noqa: E402 + +pytestmark = pytest.mark.usefixtures("ch_target_required") + +NS = "reports" +T0 = datetime(2026, 1, 5, 9, 30, 0, 123000) + + +@pytest.fixture(autouse=True) +async def _ch_connected(): + ch = get_client() + await ch.connect() + yield + await ch.disconnect() + + +def _row(org: str, report_id: str, **kw: Any) -> dict[str, Any]: + return { + "org": org, + "namespace": NS, + "agent": "claude-code", + "user_id": "bob", + "session_id": "s1", + "report_id": report_id, + "version": 1, + "kind": "outdated", + "state": "open", + "target_kind": "document", + "target_key": "docs/pricing.md", + "target_version": 3, + "target_sha256": "a" * 64, + "problem": "The price changed.", + "suggested_correction": "It is $20.", + "run_id": "r1", + "evidence": ["run:r1", "gap:g1"], + "related": ["other"], + "reporter": "alice", + "assignee": "", + "reason": "", + "reason_by": "", + "resolution_revision": "", + "actor": "human:alice", + "written_by": "alice", + "source_class": "asserted", + "created_at": T0, + "updated_at": T0, + "deleted": False, + **kw, + } + + +async def test_a_version_stores_every_column_and_the_latest_wins() -> None: + org = unique_org("reportsi") + first = _row(org, "r-1") + await reports_store.insert_version(first) + got = await reports_store.latest(org, NS, "r-1") + assert got == first + + taken = _row( + org, + "r-1", + version=2, + state="taken", + assignee="maria", + actor="human:maria", + written_by="maria", + updated_at=T0 + timedelta(minutes=1), + ) + await reports_store.insert_version(taken) + assert await reports_store.latest(org, NS, "r-1") == taken + assert [r["report_id"] for r in await reports_store.latest_many(org, NS, ["r-1", "x"])] == [ + "r-1" + ] + assert await reports_store.latest(org, "other", "r-1") is None + + +async def test_the_queue_filters_and_orders_by_the_latest_change() -> None: + org = unique_org("reportsq") + await reports_store.insert_version( + _row(org, "a", kind="missing", target_kind="", target_key="") + ) + await reports_store.insert_version( + _row(org, "b", state="taken", assignee="maria", updated_at=T0 + timedelta(minutes=5)) + ) + + async def ids(**kw: Any) -> list[str]: + base: dict[str, Any] = { + "states": [], + "kinds": [], + "target_kind": "", + "target_key": "", + "assignee": "", + "reporter": "", + "limit": 50, + } + rows = await reports_store.list_reports(org, NS, **{**base, **kw}) + return [r["report_id"] for r in rows] + + assert await ids() == ["b", "a"] + assert await ids(states=["open"]) == ["a"] + assert await ids(kinds=["missing"]) == ["a"] + assert await ids(target_kind="document", target_key="docs/pricing.md") == ["b"] + assert await ids(assignee="maria") == ["b"] + assert await ids(reporter="nobody") == [] + + +async def test_handlers_file_take_and_add_evidence_under_the_claim( + monkeypatch: pytest.MonkeyPatch, +) -> None: + org = unique_org("reportsh") + monkeypatch.setattr(reports_app, "every_replica_stores_reports", AsyncMock(return_value=True)) + body = {"org": org, "namespace": NS, "agent": "cli"} + out = await reports_app.handle_knowledge_reports_submit( + KnowledgeReportsSubmitInput(**body, kind="missing", problem="No refund policy.") + ) + again = await reports_app.handle_knowledge_reports_submit( + KnowledgeReportsSubmitInput(**body, kind="missing", problem="No refund policy.") + ) + assert again.report_id == out.report_id and again.version == 1 + + async def writer() -> tuple[str, str, str]: + row = await reports_store.latest(org, NS, out.report_id) + assert row is not None + return row["actor"], row["written_by"], row["source_class"] + + # Each version names its own writer; with auth off, the identity's agent or "-". + assert await writer() == ("cli", "cli", "asserted") + + upd = {"org": org, "namespace": NS, "report_id": out.report_id} + taken = await reports_app.handle_knowledge_reports_update( + KnowledgeReportsUpdateInput(**upd, action="take") + ) + asked = await reports_app.handle_knowledge_reports_update( + KnowledgeReportsUpdateInput(**upd, action="request_evidence", reason="Which runs?") + ) + assert (taken.version, asked.state, asked.version) == (2, "needs_evidence", 3) + assert await writer() == ("-", "-", "asserted") + # A run the report cites must exist in the namespace. + await handle_run_begin(RunBeginInput(**body, run_id="r9", goal="Find the refund policy.")) + added = await reports_app.handle_knowledge_reports_evidence( + KnowledgeReportsEvidenceInput(**upd, evidence=["run:r9"]) + ) + assert (added.state, added.version) == ("taken", 4) + assert await writer() == ("cli", "cli", "asserted") + + got = await reports_app.handle_knowledge_reports_get(KnowledgeReportsGetInput(**upd)) + assert got.found and got.report is not None + report = got.report + # With auth off no person stands behind the maintainer: the identity's sentinel. + assert (report.reporter, report.assignee, report.evidence) == ("cli", "-", ["run:r9"]) + assert report.problem == "No refund policy." and report.target_readable + + +async def test_a_memory_version_above_2_53_is_filed_and_read_back_exactly( + monkeypatch: pytest.MonkeyPatch, +) -> None: + org = unique_org("reportsv") + monkeypatch.setattr(reports_app, "every_replica_stores_reports", AsyncMock(return_value=True)) + key = {"org": org, "namespace": NS, "agent": "cli", "memory_key": "pricing/plan"} + await handle_memory_set(MemorySetInput(**key, value="The plan is $20 a month.")) + read = await handle_memory_get(MemoryGetInput(**key)) + # A nanosecond version, which a JavaScript number rounds: the client sends the text. + assert read.version_text is not None and int(read.version_text) > 2**53 + out = await reports_app.handle_knowledge_reports_submit( + KnowledgeReportsSubmitInput( + org=org, + namespace=NS, + agent="cli", + kind="outdated", + target_kind="memory", + target_key="pricing/plan", + target_version=read.version_text, + problem="The plan is $25 a month now.", + ) + ) + row = await reports_store.latest(org, NS, out.report_id) + assert row is not None and row["target_version"] == int(read.version_text) + got = await reports_app.handle_knowledge_reports_get( + KnowledgeReportsGetInput(org=org, namespace=NS, report_id=out.report_id) + ) + assert got.report is not None + report = got.report + assert (report.target_version_text, report.target_changed) == (read.version_text, False) + + +async def test_a_user_erasure_deletes_filed_reports_and_clears_the_taker() -> None: + org = unique_org("reportse") + await reports_store.insert_version(_row(org, "filed", reporter="alice")) + await reports_store.insert_version(_row(org, "as-user", reporter="carol", user_id="Alice")) + await reports_store.insert_version(_row(org, "taken", reporter="carol", assignee="alice")) + await steps_ledgers.delete_knowledge_reports_by_user(org, ["alice"]) + assert await reports_store.latest(org, NS, "filed") is None + assert await reports_store.latest(org, NS, "as-user") is None + kept = await reports_store.latest(org, NS, "taken") + assert kept is not None and kept["assignee"] == "" and kept["reporter"] == "carol" + + +async def test_a_user_erasure_clears_what_a_maintainer_wrote_in_every_version() -> None: + org = unique_org("reportsm") + asked = {"reporter": "carol", "reason": "Which run?", "reason_by": "alice"} + carol = {"actor": "human:carol", "written_by": "carol"} + await reports_store.insert_version(_row(org, "asked", **carol)) + # alice asked for evidence without taking the report; carol's evidence carried it on. + await reports_store.insert_version( + _row(org, "asked", version=2, state="needs_evidence", actor="human:Alice", **asked) + ) + await reports_store.insert_version( + _row(org, "asked", version=3, evidence=["run:r1", "run:r2"], **carol, **asked) + ) + # alice resolved a missing-knowledge report in her own words; mark's link carried them. + missing = { + "reporter": "carol", + "kind": "missing", + "target_kind": "", + "target_key": "", + "target_version": 0, + "target_sha256": "", + } + resolved = {**missing, "state": "resolved", "resolution_revision": "See the FAQ."} + await reports_store.insert_version(_row(org, "missing", **carol, **missing)) + await reports_store.insert_version( + _row(org, "missing", version=2, actor="human:Alice", reason_by="alice", **resolved) + ) + await reports_store.insert_version( + _row( + org, + "missing", + version=3, + related=["other", "asked"], + actor="human:mark", + written_by="mark", + reason_by="alice", + **resolved, + ) + ) + census = ( + "SELECT count() AS n FROM loom.knowledge_reports FINAL" + f" WHERE org = {{org:String}} AND {REPORT_PERSON}" + ) + params = {"org": org, "spellings": ["alice"]} + assert (await get_client().query_one(census, params))["n"] == 2 + await steps_ledgers.delete_knowledge_reports_by_user(org, ["alice"]) + assert (await get_client().query_one(census, params))["n"] == 0 + # No version, merged or not, still names alice or holds her words. + left = await get_client().query_one( + "SELECT count() AS n FROM loom.knowledge_reports WHERE org = {org:String}" + " AND (reason_by != '' OR reason != '' OR resolution_revision != ''" + " OR lowerUTF8(actor) = 'human:alice' OR written_by = 'alice')", + {"org": org}, + ) + assert left["n"] == 0 + kept = await reports_store.latest(org, NS, "asked") + assert kept is not None + assert (kept["reporter"], kept["problem"], kept["actor"]) == ( + "carol", + "The price changed.", + "human:carol", + ) + assert kept["evidence"] == ["run:r1", "run:r2"] + linked = await reports_store.latest(org, NS, "missing") + assert linked is not None + assert (linked["state"], linked["actor"], linked["related"]) == ( + "resolved", + "human:mark", + ["other", "asked"], + ) + + +async def test_a_user_erasure_finds_the_versions_their_service_account_wrote() -> None: + org = unique_org("reportss") + carol = {"reporter": "carol", "actor": "human:carol", "written_by": "carol"} + await reports_store.insert_version(_row(org, "linked", **carol)) + # alice linked a related report through her service account, whose principal is not her + # name: the version's writer is all that ties it to her. + await reports_store.insert_version( + _row( + org, + "linked", + version=2, + reporter="carol", + related=["other", "x"], + actor="process:sa:alice-bot", + written_by="alice", + ) + ) + census = ( + "SELECT count() AS n FROM loom.knowledge_reports FINAL" + f" WHERE org = {{org:String}} AND {REPORT_PERSON}" + ) + params = {"org": org, "spellings": ["alice"]} + assert (await get_client().query_one(census, params))["n"] == 1 + await steps_ledgers.delete_knowledge_reports_by_user(org, ["alice"]) + assert (await get_client().query_one(census, params))["n"] == 0 + kept = await reports_store.latest(org, NS, "linked") + assert kept is not None + assert (kept["actor"], kept["written_by"], kept["reporter"], kept["related"]) == ( + "", + "", + "carol", + ["other", "x"], + ) + + +async def test_a_namespace_erasure_deletes_the_namespace_s_reports() -> None: + org = unique_org("reportsn") + await reports_store.insert_version(_row(org, "r")) + await reports_store.insert_version({**_row(org, "kept"), "namespace": "other"}) + await steps_ledgers.delete_knowledge_reports_by_namespace(org, NS) + assert await reports_store.latest(org, NS, "r") is None + assert await reports_store.latest(org, "other", "kept") is not None + rows = await get_client().query_all( + "SELECT count() AS n FROM loom.knowledge_reports WHERE org = {org:String}" + " AND namespace = {ns:String}", + {"org": org, "ns": NS}, + ) + assert rows[0]["n"] == 0 diff --git a/tests/integration/test_read_scope_isolation.py b/tests/integration/test_read_scope_isolation.py index 2b0d4a6cbc4..22d1ed7ff85 100644 --- a/tests/integration/test_read_scope_isolation.py +++ b/tests/integration/test_read_scope_isolation.py @@ -60,11 +60,13 @@ # Required fields whose name other ops use for another shape: filled only when the -# required field has this container type (a schema's fields, a policy's rule). +# required field has this container type (a schema's fields, a policy's rule, a +# report's evidence references). _SHAPED_HINTS: dict[str, tuple[type, Any]] = { "fields": (list, [{"name": "canary"}]), "actions": (list, ["memory.set"]), "condition": (dict, {"op": "formerly", "within": "1h", "operation": "memory.set"}), + "evidence": (list, ["run:canary"]), } diff --git a/tests/unit/snapshots/sdk_public_api.json b/tests/unit/snapshots/sdk_public_api.json index 8c00a194551..9f4e7d8e9b6 100644 --- a/tests/unit/snapshots/sdk_public_api.json +++ b/tests/unit/snapshots/sdk_public_api.json @@ -963,6 +963,26 @@ "body", "options" ], + "reports_evidence": [ + "body", + "options" + ], + "reports_get": [ + "body", + "options" + ], + "reports_list": [ + "body", + "options" + ], + "reports_submit": [ + "body", + "options" + ], + "reports_update": [ + "body", + "options" + ], "restore": [ "body", "options" diff --git a/tests/unit/test_cell_scan_tables.py b/tests/unit/test_cell_scan_tables.py index 0305405d415..d3d969d2f9a 100644 --- a/tests/unit/test_cell_scan_tables.py +++ b/tests/unit/test_cell_scan_tables.py @@ -97,6 +97,7 @@ "loom.knowledge_ingest_cancels", "loom.knowledge_ingestions", "loom.knowledge_mirrors", + "loom.knowledge_reports", "loom.knowledge_source_listings", "loom.knowledge_source_push", "loom.knowledge_sources", diff --git a/tests/unit/test_erasure_knowledge_reports_sql.py b/tests/unit/test_erasure_knowledge_reports_sql.py new file mode 100644 index 00000000000..ca9fc5db72d --- /dev/null +++ b/tests/unit/test_erasure_knowledge_reports_sql.py @@ -0,0 +1,157 @@ +"""A user erasure clears a maintainer from the knowledge reports they wrote on, run as real +SQL on clickhouse-local. A version's `actor` is the token's principal, such as an end +user's `human:user:` or a service account's `process:sa:`, and `written_by` the +person it stands for, which the erasure matches. A resolution with no target is the +maintainer's words and goes with them. The reporter's versions and words stay.""" + +from __future__ import annotations + +from collections.abc import AsyncIterator, Callable +from contextlib import asynccontextmanager +from pathlib import Path +from typing import Any + +import pytest + +from server.core import lease_writes +from server.erasure.store import steps_ledgers as ledger_steps +from server.erasure.store.predicates import REPORT_PERSON +from tests.unit.clickhouse_local import CLICKHOUSE, KeptCH, ddl + +pytestmark = pytest.mark.skipif(CLICKHOUSE is None, reason="clickhouse binary not installed") + +NAMED = f"SELECT count() AS n FROM loom.knowledge_reports WHERE org = 'o' AND {REPORT_PERSON}" +FAQ = "See the billing FAQ." + + +def _versions(*rows: str) -> str: + """Every version in one part, not folded on insert: the test reads each version, and a + later local process may merge separate parts down to each report's newest.""" + return ( + "INSERT INTO loom.knowledge_reports (org, namespace, report_id, version, kind, state," + " target_kind, problem, related, reporter, reason, reason_by, resolution_revision," + " actor, written_by, created_at) SETTINGS optimize_on_insert = 0 VALUES " + ", ".join(rows) + ) + + +def _version( + report_id: str, + version: int, + actor: str, + writer: str, + *, + reason: str = "", + reason_by: str = "", + target_kind: str = "memory", + resolution: str = "", + related: tuple[str, ...] = (), +) -> str: + links = ", ".join(f"'{r}'" for r in related) + return ( + f"('o', 'ns', '{report_id}', {version}, 'incorrect', 'open', '{target_kind}'," + f" 'The price changed.', [{links}], 'alice', '{reason}', '{reason_by}'," + f" '{resolution}', '{actor}', '{writer}', now64(3))" + ) + + +@pytest.fixture +def unfenced(monkeypatch: pytest.MonkeyPatch) -> None: + @asynccontextmanager + async def fenced(name: str, **_: Any) -> AsyncIterator[Callable[[bool], None]]: + yield lambda _uncertain: None + + monkeypatch.setattr(lease_writes, "fenced", fenced) + + +@pytest.mark.asyncio +@pytest.mark.usefixtures("unfenced") +async def test_an_end_user_maintainer_is_cleared_from_every_version(tmp_path: Path) -> None: + ch = KeptCH( + tmp_path, + ddl("knowledge_reports"), + _versions( + _version("r1", 1, "human:alice", "alice"), + # erin asked for evidence without taking the report; alice's version carries it. + _version("r1", 2, "human:user:erin", "erin", reason="Which invoice?", reason_by="erin"), + _version("r1", 3, "human:alice", "alice", reason="Which invoice?", reason_by="erin"), + # erin only linked a related report: her name is the writer and nothing else. + _version("r2", 1, "human:alice", "alice"), + _version("r2", 2, "human:user:erin", "erin"), + # erin linked another through her service account, whose principal is not her name. + _version("r5", 1, "human:alice", "alice"), + _version("r5", 2, "process:sa:erin-bot", "erin"), + ), + ) + erin = {"spellings": ["erin"]} + assert (await ch.query_one(NAMED, erin))["n"] == 4 + + await ledger_steps.delete_knowledge_reports_by_user("o", ["erin"], ch=ch) + + assert (await ch.query_one(NAMED, erin))["n"] == 0 + rows = await ch.query_all( + "SELECT report_id, version, problem, reason, reason_by, actor, written_by" + " FROM loom.knowledge_reports ORDER BY report_id, version" + ) + assert [ + (r["report_id"], r["version"], r["actor"], r["written_by"], r["reason_by"]) for r in rows + ] == [ + ("r1", 1, "human:alice", "alice", ""), + ("r1", 2, "", "", ""), + ("r1", 3, "human:alice", "alice", ""), + ("r2", 1, "human:alice", "alice", ""), + ("r2", 2, "", "", ""), + ("r5", 1, "human:alice", "alice", ""), + ("r5", 2, "", "", ""), + ] + assert {r["reason"] for r in rows} == {""} + assert {r["problem"] for r in rows} == {"The price changed."} + + +@pytest.mark.asyncio +@pytest.mark.usefixtures("unfenced") +async def test_a_targetless_resolution_goes_with_its_author(tmp_path: Path) -> None: + ch = KeptCH( + tmp_path, + ddl("knowledge_reports"), + _versions( + _version("r3", 1, "human:alice", "alice", target_kind=""), + # erin resolved a missing-knowledge report in her own words; mark's link carried them. + _version( + "r3", 2, "human:erin", "erin", target_kind="", resolution=FAQ, reason_by="erin" + ), + _version( + "r3", + 3, + "human:mark", + "mark", + target_kind="", + resolution=FAQ, + reason_by="erin", + related=("r4",), + ), + # A target's resolution is the checked revision number, no one's words. + _version("r4", 1, "human:alice", "alice"), + _version("r4", 2, "human:erin", "erin", resolution="7"), + ), + ) + erin = {"spellings": ["erin"]} + assert (await ch.query_one(NAMED, erin))["n"] == 3 + + await ledger_steps.delete_knowledge_reports_by_user("o", ["erin"], ch=ch) + + assert (await ch.query_one(NAMED, erin))["n"] == 0 + rows = await ch.query_all( + "SELECT report_id, version, resolution_revision, reason_by, related, actor" + " FROM loom.knowledge_reports ORDER BY report_id, version" + ) + assert [ + (r["report_id"], r["version"], r["resolution_revision"], r["reason_by"], r["actor"]) + for r in rows + ] == [ + ("r3", 1, "", "", "human:alice"), + ("r3", 2, "", "", ""), + ("r3", 3, "", "", "human:mark"), + ("r4", 1, "", "", "human:alice"), + ("r4", 2, "7", "", ""), + ] + assert rows[2]["related"] == ["r4"] diff --git a/tests/unit/test_erasure_step_order.py b/tests/unit/test_erasure_step_order.py index 1d58f7efba4..4ab9fe0f1bf 100644 --- a/tests/unit/test_erasure_step_order.py +++ b/tests/unit/test_erasure_step_order.py @@ -160,6 +160,15 @@ def _push_delete(namespaces: int) -> tuple[str, tuple[tuple[str, str], ...]]: ("memory_exposures.delete", ((D, "loom.memory_exposures"),)), ("code_search_trace.delete", ((D, "loom.code_search_trace"),)), ("search_misses.delete", ((D, "loom.knowledge_gaps"), (D, "loom.search_misses"))), + ( + "knowledge_reports.delete", + ( + ("OTHER", "INSERT"), # the reports' write fence + (D, "loom.knowledge_reports"), + (U, "loom.knowledge_reports"), + (D, "loom._migration_lock"), + ), + ), ("events.delete", ((D, "loom.events"),)), ("delete_version_checks.delete", ((D, "loom.delete_version_checks"),)), ("memory_webhook_outbox.delete", ((D, "loom.memory_webhook_outbox"),)), @@ -259,6 +268,10 @@ def _push_delete(namespaces: int) -> tuple[str, tuple[tuple[str, str], ...]]: ("code_search_trace.delete", ((D, "loom.code_search_trace"), (D, "loom.code_search_outcome"))), ("search_misses.delete", ((D, "loom.search_misses"),)), ("knowledge_gaps.delete", ((D, "loom.knowledge_gaps"),)), + ( + "knowledge_reports.delete", + (("OTHER", "INSERT"), (D, "loom.knowledge_reports"), (D, "loom._migration_lock")), + ), ("events.delete", ((D, "loom.events"),)), ("memory_drops.delete", ((D, "loom.memory_drops"),)), ("delete_version_checks.delete", ((D, "loom.delete_version_checks"),)), @@ -384,6 +397,10 @@ def _push_delete(namespaces: int) -> tuple[str, tuple[tuple[str, str], ...]]: ("code_search_trace.delete", ((D, "loom.code_search_trace"), (D, "loom.code_search_outcome"))), ("search_misses.delete", ((D, "loom.search_misses"),)), ("knowledge_gaps.delete", ((D, "loom.knowledge_gaps"),)), + ( + "knowledge_reports.delete", + (("OTHER", "INSERT"), (D, "loom.knowledge_reports"), (D, "loom._migration_lock")), + ), ("events.delete", ((D, "loom.events"),)), ("memory_drops.delete", ((D, "loom.memory_drops"),)), ("delete_version_checks.delete", ((D, "loom.delete_version_checks"),)), @@ -577,6 +594,15 @@ def _push_delete(namespaces: int) -> tuple[str, tuple[tuple[str, str], ...]]: ("memory_exposures.delete", ((D, "loom.memory_exposures"),)), ("code_search_trace.delete", ((D, "loom.code_search_trace"),)), ("search_misses.delete", ((D, "loom.knowledge_gaps"), (D, "loom.search_misses"))), + ( + "knowledge_reports.delete", + ( + ("OTHER", "INSERT"), # the reports' write fence + (D, "loom.knowledge_reports"), + (U, "loom.knowledge_reports"), + (D, "loom._migration_lock"), + ), + ), ("events.delete", ((D, "loom.events"),)), ("delete_version_checks.delete", ((D, "loom.delete_version_checks"),)), ("memory_webhook_outbox.delete", ((D, "loom.memory_webhook_outbox"),)), diff --git a/tests/unit/test_erasure_verify.py b/tests/unit/test_erasure_verify.py index ba84219e5f7..08a56b2e564 100644 --- a/tests/unit/test_erasure_verify.py +++ b/tests/unit/test_erasure_verify.py @@ -137,7 +137,7 @@ def test_census_covers_every_substrate_and_uses_final_on_soft_deleted_tables() - out = asyncio.run(erasure_census.residue_census("o", "namespace", "ns", ch=ch)) assert set(out) == set(erasure_census.census_tables("namespace")) # every namespace-scoped substrate, entity, cache, chunk-link and code table - assert len(out) == 74 and sum(out.values()) == 0 + assert len(out) == 75 and sum(out.values()) == 0 by_table = {sql.split("FROM ")[1].split()[0]: sql for sql, _ in ch.query_one_calls} assert ( " FINAL" in by_table["loom.memory"] and "tombstoned_at IS NULL" in by_table["loom.memory"] @@ -218,7 +218,7 @@ def test_census_user_scope_skips_namespace_only_tables() -> None: "loom.task_events", } <= set(out) assert "loom.memory_answers" not in out - assert len(out) == 55 + assert len(out) == 56 assert "loom.blob_uploads" in out # who uploaded what: the user's go # the user's supporter rows, and any bot-rule candidate left with no supporter assert {"loom.learnings_queue", "loom.learnings_supporters"} <= set(out) diff --git a/tests/unit/test_every_list_is_projectable.py b/tests/unit/test_every_list_is_projectable.py index 85b3729bd56..cb5f24866bf 100644 --- a/tests/unit/test_every_list_is_projectable.py +++ b/tests/unit/test_every_list_is_projectable.py @@ -39,6 +39,7 @@ def _wire_model_files() -> list[Path]: "CollectionListInput": "four short fields per collection; a page is read whole", "BlacklistListInput": "a short admin list; no page reads it in part", "KnowledgeGapsListInput": "a short admin list of at most 200 gaps; the tile reads it whole", + "KnowledgeReportsListInput": "an admin queue of at most 200 short rows that carry no text", "CodeHistoryInput": "a per-file history read whole", "CodeSymbolHistoryInput": "a per-symbol history read whole", "ConflictsAllowlistListInput": "a short admin list", diff --git a/tests/unit/test_knowledge_report_refs.py b/tests/unit/test_knowledge_report_refs.py new file mode 100644 index 00000000000..b72a5ce2b91 --- /dev/null +++ b/tests/unit/test_knowledge_report_refs.py @@ -0,0 +1,52 @@ +"""A report reference is readable when what it points at exists for the caller: a run of +the namespace, the reflection memory at that key under the report's identity tuple, and a +gap of the latest build, for an admin only.""" + +from __future__ import annotations + +import asyncio +from typing import Any + +import pytest + +from server.knowledge.app import report_refs + +ROW = {"org": "o", "namespace": "ns", "agent": "a", "user_id": "bob", "session_id": "s1"} + + +@pytest.fixture +def held(monkeypatch: pytest.MonkeyPatch) -> list[tuple[str, ...]]: + """What exists: runs, reflection keys and gaps; returns each lookup made.""" + asked: list[tuple[str, ...]] = [] + + async def run_exists(org: str, namespace: str, run_id: str) -> bool: + asked.append(("run", org, namespace, run_id)) + return run_id == "r1" + + async def readable_version(input: Any) -> tuple[int, str] | None: + asked.append(("memory", input.user_id, input.session_id, input.memory_key)) + return (1, "a" * 64) if input.memory_key == "reflection:r1" else None + + async def gap_for_draft(org: str, namespace: str, gap_id: str) -> dict[str, Any] | None: + asked.append(("gap", gap_id)) + return {"head": "x"} if gap_id == "g1" else None + + monkeypatch.setattr("server.tasks.app.run.run_exists", run_exists) + monkeypatch.setattr("server.memory.app.handlers.readable_version", readable_version) + monkeypatch.setattr(report_refs.gaps_store, "gap_for_draft", gap_for_draft) + return asked + + +def test_each_kind_is_read_as_its_own_op_reads_it(held: list[tuple[str, ...]]) -> None: + refs = ["run:r1", "run:r2", "reflection:r1", "reflection:r2", "gap:g1", "gap:g2", "x:1"] + got = asyncio.run(report_refs.readable(ROW, refs, admin=True)) + assert got == ["run:r1", "reflection:r1", "gap:g1"] + assert ("run", "o", "ns", "r1") in held + # The reflection is read under the report's identity tuple, at the reference as its key. + assert ("memory", "bob", "s1", "reflection:r1") in held + + +def test_a_gap_is_read_only_by_an_admin(held: list[tuple[str, ...]]) -> None: + assert asyncio.run(report_refs.readable(ROW, ["gap:g1", "run:r1"], admin=False)) == ["run:r1"] + # Not even looked up for a caller who may not read it. + assert not [a for a in held if a[0] == "gap"] diff --git a/tests/unit/test_knowledge_reports.py b/tests/unit/test_knowledge_reports.py new file mode 100644 index 00000000000..7a489f7b664 --- /dev/null +++ b/tests/unit/test_knowledge_reports.py @@ -0,0 +1,1135 @@ +"""Knowledge reports: filing one (the reporter from the token, the target read check, the +id a retry repeats), who reads it, the maintainers' actions, the reporter's evidence, the +queue without anyone's words, and the rollout gate.""" + +from __future__ import annotations + +import asyncio +import json +from collections.abc import AsyncIterator +from contextlib import asynccontextmanager +from pathlib import Path +from typing import Any +from unittest.mock import AsyncMock + +import pytest +from pydantic import ValidationError as PydanticValidationError + +from server.auth.jwt import AuthInfo +from server.core import grant_cache +from server.core.errors import ( + AuthInsufficientError, + BackendUnavailableError, + ErasureRunningError, + NotFoundError, + OverloadedError, + PreconditionFailedError, + ValidationError, +) +from server.identity.domain.read_scope import honours_read_scope +from server.knowledge.api.models_reports import ( + KnowledgeReport, + KnowledgeReportsEvidenceInput, + KnowledgeReportsGetInput, + KnowledgeReportsListInput, + KnowledgeReportsSubmitInput, + KnowledgeReportsUpdateInput, +) +from server.knowledge.app import document_reads, source_access, source_documents +from server.knowledge.app import reports as reports_app +from server.knowledge.app.people import PersonUnresolved +from server.knowledge.domain import reports as rules +from server.knowledge.store import reports as reports_store +from server.operations.base import Role, grant_rank + +_EVERY_REPLICA = reports_app.every_replica_stores_reports + +ORG, NS = "o", "ns" + + +def _auth(subject: str, role: Role = Role.WRITER) -> AuthInfo: + return AuthInfo( + subject=subject, org=ORG, namespaces=(NS,), roles=(role,), is_service_account=False + ) + + +class _Store: + """loom.knowledge_reports as its latest versions.""" + + def __init__(self) -> None: + self.rows: dict[str, dict[str, Any]] = {} + self.inserts: list[dict[str, Any]] = [] + self.fences: list[list[str]] = [] + # References nothing points at; a gap is read only by an admin. + self.missing: set[str] = set() + self.marks: list[bool] = [] + + async def latest(self, org: str, namespace: str, report_id: str, **_: Any) -> Any: + row = self.rows.get(report_id) + return dict(row) if row else None + + async def latest_many(self, org: str, namespace: str, ids: list[str], **_: Any) -> Any: + return [dict(self.rows[i]) for i in ids if i in self.rows] + + async def insert_version(self, row: dict[str, Any], **_: Any) -> None: + self.inserts.append(dict(row)) + current = self.rows.get(row["report_id"]) + if current is None or row["version"] >= current["version"]: + self.rows[row["report_id"]] = dict(row) + + async def list_reports(self, org: str, namespace: str, **_: Any) -> Any: + return sorted(self.rows.values(), key=lambda r: r["updated_at"], reverse=True) + + +@pytest.fixture +def store(monkeypatch: pytest.MonkeyPatch) -> _Store: + s = _Store() + for name in ("latest", "latest_many", "insert_version", "list_reports"): + monkeypatch.setattr(reports_store, name, getattr(s, name)) + monkeypatch.setattr(reports_app, "every_replica_stores_reports", AsyncMock(return_value=True)) + + @asynccontextmanager + async def holding(name: str, **_: Any) -> AsyncIterator[bool]: + yield True + + monkeypatch.setattr(reports_app.leases, "holding", holding) + + @asynccontextmanager + async def fenced(names: list[str], **_: Any) -> AsyncIterator[Any]: + s.fences.append(names) + yield s.marks.append + + monkeypatch.setattr(reports_app.lease_writes, "fenced_many", fenced) + + async def readable(row: dict[str, Any], refs: list[str], *, admin: bool) -> list[str]: + return [r for r in refs if r not in s.missing and (admin or not r.startswith("gap:"))] + + monkeypatch.setattr(reports_app.report_refs, "readable", readable) + + async def same(org: str, subject: str) -> str: + return subject + + monkeypatch.setattr(reports_app, "folded_person", same) + _erasures(monkeypatch, []) + return s + + +def _erasures(monkeypatch: pytest.MonkeyPatch, answers: list[bool]) -> list[set[str] | None]: + """Answer the fence's erasure reads in order (False once they run out); returns the + people each read asked about.""" + asked: list[set[str] | None] = [] + + async def since(org: str, namespace: str, since_s: int, people: set[str] | None) -> bool: + asked.append(people) + return answers.pop(0) if answers else False + + monkeypatch.setattr("server.knowledge.app.gaps.erasure_since", since) + return asked + + +def _as(monkeypatch: pytest.MonkeyPatch, subject: str, role: Role = Role.WRITER) -> None: + auth = _auth(subject, role) + monkeypatch.setattr("server.auth.context.current_auth", lambda: auth) + + +def _target(monkeypatch: pytest.MonkeyPatch, state: tuple[int, str] | None) -> None: + """The target reads as `state`; a memory key is found in the row the report names.""" + + async def now(row: dict[str, Any], *, exact: bool = True) -> Any: + if not row["target_kind"]: + return reports_app._Target(0, "") + if state is None: + return None + tuple_ = (row["agent"], row["user_id"], row["session_id"]) + return reports_app._Target(*state, tuple_ if row["target_kind"] == "memory" else None) + + monkeypatch.setattr(reports_app, "_target_now", now) + + +def _submit(**kw: Any) -> Any: + body = { + "org": ORG, + "namespace": NS, + "agent": "claude-code", + "kind": "incorrect", + "target_kind": "memory", + "target_key": "pricing/plan", + "problem": "The plan price changed in March.", + **kw, + } + return asyncio.run( + reports_app.handle_knowledge_reports_submit(KnowledgeReportsSubmitInput(**body)) + ) + + +def _update(**kw: Any) -> Any: + return asyncio.run( + reports_app.handle_knowledge_reports_update( + KnowledgeReportsUpdateInput(org=ORG, namespace=NS, **kw) + ) + ) + + +def _get(report_id: str) -> Any: + return asyncio.run( + reports_app.handle_knowledge_reports_get( + KnowledgeReportsGetInput(org=ORG, namespace=NS, report_id=report_id) + ) + ) + + +def _list(**kw: Any) -> list[Any]: + return asyncio.run( + reports_app.handle_knowledge_reports_list( + KnowledgeReportsListInput(org=ORG, namespace=NS, **kw) + ) + ).reports + + +def _known(monkeypatch: pytest.MonkeyPatch, known: set[str]) -> None: + """The document addresses the caller may know of are those in `known`.""" + + async def known_documents(org: str, namespace: str, uris: list[str]) -> set[str]: + return {u for u in uris if u in known} + + monkeypatch.setattr(document_reads, "known_documents", known_documents) + + +def test_the_migration_constant_names_the_table_s_file() -> None: + migrations = Path(__file__).resolve().parents[2] / "schemas" / "migrations" + assert (migrations / f"{reports_app.REPORTS_MIGRATION:03d}_knowledge_reports.sql").exists() + + +class _Fleet: + """Live beats as `instances.read_live` reads them: this deployment kind, or every kind.""" + + def __init__(self, rows: list[dict[str, Any]]) -> None: + self.rows = rows + + async def query_all(self, sql: str, params: dict[str, Any], **_: Any) -> list[dict[str, Any]]: + return [ + r + for r in self.rows + if params.get("all_deployments") or r["deployment"] == params["dep"] + ] + + +@pytest.mark.parametrize("deployment", [False, True]) +def test_submit_waits_for_an_older_replica_of_the_other_deployment_kind( + store: _Store, monkeypatch: pytest.MonkeyPatch, deployment: bool +) -> None: + from server.core import ch, instances + from server.settings import settings + + at = reports_app.REPORTS_MIGRATION + fleet = _Fleet( + [ + {"deployment": int(deployment), "schema_version": at}, + {"deployment": int(not deployment), "schema_version": at - 1}, + ] + ) + monkeypatch.setattr(settings, "deployment", deployment) + monkeypatch.setattr(ch, "get_client", lambda: fleet) + monkeypatch.setattr(instances, "live_rows", lambda: [{"schema_version": at}]) + monkeypatch.setattr(reports_app, "every_replica_stores_reports", _EVERY_REPLICA) + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + with pytest.raises(OverloadedError): + _submit() + assert store.inserts == [] + fleet.rows[1]["schema_version"] = at + assert _submit().state == "open" + + +async def test_writes_wait_while_the_fleet_is_unread(monkeypatch: pytest.MonkeyPatch) -> None: + from server.core import ch + + monkeypatch.setattr(ch, "get_client", lambda: _Fleet([])) + assert not await _EVERY_REPLICA() + + +def test_submit_refuses_while_an_older_replica_serves( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + monkeypatch.setattr(reports_app, "every_replica_stores_reports", AsyncMock(return_value=False)) + with pytest.raises(OverloadedError): + _submit() + assert store.inserts == [] + + +def test_a_narrowed_token_cannot_reach_reports() -> None: + for op in ("submit", "get", "list", "update", "evidence"): + assert not honours_read_scope(f"knowledge.reports.{op}") + + +def test_submit_files_an_open_report_under_the_token_s_person( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + out = _submit(user_id="bob", evidence=["run:r1", "reflection:r1", "run:r1"]) + assert (out.state, out.version) == ("open", 1) + row = store.rows[out.report_id] + # The reporter is the token's person, never a body field. + assert row["reporter"] == "alice" and row["user_id"] == "bob" + # What the reporter did not say it read is stamped from the target now. + assert (row["target_version"], row["target_sha256"]) == (3, "a" * 64) + assert row["evidence"] == ["run:r1", "reflection:r1"] + assert row["assignee"] == "" and row["reason"] == "" + + +def test_a_retry_files_the_same_report_once(store: _Store, monkeypatch: pytest.MonkeyPatch) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + first = _submit() + again = _submit(problem=" The plan price changed in March. ") + assert again.report_id == first.report_id and len(store.inserts) == 1 + other = _submit(problem="The plan was renamed.") + assert other.report_id != first.report_id + _as(monkeypatch, "carol") + assert _submit().report_id != first.report_id + + +def test_the_same_key_in_two_rows_is_two_reports( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + bob = _submit(user_id="bob") + assert _submit(user_id="bob").report_id == bob.report_id + others = { + _submit(user_id="carl").report_id, + _submit(user_id="bob", agent="other-agent").report_id, + _submit(user_id="bob", session_id="s2").report_id, + } + assert bob.report_id not in others and len(others) == 3 + assert {r["user_id"] for r in store.rows.values()} == {"bob", "carl"} + # A document is read by its URI alone, so the tuple does not split its reports. + doc = {"target_kind": "document", "target_key": "gdrive://doc"} + assert _submit(**doc, user_id="bob").report_id == _submit(**doc, user_id="carl").report_id + + +def test_two_agents_that_read_one_row_file_one_report_bound_to_it( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + from types import SimpleNamespace + + from server.memory.app import handlers + + # bob's only row at the key, written by the mcp agent in session s1. + stored = SimpleNamespace( + version=4, value={"text": "x"}, agent="mcp", user_id="bob", session_id="s1" + ) + lookups: list[tuple[str, str, bool]] = [] + + async def lookup(identity: Any, input: Any, *, wide: bool = True) -> Any: + lookups.append((identity.agent, identity.session_id, wide)) + if (identity.agent, identity.user_id, identity.session_id) == ("mcp", "bob", "s1"): + return stored + # memory.get falls back to the same user's row under any agent and session. + return stored if wide and identity.user_id == "bob" else None + + monkeypatch.setattr(handlers, "_point_lookup", lookup) + _as(monkeypatch, "alice") + first = _submit(agent="claude-code", user_id="bob") + again = _submit(agent="cursor", user_id="bob") + assert again.report_id == first.report_id and len(store.inserts) == 1 + row = store.rows[first.report_id] + assert (row["agent"], row["user_id"], row["session_id"]) == ("mcp", "bob", "s1") + # Later reads look in that row only, never another row of bob's the fallback finds. + _as(monkeypatch, "maria", Role.ADMIN) + assert _get(first.report_id).report.target_readable + assert lookups[-1] == ("mcp", "s1", False) + + +def test_a_wildcard_agent_binds_the_report_to_a_row_of_its_own_user( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + from types import SimpleNamespace + + from server.memory.app import handlers + + carol = SimpleNamespace( + version=6, value={"t": "c"}, agent="mcp", user_id="carol", session_id="s9" + ) + bob = SimpleNamespace(version=4, value={"t": "b"}, agent="cli", user_id="bob", session_id="s1") + newest = [carol] + + async def lookup(identity: Any, input: Any, *, wide: bool = True) -> Any: + # agent "*" drops every identity filter: the newest row at the key, any user's. + return newest[0] if identity.agent == "*" else None + + monkeypatch.setattr(handlers, "_point_lookup", lookup) + _as(monkeypatch, "alice") + with pytest.raises(NotFoundError): + _submit(agent="*", user_id="bob") + assert store.inserts == [] + newest[0] = bob + row = store.rows[_submit(agent="*", user_id="bob").report_id] + assert (row["agent"], row["user_id"], row["session_id"]) == ("cli", "bob", "s1") + + +@pytest.mark.parametrize( + ("body", "message"), + [ + ({"target_kind": "", "target_key": ""}, "names the memory or document"), + ({"target_kind": "", "target_key": "k"}, "needs target_kind"), + ({"evidence": ["note:hello"]}, "is not gap:"), + ], +) +def test_submit_refuses_a_broken_report( + store: _Store, monkeypatch: pytest.MonkeyPatch, body: dict[str, Any], message: str +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + with pytest.raises(ValidationError, match=message): + _submit(**body) + assert store.inserts == [] + + +def test_a_target_version_above_uint64_is_refused_before_any_write() -> None: + body = {"org": ORG, "namespace": NS, "kind": "incorrect", "problem": "Wrong."} + target = {"target_kind": "memory", "target_key": "pricing/plan"} + top = 2**64 - 1 # loom.knowledge_reports.target_version is UInt64 + for sent in (top, str(top)): + submitted = KnowledgeReportsSubmitInput(**body, **target, target_version=sent) + assert submitted.target_version == top + for bad in (top + 1, str(top + 1), -1, "-1", "1e3", " 7", "١٢", ""): + with pytest.raises(PydanticValidationError, match="target_version"): + KnowledgeReportsSubmitInput(**body, **target, target_version=bad) + + +def test_a_memory_version_above_2_53_stays_exact_from_submit_to_get( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + # A nanosecond memory version: a JavaScript number would read it as ...000. + exact = 1_800_000_000_000_000_001 + _as(monkeypatch, "alice") + _target(monkeypatch, (exact, "a" * 64)) + body = { + "org": ORG, + "namespace": NS, + "agent": "claude-code", + "kind": "outdated", + "target_kind": "memory", + "target_key": "pricing/plan", + "target_version": str(exact), + "problem": "The plan price changed in March.", + } + submitted = KnowledgeReportsSubmitInput.model_validate_json(json.dumps(body)) + rid = asyncio.run(reports_app.handle_knowledge_reports_submit(submitted)).report_id + assert store.rows[rid]["target_version"] == exact + _as(monkeypatch, "maria", Role.ADMIN) + report = json.loads(_get(rid).model_dump_json())["report"] + assert report["target_version_text"] == str(exact) + assert report["target_changed"] is False + listed = asyncio.run( + reports_app.handle_knowledge_reports_list(KnowledgeReportsListInput(org=ORG, namespace=NS)) + ) + assert json.loads(listed.model_dump_json())["reports"][0]["target_version_text"] == str(exact) + + +def test_a_missing_knowledge_report_names_no_target( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, None) + out = _submit(kind="missing", target_kind="", target_key="", problem="No refund policy.") + assert store.rows[out.report_id]["target_kind"] == "" + + +def test_a_target_the_reporter_cannot_read_is_not_found( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, None) + with pytest.raises(NotFoundError): + _submit() + assert store.inserts == [] + + +def test_related_reports_must_exist_and_not_be_the_report( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + with pytest.raises(ValidationError, match="was not found"): + _submit(related=["nope"]) + first = _submit() + second = _submit(problem="Also the currency.", related=[first.report_id]) + assert store.rows[second.report_id]["related"] == [first.report_id] + with pytest.raises(ValidationError, match="itself"): + _update(report_id=first.report_id, related=[first.report_id]) + + +def test_a_report_links_only_reports_its_caller_can_read( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + alices = _submit().report_id + _as(monkeypatch, "carol") + # Another reporter's report is refused as a missing one is, so a link cannot probe ids. + refusals = [] + for rid in (alices, "nope"): + with pytest.raises(ValidationError, match="was not found") as refused: + _submit(problem="Also the currency.", related=[rid]) + refusals.append(str(refused.value).replace(rid, "")) + assert refusals[0] == refusals[1] + assert store.inserts and all(r["reporter"] == "alice" for r in store.inserts) + carols = _submit(problem="Also the currency.").report_id + linked = _submit(problem="And the tax.", related=[carols]).report_id + assert store.rows[linked]["related"] == [carols] + # A maintainer reads every report, so links any. + _as(monkeypatch, "maria", Role.ADMIN) + _update(report_id=carols, related=[alices]) + assert store.rows[carols]["related"] == [alices] + + +def test_a_report_serves_only_the_related_reports_its_caller_can_read( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + alices = _submit().report_id + _as(monkeypatch, "carol") + carols = _submit(problem="Also the currency.").report_id + _as(monkeypatch, "maria", Role.ADMIN) + _update(report_id=carols, related=[alices]) + assert _get(carols).report.related == [alices] + # Carol reads her report but not alice's, so its link does not say alice's exists. + _as(monkeypatch, "carol") + assert _get(carols).report.related == [] + assert store.rows[carols]["related"] == [alices] + + +def test_only_the_reporter_and_maintainers_read_a_report( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit(suggested_correction="It is $20 now.").report_id + mine = _get(rid) + assert mine.found and mine.report.problem.startswith("The plan price") + assert mine.report.suggested_correction == "It is $20 now." + _as(monkeypatch, "carol") + assert _get(rid).found is False + _as(monkeypatch, "maria", Role.ADMIN) + assert _get(rid).report.reporter == "alice" + assert _get("missing").found is False + + +def test_a_lowered_grant_ends_an_admin_token_s_reading( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit().report_id + ranks = {NS: grant_rank("admin")} + + async def grants(org: str, subject: str) -> grant_cache.GrantMap: + return grant_cache.GrantMap(ranks=ranks if subject == "maria" else {}) + + monkeypatch.setattr(grant_cache, "_read", grants) + grant_cache.clear() + _as(monkeypatch, "maria", Role.ADMIN) + assert _get(rid).found + # The token still claims admin; the live grant fell to viewer. + ranks[NS] = grant_rank("viewer") + grant_cache.clear() + assert _get(rid).found is False + + +def test_a_changed_or_unreadable_target_shows_as_such( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit().report_id + _as(monkeypatch, "maria", Role.ADMIN) + assert _get(rid).report.target_changed is False + _target(monkeypatch, (4, "b" * 64)) + assert _get(rid).report.target_changed is True + _update(report_id=rid, action="request_evidence", reason="Section 3 still says $10.") + assert _get(rid).report.reason == "Section 3 still says $10." + # A maintainer who cannot read the target now sees the report without its words, a + # maintainer's reason included: it may quote the target as the problem may. + _target(monkeypatch, None) + hidden = _get(rid).report + assert hidden.target_changed and not hidden.target_readable + assert hidden.problem == "" and hidden.suggested_correction == "" and hidden.reason == "" + # The reporter keeps reading their own words, and only those. + _as(monkeypatch, "alice") + own = _get(rid).report + assert own.problem != "" and own.reason == "" + + +def test_a_document_s_address_is_served_only_to_whoever_may_know_it( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + uri = "drive://plans/q3.md" + _as(monkeypatch, "alice") + _target(monkeypatch, (7, "a" * 64)) + rid = _submit(target_kind="document", target_key=uri, target_version=7).report_id + # A mirrored document whose access list leaves maria out: neither get nor the queue + # names it or its revision, and a filter on its address finds nothing. + _target(monkeypatch, None) + _known(monkeypatch, set()) + _as(monkeypatch, "maria", Role.ADMIN) + hidden = _get(rid).report + assert (hidden.target_key, hidden.target_version, hidden.target_version_text) == ("", 0, "0") + assert [(r.report_id, r.target_key, r.target_version) for r in _list()] == [(rid, "", 0)] + assert _list(target_key=uri) == [] + # A maintainer who may know the document sees its address. + _known(monkeypatch, {uri}) + assert _get(rid).report.target_key == uri + assert [r.target_key for r in _list(target_key=uri)] == [uri] + # Its reporter wrote the address, so always reads it. + _known(monkeypatch, set()) + _as(monkeypatch, "alice") + assert _get(rid).report.target_key == uri + + +def test_a_document_is_known_by_its_namespace_or_its_access_list( + monkeypatch: pytest.MonkeyPatch, +) -> None: + plan = source_access.ReadPlan(ORG) + monkeypatch.setattr(source_access, "prepare", AsyncMock(return_value=plan)) + reads: list[bool] = [] + + async def documents(org: str, ns: str, uris: list[str], *, include_superseded: bool) -> Any: + reads.append(include_superseded) + return [type("Row", (), {"source_uri": u})() for u in uris if u.startswith("kb://")] + + monkeypatch.setattr("server.knowledge.store.documents.get_many_by_uris", documents) + + asked: list[list[str]] = [] + + async def mirrored(plan: Any, namespace: str, uris: list[str]) -> set[str]: + asked.append(uris) + return {"drive://mine"} & set(uris) + + monkeypatch.setattr(source_documents, "admitted_uris", mirrored) + uris = ["kb://deleted", "drive://mine", "drive://theirs", "kb://deleted"] + # A namespace's own document, deleted ones included, is known to its every reader. + assert asyncio.run(document_reads.known_documents(ORG, NS, uris)) == {"kb://deleted"} + assert reads == [True] and asked == [] + # A mirrored copy is known only where the caller's access list admits it, asked once + # for every address the namespace's documents leave. + plan.marked = True + assert asyncio.run(document_reads.known_documents(ORG, NS, uris)) == { + "kb://deleted", + "drive://mine", + } + assert asked == [["drive://mine", "drive://theirs"]] + + +def test_a_mirrored_address_is_admitted_from_metadata_alone( + monkeypatch: pytest.MonkeyPatch, +) -> None: + plan = source_access.ReadPlan(ORG) + plan._bindings = (("mirror-a", "src", NS), ("mirror-b", "src", "elsewhere")) + discovered: list[list[tuple[str, str]]] = [] + + async def discover(plan: Any, pairs: list[tuple[str, str]]) -> list[dict[str, str]]: + discovered.append(pairs) + return [{"namespace": m, "source_uri": s} for m, s in pairs] + + monkeypatch.setattr(source_documents, "_discover", discover) + listed = {"drive://mine#src", "drive://stale#src"} + + async def check(candidates: list[dict[str, str]], *, chunks: bool = False) -> Any: + return [ + source_access.Admitted(namespace=NS, candidate=c, document={}) + for c in candidates + if c["source_uri"] in listed + ] + + monkeypatch.setattr(plan, "check", check) + monkeypatch.setattr(plan, "current", lambda item: "stale" not in item.candidate["source_uri"]) + + async def no_text(*args: Any, **kwargs: Any) -> Any: + raise AssertionError("an address check reads no document text") + + monkeypatch.setattr(source_documents.store, "contents", no_text) + uris = ["drive://mine", "drive://stale", "drive://theirs"] + # Admitted, with a current proof, and only through this namespace's mirrors: one read + # for the whole page, however many addresses it holds. + assert asyncio.run(source_documents.admitted_uris(plan, NS, uris)) == {"drive://mine"} + assert discovered == [[("mirror-a", f"{u}#src") for u in uris]] + # A failed check admits nothing, as every mirror leg fails closed. + plan.failed = True + assert asyncio.run(source_documents.admitted_uris(plan, NS, uris)) == set() + + +def test_the_queue_carries_no_one_s_words(store: _Store, monkeypatch: pytest.MonkeyPatch) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + _submit(suggested_correction="It is $20 now.") + out = asyncio.run( + reports_app.handle_knowledge_reports_list(KnowledgeReportsListInput(org=ORG, namespace=NS)) + ) + assert len(out.reports) == 1 + assert ( + set(KnowledgeReport.model_fields) & {"problem", "suggested_correction", "reason"} == set() + ) + assert "price" not in out.model_dump_json() + # A row reads no target, so it says nothing of whether the target changed. + assert "target_changed" not in out.reports[0].model_dump() + + +def test_a_maintainer_takes_asks_and_resolves( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit().report_id + _as(monkeypatch, "maria", Role.ADMIN) + assert _update(report_id=rid, action="take").state == "taken" + assert store.rows[rid]["assignee"] == "maria" + with pytest.raises(ValidationError, match="needs a reason"): + _update(report_id=rid, action="request_evidence") + out = _update(report_id=rid, action="request_evidence", reason="Which invoice?") + assert (out.state, out.version) == ("needs_evidence", 3) + with pytest.raises(ValidationError, match="published revision"): + _update(report_id=rid, action="resolve") + _target(monkeypatch, (7, "b" * 64)) + out = _update(report_id=rid, action="resolve", resolution_revision="7") + assert out.state == "resolved" and store.rows[rid]["resolution_revision"] == "7" + with pytest.raises(ValidationError, match="only by reopen"): + _update(report_id=rid, action="take") + assert _update(report_id=rid, action="reopen", reason="Still wrong.").state == "open" + assert store.rows[rid]["assignee"] == "" + + +def test_each_version_is_stamped_with_the_token_that_wrote_it( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit().report_id + _as(monkeypatch, "maria", Role.ADMIN) + _update(report_id=rid, action="request_evidence", reason="Which invoice?") + _as(monkeypatch, "alice") + asyncio.run( + reports_app.handle_knowledge_reports_evidence( + KnowledgeReportsEvidenceInput(org=ORG, namespace=NS, report_id=rid, evidence=["run:r2"]) + ) + ) + assert [(r["version"], r["actor"], r["source_class"]) for r in store.inserts] == [ + (1, "human:alice", "asserted"), + (2, "human:maria", "asserted"), + (3, "human:alice", "asserted"), + ] + + +def test_a_service_account_s_version_names_the_person_behind_it( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit().report_id + linked = _submit(problem="Also the currency.").report_id + bot = AuthInfo( + subject="sa:maria-bot", + org=ORG, + namespaces=(NS,), + roles=(Role.ADMIN,), + is_service_account=True, + creator="maria", + ) + monkeypatch.setattr("server.auth.context.current_auth", lambda: bot) + # The bot links alice's report as a maintainer; its live grant is the gate's to check. + monkeypatch.setattr(reports_app, "_maintainer", AsyncMock(return_value=True)) + # A link names maria nowhere else: the version's writer is what a user erasure matches. + _update(report_id=rid, related=[linked]) + row = store.rows[rid] + assert (row["actor"], row.get("written_by")) == ("process:sa:maria-bot", "maria") + assert [r.get("written_by") for r in store.inserts] == ["alice", "alice", "maria"] + + +@pytest.mark.parametrize( + ("served", "revision", "message"), + [ + ((3, "a" * 64), "3", "no revision newer"), # the target is unchanged + ((7, "b" * 64), "draft-8", "revision number"), + ((7, "b" * 64), "²", "revision number"), # a digit to isdigit(), not to int() + ((7, "b" * 64), "8", "readers are served revision 7"), + # Memory versions come from the clock, so one between the two may never have existed. + ((7, "b" * 64), "5", "readers are served revision 7"), + (None, "7", "target is gone"), + ], +) +def test_a_resolution_names_a_published_correcting_revision( + store: _Store, + monkeypatch: pytest.MonkeyPatch, + served: tuple[int, str] | None, + revision: str, + message: str, +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit().report_id + _as(monkeypatch, "maria", Role.ADMIN) + _target(monkeypatch, served) + with pytest.raises(ValidationError, match=message): + _update(report_id=rid, action="resolve", resolution_revision=revision) + assert store.rows[rid]["state"] == "open" + _target(monkeypatch, (9, "c" * 64)) + assert _update(report_id=rid, action="resolve", resolution_revision="9").state == "resolved" + + +def test_a_reason_names_the_maintainer_who_wrote_it( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit().report_id + _as(monkeypatch, "maria", Role.ADMIN) + # Asked without taking the report: no assignee, but the reason is maria's. + _update(report_id=rid, action="request_evidence", reason="Which invoice?") + assert (store.rows[rid]["assignee"], store.rows[rid]["reason_by"]) == ("", "maria") + _as(monkeypatch, "alice") + asyncio.run( + reports_app.handle_knowledge_reports_evidence( + KnowledgeReportsEvidenceInput(org=ORG, namespace=NS, report_id=rid, evidence=["run:r2"]) + ) + ) + # The reporter's version carries the reason forward and still names who wrote it. + row = store.rows[rid] + assert (row["reason"], row["reason_by"]) == ("Which invoice?", "maria") + assert row["actor"] == "human:alice" + _as(monkeypatch, "maria", Role.ADMIN) + _update(report_id=rid, action="take") + assert (store.rows[rid]["reason"], store.rows[rid]["reason_by"]) == ("", "") + + +def test_a_targetless_resolution_names_the_maintainer_who_wrote_it( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + missing = {"kind": "missing", "target_kind": "", "target_key": ""} + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit(**missing, problem="No refund policy.").report_id + linked = _submit(**missing, problem="No returns page.").report_id + about_memory = _submit().report_id + _as(monkeypatch, "maria", Role.ADMIN) + # Nothing checks a resolution with no target against a revision: it is maria's words. + _update(report_id=rid, action="resolve", resolution_revision="See the billing FAQ.") + row = store.rows[rid] + assert (row["resolution_revision"], row["reason_by"]) == ("See the billing FAQ.", "maria") + # Linking carries the words forward under mark's version, still naming maria. + _as(monkeypatch, "mark", Role.ADMIN) + asked = _erasures(monkeypatch, []) + _update(report_id=rid, related=[linked]) + row = store.rows[rid] + assert (row["resolution_revision"], row["reason_by"]) == ("See the billing FAQ.", "maria") + assert row["actor"] == "human:mark" and "maria" in (asked[-1] or set()) + # A target's resolution is the checked revision number, no one's words. + _target(monkeypatch, (7, "b" * 64)) + _update(report_id=about_memory, action="resolve", resolution_revision="7") + assert store.rows[about_memory]["reason_by"] == "" + + +def test_a_write_carrying_a_reason_stops_at_its_author_s_erasure( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit().report_id + linked = _submit(problem="Also the currency.").report_id + _as(monkeypatch, "maria", Role.ADMIN) + _update(report_id=rid, action="request_evidence", reason="Which invoice?") + + async def maria_erased(org: str, ns: str, since_s: int, people: set[str] | None) -> bool: + return people is None or "maria" in people + + monkeypatch.setattr("server.knowledge.app.gaps.erasure_since", maria_erased) + before = len(store.inserts) + # Both writes copy maria's reason forward: landing after her erasure would restore it. + _as(monkeypatch, "alice") + with pytest.raises(ErasureRunningError): + asyncio.run( + reports_app.handle_knowledge_reports_evidence( + KnowledgeReportsEvidenceInput( + org=ORG, namespace=NS, report_id=rid, evidence=["run:r2"] + ) + ) + ) + _as(monkeypatch, "mark", Role.ADMIN) + with pytest.raises(ErasureRunningError): + _update(report_id=rid, related=[linked]) + assert len(store.inserts) == before + + +def test_a_reference_is_checked_on_write_and_on_every_read( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + store.missing = {"run:gone"} + for body in ({"evidence": ["run:gone"]}, {"run_id": "gone"}, {"evidence": ["gap:g1"]}): + # Missing, or a gap only admins read: refused alike, and nothing is filed. + with pytest.raises(ValidationError, match="was not found"): + _submit(**body) + assert store.inserts == [] + rid = _submit(run_id="r1", evidence=["run:r1", "reflection:r1"]).report_id + + def add(refs: list[str]) -> Any: + return asyncio.run( + reports_app.handle_knowledge_reports_evidence( + KnowledgeReportsEvidenceInput(org=ORG, namespace=NS, report_id=rid, evidence=refs) + ) + ) + + with pytest.raises(ValidationError, match="'run:gone' was not found"): + add(["run:gone"]) + # What the report already cites is not checked again on a write. + store.missing = {"reflection:r1", "run:r1"} + add(["run:r2", "reflection:r1"]) + # A read serves only what the caller can read now. + report = _get(rid).report + assert (report.evidence, report.run_id) == (["run:r2"], "") + assert store.rows[rid]["evidence"] == ["run:r1", "reflection:r1", "run:r2"] + + +def test_an_update_names_something_to_change( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit().report_id + _as(monkeypatch, "maria", Role.ADMIN) + with pytest.raises(ValidationError, match="name an action"): + _update(report_id=rid) + _as(monkeypatch, "alice") + other = _submit(problem="Also the currency.").report_id + _as(monkeypatch, "maria", Role.ADMIN) + with pytest.raises(ValidationError, match="go with an action"): + _update(report_id=rid, related=[other], reason="why") + with pytest.raises(NotFoundError): + _update(report_id="missing", action="take") + + +def test_an_update_from_a_stale_version_is_refused( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit().report_id + _as(monkeypatch, "maria", Role.ADMIN) + _update(report_id=rid, action="take") + with pytest.raises(PreconditionFailedError): + _update(report_id=rid, action="dismiss", reason="Duplicate.", expected_version=1) + assert _update( + report_id=rid, action="dismiss", reason="Duplicate.", expected_version=2 + ).state == ("dismissed") + + +def test_a_second_writer_is_told_to_retry(store: _Store, monkeypatch: pytest.MonkeyPatch) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit().report_id + + @asynccontextmanager + async def held_elsewhere(name: str, **_: Any) -> AsyncIterator[bool]: + assert name == f"knowledge-report:{ORG}:{NS}:{rid}" + yield False + + monkeypatch.setattr(reports_app.leases, "holding", held_elsewhere) + _as(monkeypatch, "maria", Role.ADMIN) + with pytest.raises(OverloadedError): + _update(report_id=rid, action="take") + assert len(store.inserts) == 1 + + +def test_only_the_reporter_adds_evidence(store: _Store, monkeypatch: pytest.MonkeyPatch) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit(evidence=["run:r1"]).report_id + _as(monkeypatch, "maria", Role.ADMIN) + _update(report_id=rid, action="take") + _update(report_id=rid, action="request_evidence", reason="Which run?") + + def add(refs: list[str]) -> Any: + return asyncio.run( + reports_app.handle_knowledge_reports_evidence( + KnowledgeReportsEvidenceInput(org=ORG, namespace=NS, report_id=rid, evidence=refs) + ) + ) + + with pytest.raises(NotFoundError): + add(["run:r2"]) + _as(monkeypatch, "alice") + out = add(["run:r2", "run:r1"]) + # Back to the maintainer who took it. + assert out.state == "taken" + assert store.rows[rid]["evidence"] == ["run:r1", "run:r2"] + with pytest.raises(ValidationError): + add(["bad"]) + + +def test_the_memory_check_serves_nothing_and_skips_chunk_keys( + monkeypatch: pytest.MonkeyPatch, +) -> None: + from server.memory.api.models_crud import MemoryGetInput + from server.memory.app import handlers + + class _Row: + version = 4 + value = {"text": "x"} + agent, user_id, session_id = "mcp", "-", "-" + + seen: list[str] = [] + + async def lookup(identity: Any, input: MemoryGetInput, *, wide: bool = True) -> Any: + seen.append(input.memory_key) + return _Row() + + monkeypatch.setattr(handlers, "_point_lookup", lookup) + monkeypatch.setattr("server.auth.context.current_auth", lambda: None) + body = {"org": ORG, "namespace": NS, "agent": "a"} + got = asyncio.run(handlers.readable_version(MemoryGetInput(memory_key="k", **body))) + assert got is not None and got.version == 4 and len(got.content_sha256) == 64 + # The identity of the row found, which may be another agent's than the one asked under. + assert (got.agent, got.user_id, got.session_id) == ("mcp", "-", "-") + chunk = MemoryGetInput(memory_key="chunk:1", **body) + assert asyncio.run(handlers.readable_version(chunk)) is None + assert seen == ["k"] + + +def test_a_running_erasure_refuses_a_report(store: _Store, monkeypatch: pytest.MonkeyPatch) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + asked = _erasures(monkeypatch, [True]) + with pytest.raises(ErasureRunningError): + _submit(user_id="bob") + assert store.inserts == [] and asked == [{"alice", "bob"}] + + +def test_a_write_holds_the_erasers_fence_until_its_send_settles( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + rid = _submit().report_id + assert store.fences == [[rules.writer_lease_name(ORG)]] and store.marks == [True, False] + _as(monkeypatch, "maria", Role.ADMIN) + asked = _erasures(monkeypatch, []) + landed = store.insert_version + + async def interrupted(row: dict[str, Any], **_: Any) -> None: + await landed(row) + raise asyncio.CancelledError + + monkeypatch.setattr(reports_store, "insert_version", interrupted) + with pytest.raises(asyncio.CancelledError): + _update(report_id=rid, action="take") + # Left uncertain: the fence keeps its holder until the send's bound, so an eraser + # taking it runs after the version lands. + assert store.marks[-1] is True + # The maintainer and the reporter are both people a user erasure may name. + assert asked[0] == {"alice", "maria"} + + +def test_a_link_to_an_erased_report_does_not_block_new_links( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + first = _submit(problem="One.").report_id + second = _submit(problem="Two.", related=[first]).report_id + third = _submit(problem="Three.").report_id + del store.rows[first] # erased since it was linked + _as(monkeypatch, "maria", Role.ADMIN) + _update(report_id=second, related=[third, third]) + assert store.rows[second]["related"] == [first, third] + + +def test_a_retry_returns_the_report_after_its_target_or_link_is_gone( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + first = _submit(problem="One.").report_id + second = _submit(problem="Two.", related=[first]) + del store.rows[first] # the related report was erased + _target(monkeypatch, None) # and the target is gone + again = _submit(problem="Two.", related=[first]) + assert (again.report_id, again.version) == (second.report_id, 1) + + +def test_a_whitespace_only_problem_is_refused( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + with pytest.raises(ValidationError, match="what is wrong or missing"): + _submit(problem=" \n\t ") + assert store.inserts == [] + + +@pytest.mark.parametrize( + ("failure", "refusal"), + [ + (PersonUnresolved("the directory could not be read"), BackendUnavailableError), + (PersonUnresolved("tied", tied=True), AuthInsufficientError), + ], +) +def test_a_reporter_the_directory_cannot_fold_is_refused( + store: _Store, monkeypatch: pytest.MonkeyPatch, failure: Exception, refusal: type +) -> None: + _as(monkeypatch, "Alice@Example.test") + _target(monkeypatch, (3, "a" * 64)) + + async def folded(org: str, subject: str) -> str: + return subject.lower() + + monkeypatch.setattr(reports_app, "folded_person", folded) + rid = _submit().report_id + + async def unfolded(org: str, subject: str) -> str: + raise failure + + monkeypatch.setattr(reports_app, "folded_person", unfolded) + # Never filed or matched under the token's raw spelling. + with pytest.raises(refusal): + _submit(problem="Another problem.") + assert len(store.inserts) == 1 + # A report that exists and one that does not are refused alike. + for report_id in (rid, "0" * 32): + with pytest.raises(refusal): + _get(report_id) + with pytest.raises(refusal): + asyncio.run( + reports_app.handle_knowledge_reports_evidence( + KnowledgeReportsEvidenceInput( + org=ORG, namespace=NS, report_id=report_id, evidence=["run:r2"] + ) + ) + ) + # A maintainer reads every report, so a failed fold costs them only the reporter match. + _as(monkeypatch, "maria", Role.ADMIN) + assert _get(rid).found and _get("0" * 32).found is False + _as(monkeypatch, "Alice@Example.test") + monkeypatch.setattr(reports_app, "folded_person", folded) + out = _get(rid) + assert out.found and out.report.reporter == "alice@example.test" + assert _submit().report_id == rid and len(store.inserts) == 1 + + +def test_evidence_repeated_from_the_report_does_not_count_toward_the_cap( + store: _Store, monkeypatch: pytest.MonkeyPatch +) -> None: + _as(monkeypatch, "alice") + _target(monkeypatch, (3, "a" * 64)) + cited = [f"run:r{i}" for i in range(rules.MAX_EVIDENCE)] + rid = _submit(evidence=cited).report_id + out = asyncio.run( + reports_app.handle_knowledge_reports_evidence( + KnowledgeReportsEvidenceInput(org=ORG, namespace=NS, report_id=rid, evidence=cited[:3]) + ) + ) + assert out.version == 2 and store.rows[rid]["evidence"] == cited diff --git a/tests/unit/test_knowledge_reports_domain.py b/tests/unit/test_knowledge_reports_domain.py new file mode 100644 index 00000000000..f08e87e6386 --- /dev/null +++ b/tests/unit/test_knowledge_reports_domain.py @@ -0,0 +1,114 @@ +"""The report rules in `server.knowledge.domain.reports`: targets, evidence references +and the transitions a maintainer action makes.""" + +from __future__ import annotations + +import pytest + +from server.knowledge.domain.reports import ( + MAX_EVIDENCE, + ReportRefused, + after_evidence, + check_action, + check_evidence, + check_target, + next_state, +) + + +def test_a_missing_knowledge_report_needs_no_target() -> None: + check_target("missing", "", "") + + +@pytest.mark.parametrize("kind", ["incorrect", "outdated"]) +def test_an_incorrect_or_outdated_report_names_its_target(kind: str) -> None: + with pytest.raises(ReportRefused, match="names the memory or document"): + check_target(kind, "", "") + check_target(kind, "memory", "deploy_config") + + +def test_a_target_has_both_its_kind_and_its_key() -> None: + with pytest.raises(ReportRefused, match="names its memory key"): + check_target("incorrect", "document", "") + with pytest.raises(ReportRefused, match="needs target_kind"): + check_target("missing", "", "doc-1") + + +def test_evidence_keeps_order_and_drops_repeats() -> None: + refs = ["gap:g1", "run:r-9", "gap:g1", "reflection:x.1"] + assert check_evidence(refs) == ["gap:g1", "run:r-9", "reflection:x.1"] + + +@pytest.mark.parametrize("ref", ["memory:k", "gap:", "run", "gap:has space", "run:" + "x" * 129]) +def test_evidence_refuses_an_unknown_or_malformed_reference(ref: str) -> None: + with pytest.raises(ReportRefused, match="evidence reference"): + check_evidence([ref]) + + +def test_evidence_is_bounded() -> None: + with pytest.raises(ReportRefused, match=f"at most {MAX_EVIDENCE}"): + check_evidence([f"run:r{i}" for i in range(MAX_EVIDENCE + 1)]) + # Repeats do not count toward the bound. + refs = [f"run:r{i}" for i in range(MAX_EVIDENCE)] + assert check_evidence(refs + refs[:5]) == refs + + +@pytest.mark.parametrize( + ("state", "action", "after"), + [ + ("open", "take", "taken"), + ("taken", "take", "taken"), + ("taken", "release", "open"), + ("open", "request_evidence", "needs_evidence"), + ("taken", "resolve", "resolved"), + ("needs_evidence", "dismiss", "dismissed"), + ("resolved", "reopen", "open"), + ("dismissed", "reopen", "open"), + ], +) +def test_maintainer_actions_move_the_report(state: str, action: str, after: str) -> None: + assert next_state(state, action) == after + + +@pytest.mark.parametrize( + ("state", "action"), + [("resolved", "take"), ("dismissed", "resolve"), ("open", "release"), ("open", "reopen")], +) +def test_an_action_that_does_not_apply_is_refused(state: str, action: str) -> None: + with pytest.raises(ReportRefused): + next_state(state, action) + + +@pytest.mark.parametrize("action", ["dismiss", "request_evidence", "reopen"]) +def test_these_actions_say_why(action: str) -> None: + with pytest.raises(ReportRefused, match="needs a reason"): + check_action(action, reason=" ", resolution_revision="") + check_action(action, reason="duplicate of another report", resolution_revision="") + + +def test_a_resolution_names_the_published_revision() -> None: + with pytest.raises(ReportRefused, match="published revision"): + check_action("resolve", reason="", resolution_revision="") + check_action("resolve", reason="", resolution_revision="memory:deploy_config@7") + with pytest.raises(ReportRefused, match="only for resolve"): + check_action("take", reason="", resolution_revision="memory:deploy_config@7") + + +@pytest.mark.parametrize( + ("state", "assignee", "after"), + [ + ("needs_evidence", "maintainer-a", "taken"), + ("needs_evidence", "", "open"), + ("taken", "maintainer-a", "taken"), + ("open", "", "open"), + ], +) +def test_evidence_from_the_reporter_returns_the_report( + state: str, assignee: str, after: str +) -> None: + assert after_evidence(state, assignee) == after + + +def test_a_closed_report_takes_no_more_evidence() -> None: + with pytest.raises(ReportRefused, match="takes no more evidence"): + after_evidence("dismissed", "") diff --git a/tests/unit/test_knowledge_reports_store.py b/tests/unit/test_knowledge_reports_store.py new file mode 100644 index 00000000000..0456c39a837 --- /dev/null +++ b/tests/unit/test_knowledge_reports_store.py @@ -0,0 +1,37 @@ +"""loom.knowledge_reports statements: a change reads the report head with sequential +consistency and writes the next version synchronously, so a writer on another replica +never checks its expected version against a stale head.""" + +from __future__ import annotations + +import asyncio +from typing import Any + +from server.knowledge.store import reports as reports_store + + +class _CH: + def __init__(self) -> None: + self.sql: list[str] = [] + self.insert_settings: list[dict[str, Any]] = [] + + async def query_one(self, sql: str, params: dict[str, Any] | None = None) -> None: + self.sql.append(sql) + + async def query_all(self, sql: str, params: dict[str, Any] | None = None) -> list[Any]: + self.sql.append(sql) + return [] + + async def insert(self, table: str, rows: list[dict[str, Any]], **kw: Any) -> None: + self.insert_settings.append(kw.get("settings") or {}) + + +def test_head_reads_are_sequential_and_writes_synchronous() -> None: + ch = _CH() + asyncio.run(reports_store.latest("o", "ns", "r1", ch=ch)) + asyncio.run(reports_store.latest_many("o", "ns", ["r1", "r2"], ch=ch)) + assert len(ch.sql) == 2 + assert all(s.endswith("SETTINGS select_sequential_consistency = 1") for s in ch.sql) + row = dict.fromkeys(reports_store.COLUMNS, "") + asyncio.run(reports_store.insert_version(row, ch=ch)) + assert ch.insert_settings == [{"async_insert": 0, "wait_for_async_insert": 1}] diff --git a/tests/unit/test_repository_column_sets_match_schema.py b/tests/unit/test_repository_column_sets_match_schema.py index b1a5bc7f2d1..aa7e55d941d 100644 --- a/tests/unit/test_repository_column_sets_match_schema.py +++ b/tests/unit/test_repository_column_sets_match_schema.py @@ -21,6 +21,7 @@ # (repository module, constant, table, columns the DDL fills and no writer sends) CASES: list[tuple[str, str, str, frozenset[str]]] = [ ("server.knowledge.store.query_history", "_COLUMNS", "loom.query_history_sources", frozenset()), + ("server.knowledge.store.reports", "COLUMNS", "loom.knowledge_reports", frozenset()), ( "server.tracker.store.daily", "TRACKER_TEST_DAILY_COLS", diff --git a/tests/unit/test_rmt_write_paths.py b/tests/unit/test_rmt_write_paths.py index b902df8309a..e4cf66a8593 100644 --- a/tests/unit/test_rmt_write_paths.py +++ b/tests/unit/test_rmt_write_paths.py @@ -40,6 +40,7 @@ "memory_webhooks": ("builder", "test_memory_webhooks.py"), "knowledge_sources": ("builder", "test_knowledge_sources.py"), "knowledge_source_push": ("builder", "test_repository_column_sets_match_schema.py"), + "knowledge_reports": ("builder", "test_repository_column_sets_match_schema.py"), "query_history_sources": ("builder", "test_repository_column_sets_match_schema.py"), "knowledge_mirrors": ("builder", "test_knowledge_mirrors.py"), "knowledge_source_listings": ("builder", "test_knowledge_mirrors.py"), diff --git a/tests/unit/test_schema_baseline.py b/tests/unit/test_schema_baseline.py index 3219996603f..3c913db0a28 100644 --- a/tests/unit/test_schema_baseline.py +++ b/tests/unit/test_schema_baseline.py @@ -174,6 +174,7 @@ def test_the_journal_files() -> None: "117_code_term_df_unchanged_refresh.sql", "118_store_names_reserved.sql", "119_workspace_crawl.sql", + "120_knowledge_reports.sql", ] diff --git a/tests/unit/test_sdk_go_codegen.py b/tests/unit/test_sdk_go_codegen.py index 6524b0725d9..d6f00eaaf86 100644 --- a/tests/unit/test_sdk_go_codegen.py +++ b/tests/unit/test_sdk_go_codegen.py @@ -116,3 +116,18 @@ def test_check_reports_stale_client_without_rewriting( assert sdk_go_gen.main(["--check"]) == 1 assert wire.read_bytes() == wire_bytes assert client.read_bytes() == stale_client + + +def test_a_uint64_that_also_takes_a_decimal_string_stays_uint64_in_go() -> None: + generated = build_source() + + def field(struct: str, name: str) -> str: + body = generated.split(f"type {struct} struct {{", 1)[1].split("\n}", 1)[0] + line = re.search(rf"^\s*{name}\s+(\S+)", body, re.M) + assert line is not None, body + return line[1] + + # JavaScript sends a report's target version as a string; Go's uint64 holds it exactly. + assert field("KnowledgeReportsSubmitInput", "TargetVersion") == "*uint64" + # A number-or-string field without the UInt64 mark keeps the raw JSON. + assert field("MemoryDeleteVersionInput", "Version") == "json.RawMessage"