diff --git a/docs/features/dashboard.md b/docs/features/dashboard.md index 4fd76e6f87..8342975847 100644 --- a/docs/features/dashboard.md +++ b/docs/features/dashboard.md @@ -454,17 +454,17 @@ Admins of the current namespace get a drawer with the Review and Observe groups; platform admins also get Access, and platform admins Deployment. A viewer never sees an entry that would answer 403. -| Group | Page | URL | What it is for | -| ------- | ---------------- | --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| Review | **Review queue** | `/admin/review_queue` | Conflicts (pairs of memories that disagree, each with a suggested decision on request, except a sensitive one), learnings proposed for promotion, memories Loom retired on its own (Auto-resolved, each with an Undo), exceptions (the allowlist of pairs that may coexist), proposals (facts on trial, accepted or rejected), duplicate memories and documents with the namespace-wide repairs, and the namespace's shared definitions (Definitions: whether each is governed, why a lapsed one lapsed and what brings it back, and the names another definition serves). In the drawer for every admin of a memory namespace, even when empty; it counts open conflicts plus pending proposals. See [conflicts and refusal](memory/conflicts-and-refusal.md). | -| Review | **Guardrails** | `/admin/guardrails` | Blacklist patterns: content Loom should never store, each with a sweep that deletes the stored memories it already matches; for an org admin, the org's and the namespace's extraction rules and the org's model-call switch. | -| Review | **Policies** | `/admin/policies` | History policy rules, a dry run of a hypothetical call, and the decision ledger. | -| Observe | **Health** | `/admin/health` | Worker status and how agents in the namespace spend their calls; the namespace's memory report, search gates and recent extractions; an admin's repairs (apply expiry, re-embed, remove an extractor's facts, roll back, snapshot and restore); an org admin's projection failures, retried or dismissed. | -| Observe | **Audit log** | `/admin/activity` | The audit feed, one readable line per event; the Erasures tab lists erasures with each one's details and, by role, erases or exports one namespace or one user; the Exposure tab shows which readers read the namespace's memories and one user's owner report. | -| Observe | **Flow** | `/flow` | Read-only: where memories flow — writes and recalls, cross-namespace reach, producer and consumer agents, memberships; collections and repositories are listed apart from the namespaces. | -| Observe | **Usage** | `/admin/usage` | LLM and embedding cost by day, operation, agent or user, the namespace's daily cap, and on **Coding agents** the coding agents' own model spend. | -| Observe | **Agents** | `/admin/agents` | Which clients connected in a window (`agents.connected`); confirms a new MCP connection works. A namespace admin can forget every memory one agent holds there. | -| Access | **Users** | `/admin/users` | Org and platform admins only: every subject, their grants (namespaces, collections and repositories) and roles, last activity, and releasing a namespace whose owner lost their password. | +| Group | Page | URL | What it is for | +| ------- | ---------------- | --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Review | **Review queue** | `/admin/review_queue` | Conflicts (pairs of memories that disagree, each with a suggested decision on request, except a sensitive one), learnings proposed for promotion, memories Loom retired on its own (Auto-resolved, each with an Undo), exceptions (the allowlist of pairs that may coexist), proposals (facts on trial, each opened from its key and accepted or rejected; `/admin/review_queue?tab=proposals&key=` opens one), duplicate memories and documents with the namespace-wide repairs, and the namespace's shared definitions (Definitions: whether each is governed, why a lapsed one lapsed and what brings it back, and the names another definition serves). In the drawer for every admin of a memory namespace, even when empty; it counts open conflicts plus pending proposals. See [conflicts and refusal](memory/conflicts-and-refusal.md). | +| Review | **Guardrails** | `/admin/guardrails` | Blacklist patterns: content Loom should never store, each with a sweep that deletes the stored memories it already matches; for an org admin, the org's and the namespace's extraction rules and the org's model-call switch. | +| Review | **Policies** | `/admin/policies` | History policy rules, a dry run of a hypothetical call, and the decision ledger. | +| Observe | **Health** | `/admin/health` | Worker status and how agents in the namespace spend their calls; the namespace's memory report, search gates and recent extractions; an admin's repairs (apply expiry, re-embed, remove an extractor's facts, roll back, snapshot and restore); an org admin's projection failures, retried or dismissed. | +| Observe | **Audit log** | `/admin/activity` | The audit feed, one readable line per event; the Erasures tab lists erasures with each one's details and, by role, erases or exports one namespace or one user; the Exposure tab shows which readers read the namespace's memories and one user's owner report. | +| Observe | **Flow** | `/flow` | Read-only: where memories flow — writes and recalls, cross-namespace reach, producer and consumer agents, memberships; collections and repositories are listed apart from the namespaces. | +| Observe | **Usage** | `/admin/usage` | LLM and embedding cost by day, operation, agent or user, the namespace's daily cap, and on **Coding agents** the coding agents' own model spend. | +| Observe | **Agents** | `/admin/agents` | Which clients connected in a window (`agents.connected`); confirms a new MCP connection works. A namespace admin can forget every memory one agent holds there. | +| Access | **Users** | `/admin/users` | Org and platform admins only: every subject, their grants (namespaces, collections and repositories) and roles, last activity, and releasing a namespace whose owner lost their password. | The Admin button shows the Review queue's count while its drawer is closed. That count is the review items waiting: open conflicts plus pending proposals, both from the one @@ -473,7 +473,11 @@ decision in the Proposals tab reads the count again at once, counted fresh rathe replica's minute-long cache, which only the replica that took the decision drops. The fresh count reads with sequential consistency, and a count of the decided namespace read before the decision that returns after it is not cached. The minute's polls read the cache. When the queue's own count finds -proposals waiting and no open conflict, the queue opens on Proposals. Usage warns when the +proposals waiting and no open conflict, the queue opens on Proposals. The address carries the +open tab (`?tab=proposals`), so a link, a reload and Back reopen it, and a tab the address +names stays over what the count says. A proposal opens from its key in the list, and +`/admin/review_queue?tab=proposals&key=`, the key percent-encoded, opens the pending proposal under that +key. Usage warns when the namespace is over its 24-hour cap, Agents counts clients new in the last 24 hours. The header carries a task bell (triage and blocked-on-person items) and a pending-approvals bell (grant requests the person can decide). The phone's More sheet lists the same admin entries with the same badges; a diff --git a/docs/features/memory/writing.md b/docs/features/memory/writing.md index b4e1cdd54d..340299544f 100644 --- a/docs/features/memory/writing.md +++ b/docs/features/memory/writing.md @@ -342,6 +342,16 @@ each. A run in the proposal's namespace counts toward its trial when it names th proposal ready for review. With `proposal_policy.mode="auto"`, `reject_after_fails` can reject a proposal; automatic acceptance is refused. See [runs](../runs.md). +Each listed proposal names who proposed it: `actor` is the identity the server recorded +for the write, `human:` or `process:` from the writer's token, or a +pipeline's own actor (such as `process:session_contrast`) for a proposal the server wrote, +beside `agent`, the label the writing client sent. `memory_keys` (at most 500 keys that +together fit one 64 KiB parameter; a longer list is refused with a 422) lists only the +pending proposals under those keys; `limit` still applies, and `total` and `count_only` +count the matching rows. A key outside the caller's reach answers as a key with no +proposal. A `high` row lists no `content_sha256`: its hash comes with its value from +`memory.get_by_id`. + `memory.proposal_decide` requires an administrator. Acceptance also requires an authenticated human whose subject, including linked aliases, differs from the proposer. Service accounts and anonymous callers cannot approve. Acceptance supplies @@ -350,7 +360,13 @@ read. Missing hashes or changed content leave that key undecided. The approved r records the reviewer's identity and content hash. Pending review survives rejection, metadata changes, tombstones and snapshot restoration; ordinary writes cannot activate it. A pending row cannot be moved to another key. The **Proposals** tab of the **Review queue** -at `/admin/review_queue` supplies the displayed hashes when an administrator accepts. +at `/admin/review_queue?tab=proposals` lists each proposal with who proposed it. A +proposal's key opens its review, and `&key=` in the address, the key percent-encoded, +opens the pending proposal under that key. The review shows the key, the proposer, the +agent, when the fact was first proposed and its graded runs above the complete text, and +holds both decisions: the tab supplies the displayed hash when an administrator accepts, +and a rejection can carry a reason. A rejection cannot be undone: the fact has to be +proposed again. A decision names a key and decides its newest row, so the tab offers no decision for a key that more than one listed proposal holds. Accepting a proposal that recorded a contradiction while on trial stores it `conflicted`, and it waits on the **Conflicts** tab. diff --git a/docs/guides/without-the-dashboard.md b/docs/guides/without-the-dashboard.md index d8b731d627..9042e6c239 100644 --- a/docs/guides/without-the-dashboard.md +++ b/docs/guides/without-the-dashboard.md @@ -79,6 +79,7 @@ are on `agent.account` and `agent.deployment`. | Approve join requests | `grants.pending_for_me`, then `grants.approve namespace=… subject=… decision=approve` (or `reject`) | `agent.client.grants.pending_for_me()`, `agent.client.grants.approve(...)` | | Members and grants | `grants.list`, `grants.create`, `grants.revoke` | `agent.grants.*` | | Review queue (conflicts) | `conflicts.list`, `conflicts.resolve`, `learnings.review` | `agent.conflicts.list()`, `.resolve(...)` | +| Review queue (proposals) | `memory.proposals`, `memory.proposal_decide` ([proposals](../features/memory/writing.md#proposals)) | `agent.client.memory.proposals(...)`, `.proposal_decide(...)` | | Review queue (definitions) | `memory.definitions.list` | `agent.client.memory.definitions_list()` | | Activity, audit log | `profile.activity`, `audit.list`, `agents.connected`, `mentor.brief`, `memory.exposure_summary`, `memory.owner_report` | `agent.audit.list(...)`, `agent.profile.*` | | Cost and budgets | `cost.summary`, `cost.budget_status` | `agent.cost.summary(...)` | diff --git a/docs/reference/operations/memory.md b/docs/reference/operations/memory.md index df4d232941..60c0ecbf47 100644 --- a/docs/reference/operations/memory.md +++ b/docs/reference/operations/memory.md @@ -1565,9 +1565,10 @@ List facts on trial (written with memory.set proposed=true) with the graded runs | `namespace` | `str` | required | The namespace the op reads or writes. | | `prefix` | `str` | `''` | Narrow the listing: a key prefix (`lesson_`), any-match tags. | | `tags` | `list[str]` | *(computed)* | Only proposals carrying any of these tags; empty = no tag filter. | +| `memory_keys` | `list[str]` | *(computed)* | Only pending proposals under these keys, cut by `limit` like any listing; empty lists every proposal. | | `only` | `Literal['', 'ready']` | `''` | `ready` keeps only proposals the policy thresholds would decide now (accept or reject); "" lists every proposal. | | `limit` | `int` | `50` | At most this many proposals returned, newest first. | -| `count_only` | `bool` | `False` | Answer `total`, the exact number of pending proposals that match prefix and tags, and the namespace's `policy`, with no proposal or graded count read; default off. | +| `count_only` | `bool` | `False` | Answer `total`, the exact number of pending proposals that match prefix, tags and memory_keys, and the namespace's `policy`, with no proposal or graded count read; default off. | | Output field | Type | Meaning | | --- | --- | --- | diff --git a/frontend/e2e/list-tables.spec.ts b/frontend/e2e/list-tables.spec.ts index e019a216ef..1da9ae431f 100644 --- a/frontend/e2e/list-tables.spec.ts +++ b/frontend/e2e/list-tables.spec.ts @@ -40,6 +40,20 @@ const conflict = (i: number) => ({ content_sha256: "", }); +const proposal = (i: number) => ({ + memory_key: `alerts/threshold/lane-${i}`, + memory_id: `proposal-${i}`, + content_sha256: String(i).repeat(64), + agent: "oncall-agent", + actor: i % 2 ? "human:alice@example.com" : "process:sa:release-bot", + value_preview: `page when lane ${i} p95 latency is over ${300 + i} ms`, + sensitivity: "", + created_at: ago(i * 45), + graded_passes: i, + graded_fails: 0, + ready: i ? "accept" : "", +}); + const WORKERS = { workers: { embedding_worker: { @@ -103,6 +117,9 @@ async function withRows(page: Page) { }, }), ); + await page.route("**/v1/memory.proposals", (r) => + r.fulfill({ json: { proposals: [0, 1, 2].map(proposal), total: 3 } }), + ); await page.route("**/v1/admin/workers.status", (r) => r.fulfill({ json: WORKERS })); } @@ -128,6 +145,7 @@ const TABLES: [string, string][] = [ ["/admin/users", "Users"], ["/admin/activity", "Audit events"], ["/admin/review_queue", "Conflicts"], + ["/admin/review_queue?tab=proposals", "Proposals"], ["/admin/health", "Workers"], ]; diff --git a/frontend/src/api/review.test.ts b/frontend/src/api/review.test.ts index cf9438b762..73579dc2ea 100644 --- a/frontend/src/api/review.test.ts +++ b/frontend/src/api/review.test.ts @@ -1,5 +1,11 @@ import { afterEach, describe, expect, it, vi } from "vitest"; -import { collapseMemoryDuplicates, consolidateMemories, listMemoryDuplicates, listProposals } from "./review"; +import { + collapseMemoryDuplicates, + consolidateMemories, + decideProposals, + listMemoryDuplicates, + listProposals, +} from "./review"; afterEach(() => { vi.unstubAllGlobals(); @@ -29,4 +35,37 @@ describe("review requests", () => { expect(sent.get("memory.dedup_list")).toMatchObject({ ...scope, limit: 50 }); expect(sent.get("memory.proposals")).toMatchObject({ ...scope, limit: 100 }); }); + + /** The bodies posted while `calls` runs, in order, without the `consumer` every call names. */ + async function bodies(calls: () => Promise): Promise[]> { + const fetchMock = vi.fn(async (_url: string, _init?: RequestInit) => Response.json({})); + vi.stubGlobal("fetch", fetchMock); + await calls(); + return fetchMock.mock.calls.map(([, init]) => { + const { consumer: _every, ...body } = JSON.parse(String(init?.body)); + return body; + }); + } + + it("a keyed read sends the keys", async () => { + const [keyed, whole] = await bodies(async () => { + await listProposals(scope, { keys: ["deploy_window"] }); + await listProposals(scope); + }); + expect(keyed).toEqual({ ...scope, limit: 100, memory_keys: ["deploy_window"] }); + expect(whole).toEqual({ ...scope, limit: 100 }); + }); + + it("a rejection sends the hash it read and the reason", async () => { + const hash = { deploy_window: "a".repeat(64) }; + const [rejected, bare, accepted] = await bodies(async () => { + await decideProposals(scope, ["deploy_window"], "reject", hash, "Out of date"); + await decideProposals(scope, ["deploy_window"], "reject"); + await decideProposals(scope, ["deploy_window"], "accept", hash, "never sent"); + }); + const decision = { ...scope, memory_keys: ["deploy_window"] }; + expect(rejected).toEqual({ ...decision, decision: "reject", approved_sha256: hash, reason: "Out of date" }); + expect(bare).toEqual({ ...decision, decision: "reject" }); + expect(accepted).toEqual({ ...decision, decision: "accept", approved_sha256: hash }); + }); }); diff --git a/frontend/src/api/review.ts b/frontend/src/api/review.ts index 274bc73fb7..1219de58be 100644 --- a/frontend/src/api/review.ts +++ b/frontend/src/api/review.ts @@ -162,6 +162,9 @@ export interface MemoryProposal { memory_key: string; memory_id: string; agent: string; + /** Who proposed it (`human:`, `process:` or a pipeline's actor); absent + * from a server a release behind. */ + actor?: string; /** "" for a high row: its value is read by key. */ value_preview: string; sensitivity: "" | "low" | "medium" | "high"; @@ -175,29 +178,41 @@ export interface MemoryProposal { /** How many proposals the Review queue asks for, newest first. */ export const PROPOSAL_LIST_LIMIT = 100; +/** POST /v1/memory.proposals: the newest pending proposals, or with `keys` only those under + * these keys. A server a release behind lists every proposal and names `memory_keys` in + * `ignored_args`. */ export async function listProposals( id: Scope, - opts: RequestOpts = {}, -): Promise<{ proposals: MemoryProposal[]; total: number }> { + opts: RequestOpts & { keys?: string[] } = {}, +): Promise<{ proposals: MemoryProposal[]; total: number; ignored_args?: string[] }> { return post( "/v1/memory.proposals", - { org: id.org, namespace: id.namespace, limit: PROPOSAL_LIST_LIMIT }, + { + org: id.org, + namespace: id.namespace, + limit: PROPOSAL_LIST_LIMIT, + ...(opts.keys ? { memory_keys: opts.keys } : {}), + }, opts.signal, ); } +/** POST /v1/memory.proposal_decide. `approvedSha256` names, per key, the hash served with + * the text the reviewer read, on either decision; `reason` is kept on a rejected fact. */ export async function decideProposals( id: Scope, keys: string[], decision: "accept" | "reject", approvedSha256: Record = {}, + reason = "", ): Promise<{ decided: number; results: { memory_key: string; decided: boolean; status: string; reason: string }[] }> { return post("/v1/memory.proposal_decide", { org: id.org, namespace: id.namespace, memory_keys: keys, decision, - ...(decision === "accept" ? { approved_sha256: approvedSha256 } : {}), + ...(Object.keys(approvedSha256).length > 0 ? { approved_sha256: approvedSha256 } : {}), + ...(decision === "reject" && reason ? { reason } : {}), }); } diff --git a/frontend/src/lib/state.namespace.test.ts b/frontend/src/lib/state.namespace.test.ts index 13ae7bb766..677b741973 100644 --- a/frontend/src/lib/state.namespace.test.ts +++ b/frontend/src/lib/state.namespace.test.ts @@ -116,6 +116,12 @@ describe("writing the address", () => { expect(history.length).toBe(before); }); + it("a switch drops a proposal's key", () => { + at("/admin/review_queue?namespace=team&tab=proposals&key=deploy_window"); + useStore.getState().setIdentity({ ...team, namespace: "other" }); + expect(address()).toBe("/admin/review_queue?namespace=other&tab=proposals"); + }); + it.each([ ["tasks", "/tasks", "task"], ["knowledge", "/library", "doc"], diff --git a/frontend/src/lib/state.test.ts b/frontend/src/lib/state.test.ts index 6d60f6207a..ae51402b58 100644 --- a/frontend/src/lib/state.test.ts +++ b/frontend/src/lib/state.test.ts @@ -49,6 +49,12 @@ describe("navigationHref keeps only the query keys the target view owns", () => expect(navigationHref("graph")).toBe("/graph?seed=a+b"); }); + it("the Review queue keeps its tab and its key across a navigation to it", () => { + setLocation("/admin/review_queue?tab=proposals&key=deploy_window&seed=alpha"); + expect(navigationHref("admin:review_queue")).toBe("/admin/review_queue?tab=proposals&key=deploy_window"); + expect(navigationHref("memories")).toBe("/memories"); + }); + it("shortens links to the default Settings tab", () => { setLocation("/?view=setup&tab=tokens"); expect(pathnameView()).toBe("setup"); diff --git a/frontend/src/lib/state.ts b/frontend/src/lib/state.ts index 1b26ce00b8..18c25747a9 100644 --- a/frontend/src/lib/state.ts +++ b/frontend/src/lib/state.ts @@ -97,6 +97,8 @@ const VIEW_QUERY_KEYS: Partial> = { tasks: ["inbox", "task"], // Settings carries its open tab (`?tab=memory|system`). setup: ["tab"], + // The Review queue carries its open tab and the pending proposal open in it. + "admin:review_queue": ["tab", "key"], "connected-accounts": ["kind"], // The object open on a page rides its URL, so a deep link, a reload and Back reopen it: // the memory in the drawer, the document in the preview, the thread in the replay. @@ -219,9 +221,14 @@ function pushView(v: View, opts: NavOptions = {}, remember = true): void { else history.pushState(state, "", want); } +/** The current history entry's state; null where there is no history. */ +function entryState(): unknown { + return typeof history === "undefined" ? null : history.state; +} + /** Whether the current history entry is the one the assistant's phone sheet pushed. */ export function sheetEntry(): boolean { - const st: unknown = typeof history === "undefined" ? null : history.state; + const st = entryState(); return !!st && typeof st === "object" && (st as Record).loomSheet === true; } @@ -245,7 +252,7 @@ export function setViewParam(key: string, value: string | null, state: Record).loomInspect : null; if (remembered && typeof remembered === "object") { const r = remembered as Record; @@ -255,7 +262,7 @@ function linkedAgent(key: string): string { } // The URL keys that name an object of one namespace: a switch drops them. -const SWITCH_CLEARS = ["memory", "thread", "doc", "task", ...HANDOFF_QUERY_KEYS]; +const SWITCH_CLEARS = ["memory", "thread", "doc", "task", "key", ...HANDOFF_QUERY_KEYS]; // A collection is the org's, not a namespace's: an entry made in another namespace keeps it, // and only the person's own switch of namespace leaves it. const PICK_CLEARS = [...SWITCH_CLEARS, "collection"]; @@ -263,7 +270,7 @@ const PICK_CLEARS = [...SWITCH_CLEARS, "collection"]; /** The namespace the current history entry was made in: the app's stamp, else the one its * address names (the entry a link opened, which boot rewrites and never stamps). */ function entryNamespace(): string | null { - const s: unknown = typeof history === "undefined" ? null : history.state; + const s = entryState(); const ns = s && typeof s === "object" ? (s as Record).loomNamespace : null; return typeof ns === "string" ? ns : urlParam(NAMESPACE_KEY); } @@ -297,7 +304,7 @@ export function addressPageNamespace(): void { /** The entry state that makes the current entry `namespace`'s: stamped with it, and * remembering no memory of the namespace it was made in. */ function stampFor(namespace: string | null): Record { - const place = readPlace(typeof history === "undefined" ? null : history.state); + const place = readPlace(entryState()); return { loomNamespace: namespace, loomInspect: null, diff --git a/frontend/src/views/Setup.title.test.tsx b/frontend/src/views/Setup.title.test.tsx index 79c8db9e0f..fb9e425289 100644 --- a/frontend/src/views/Setup.title.test.tsx +++ b/frontend/src/views/Setup.title.test.tsx @@ -87,6 +87,14 @@ describe("Settings", () => { await waitFor(() => expect(screen.getByRole("tab", { name: "Tokens" })).toHaveAttribute("aria-selected", "true")); }); + it("drops a tab another page wrote to the address", async () => { + seed("team"); + window.history.replaceState(null, "", "/settings?namespace=team&tab=proposals"); + render(); + expect(await screen.findByRole("tab", { name: "Tokens" }, WAIT)).toHaveAttribute("aria-selected", "true"); + expect(window.location.search).toBe("?namespace=team"); + }); + it("announces a missing namespace from the alert itself, with no wrapper", async () => { seed(""); render(); diff --git a/frontend/src/views/Setup.tsx b/frontend/src/views/Setup.tsx index 5fdf3bb627..9e97f552a4 100644 --- a/frontend/src/views/Setup.tsx +++ b/frontend/src/views/Setup.tsx @@ -70,7 +70,11 @@ export function Setup() { // A link or browser history can change the tab without remounting Settings. const navSeq = useStore((s) => s.navSeq); useEffect(() => { - const sync = () => setTab(readTabParam()); + const sync = () => { + // The Review queue owns `tab` too, and a navigation carries it between the two pages. + if (urlParam("tab") !== null && !isSettingsTab(urlParam("tab"))) setViewParam("tab", null); + setTab(readTabParam()); + }; sync(); window.addEventListener("popstate", sync); return () => window.removeEventListener("popstate", sync); diff --git a/frontend/src/views/admin/Proposals.test.tsx b/frontend/src/views/admin/Proposals.test.tsx index 45de85f24b..73933ba12b 100644 --- a/frontend/src/views/admin/Proposals.test.tsx +++ b/frontend/src/views/admin/Proposals.test.tsx @@ -1,11 +1,12 @@ -import { cleanup, render, screen, waitFor } from "../../test/rtl"; +import { act, cleanup, render, screen, waitFor, within } from "../../test/rtl"; import userEvent from "@testing-library/user-event"; import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; import * as api from "../../api"; -import { toast } from "../../components/Toast"; -import type { MemoryProposal } from "../../api"; +import { toast, toastError } from "../../components/Toast"; +import type { MemoryById, MemoryProposal } from "../../api"; import { useStore } from "../../lib/state"; import { resetNamespaceRoleCache } from "../../lib/namespaceRole"; +import { axeViolations } from "../../test/axe"; import { ProposalsPanel } from "./Proposals"; vi.mock("../../components/Toast", () => ({ toast: vi.fn(), toastError: vi.fn(), ToastViewport: () => null })); @@ -24,6 +25,7 @@ const P: MemoryProposal = { memory_key: "deploy_window", memory_id: "m1", agent: "claude-code", + actor: "process:sa:release-bot", value_preview: "Deploys run on Tuesdays", sensitivity: "", created_at: "2000-01-01 00:00:00", @@ -31,42 +33,118 @@ const P: MemoryProposal = { graded_fails: 0, ready: "accept", }; +const SCOPE = { org: "acme", namespace: "team" }; +const HOME = "/admin/review_queue?tab=proposals"; +const address = () => window.location.pathname + window.location.search; function signIn(role: "viewer" | "writer" | "admin") { useStore.setState({ - identity: { org: "acme", namespace: "team", agent: "loom-ui" }, + identity: { ...SCOPE, agent: "loom-ui" }, whoami: { authenticated: true, subject: "alice", org: "acme", roles: [role], is_service_account: false }, myNamespaces: [{ namespace: "team", role, status: "active" } as never], }); } beforeEach(() => { + window.history.replaceState(null, "", HOME); resetNamespaceRoleCache(); signIn("admin"); - vi.mocked(api.getMemoryById).mockResolvedValue({ + listed = []; + vi.mocked(api.getMemoryById).mockImplementation(async (_org, id) => + whole(listed.find((p) => p.memory_id === id) ?? P), + ); +}); +afterEach(() => { + cleanup(); + vi.unstubAllGlobals(); + vi.resetAllMocks(); + vi.mocked(api.decideProposals).mockImplementation(async () => ({ decided: 1, results: [] })); +}); + +type Listed = Awaited>; + +/** The proposals the panel was shown, which the read by id answers from. */ +let listed: MemoryProposal[] = []; + +/** The complete row of proposal `p`, as the read by id answers it. */ +function whole(p: MemoryProposal, over: Partial = {}): MemoryById { + return { found: true, - memory_id: P.memory_id, + memory_id: p.memory_id, namespace: "team", - memory_key: P.memory_key, - content_sha256: P.content_sha256, + memory_key: p.memory_key, + content_sha256: p.content_sha256, value: "The complete proposal text", version: 1, pinned: false, created_at: null, - }); -}); -afterEach(() => { - cleanup(); - vi.clearAllMocks(); -}); + ...over, + }; +} /** Renders the panel over `rows` (of `total`), as its read on open answers them. */ async function show(rows: MemoryProposal[], total = rows.length) { + listed = rows; vi.mocked(api.listProposals).mockResolvedValueOnce({ proposals: rows, total }); render(); await screen.findAllByText(rows[0].memory_key); } +/** Renders the panel at an address that names `key`: the list read answers `rows`, the + * read by key answers `keyed`, or fails with it. */ +function showLinked(key: string, rows: MemoryProposal[], keyed: Listed | Error) { + listed = rows; + window.history.replaceState(null, "", `${HOME}&key=${key}`); + vi.mocked(api.listProposals).mockImplementation(async (_id, opts) => { + if (!opts?.keys) return { proposals: rows, total: rows.length }; + if (keyed instanceof Error) throw keyed; + return keyed; + }); + render(); +} + +/** Renders the panel at an address that names `key` over `rows`, with the read by key held. + * The function returned settles that read, with its answer or the error it fails with, and + * resolves once the panel has taken it. */ +function showLinkedHeld(key: string, rows: MemoryProposal[]): (late: Listed | Error) => Promise { + let settle: (late: Listed | Error) => void = () => {}; + const keyed = new Promise((resolve, reject) => { + settle = (late) => (late instanceof Error ? reject(late) : resolve(late)); + }); + listed = rows; + window.history.replaceState(null, "", `${HOME}&key=${key}`); + vi.mocked(api.listProposals).mockImplementation((_id, opts) => + opts?.keys ? keyed : Promise.resolve({ proposals: rows, total: rows.length }), + ); + render(); + return (late) => + act(async () => { + settle(late); + // The panel's handlers are first in line on this promise. + await keyed.catch(() => {}); + }); +} + +/** The notice that says `words`, by its live region. */ +async function notice(words: string): Promise { + const region = (await screen.findByText(words)).closest("[role='status']"); + if (!region) throw new Error(`"${words}" is not in a status region`); + return region; +} + +/** The value drawn beside `term` in the review's facts. */ +function fact(dialog: HTMLElement, term: string): HTMLElement { + return within(dialog).getByText(term, { selector: "dt" }).nextElementSibling as HTMLElement; +} + +/** Opens the review of the row under `key` and waits for its complete text. */ +async function open(key = P.memory_key, text = "The complete proposal text") { + await userEvent.click(screen.getAllByRole("button", { name: key })[0]); + const dialog = await screen.findByRole("dialog", { name: "Review proposal" }); + await within(dialog).findByText(text); + return dialog; +} + describe("ProposalsPanel", () => { it("reads the proposals when it opens, and accepts one", async () => { await show([P]); @@ -74,16 +152,17 @@ describe("ProposalsPanel", () => { expect(screen.getByText("Deploys run on Tuesdays")).toBeInTheDocument(); expect(screen.getByText("ready to accept")).toBeInTheDocument(); expect(api.listProposals).toHaveBeenCalledTimes(1); - await userEvent.click(screen.getByRole("button", { name: "Accept deploy_window" })); + expect(api.getMemoryById).not.toHaveBeenCalled(); + await open(); expect(api.decideProposals).not.toHaveBeenCalled(); - await screen.findByText("The complete proposal text"); await userEvent.click(screen.getByRole("button", { name: "Accept reviewed fact" })); await waitFor(() => expect(api.decideProposals).toHaveBeenCalledWith( - { org: "acme", namespace: "team" }, + SCOPE, ["deploy_window"], "accept", { deploy_window: P.content_sha256 }, + "", ), ); expect(await screen.findByText("No proposals")).toBeInTheDocument(); @@ -94,55 +173,55 @@ describe("ProposalsPanel", () => { whoami: { authenticated: true, subject: "agent", roles: ["admin"], is_service_account: true }, }); await show([P]); - const accept = screen.getByRole("button", { name: "Accept deploy_window" }); + await open(); + const accept = screen.getByRole("button", { name: "Accept reviewed fact" }); expect(accept).toHaveAttribute("aria-disabled", "true"); + expect(accept).toHaveAccessibleDescription("Acceptance needs an authenticated human administrator."); await userEvent.click(accept); - expect(api.getMemoryById).not.toHaveBeenCalled(); - await userEvent.click(screen.getByRole("button", { name: "Actions for deploy_window" })); - expect(await screen.findByRole("menuitem", { name: "Reject" })).not.toHaveAttribute("aria-disabled", "true"); + expect(api.decideProposals).not.toHaveBeenCalled(); + const reject = screen.getByRole("button", { name: "Reject" }); + expect(reject).not.toHaveAttribute("aria-disabled"); + await userEvent.click(reject); + await waitFor(() => expect(api.decideProposals).toHaveBeenCalledTimes(1)); + expect(vi.mocked(api.decideProposals).mock.calls[0][2]).toBe("reject"); }); it("accepts only the hash returned with the complete displayed value", async () => { const currentHash = "b".repeat(64); - vi.mocked(api.getMemoryById).mockResolvedValueOnce({ - found: true, - memory_id: P.memory_id, - namespace: "team", - memory_key: P.memory_key, - content_sha256: currentHash, - value: "Updated complete proposal text", - version: 2, - pinned: false, - created_at: null, - }); + vi.mocked(api.getMemoryById).mockResolvedValueOnce( + whole(P, { content_sha256: currentHash, value: "Updated complete proposal text", version: 2 }), + ); vi.mocked(api.decideProposals).mockResolvedValueOnce({ decided: 1, results: [{ memory_key: P.memory_key, decided: true, status: "active", reason: "" }], }); await show([P]); - await userEvent.click(screen.getByRole("button", { name: "Accept deploy_window" })); - await screen.findByText("Updated complete proposal text"); + await open(P.memory_key, "Updated complete proposal text"); await userEvent.click(screen.getByRole("button", { name: "Accept reviewed fact" })); await waitFor(() => - expect(api.decideProposals).toHaveBeenCalledWith({ org: "acme", namespace: "team" }, [P.memory_key], "accept", { - [P.memory_key]: currentHash, - }), + expect(api.decideProposals).toHaveBeenCalledWith( + SCOPE, + [P.memory_key], + "accept", + { [P.memory_key]: currentHash }, + "", + ), ); }); - it("shows a viewer the proposals, and Accept and Reject unavailable with the role they need", async () => { + it("the key opens the review for a viewer, with both decisions unavailable and the role they need", async () => { signIn("viewer"); await show([P]); expect(screen.getByText("Deploys run on Tuesdays")).toBeInTheDocument(); + await open(); const needs = "Needs admin on team. An admin of it can grant that."; - const accept = screen.getByRole("button", { name: "Accept deploy_window" }); - expect(accept).toHaveAttribute("aria-disabled", "true"); - expect(accept).toHaveAccessibleDescription(needs); - await userEvent.click(accept); - await userEvent.click(screen.getByRole("button", { name: "Actions for deploy_window" })); - const reject = await screen.findByRole("menuitem", { name: "Reject" }); - expect(reject).toHaveAccessibleDescription(needs); - await userEvent.click(reject); + for (const name of ["Reject", "Accept reviewed fact"]) { + const decision = screen.getByRole("button", { name }); + expect(decision).toHaveAttribute("aria-disabled", "true"); + expect(decision).toHaveAccessibleDescription(needs); + await userEvent.click(decision); + } + expect(screen.getByRole("textbox", { name: "Reason for rejecting" })).toBeDisabled(); expect(api.decideProposals).not.toHaveBeenCalled(); }); @@ -151,10 +230,10 @@ describe("ProposalsPanel", () => { decided: 0, results: [{ memory_key: "deploy_window", decided: false, status: "active", reason: "already accepted" }], }); - vi.mocked(api.listProposals).mockResolvedValue({ proposals: [], total: 0 }); await show([P]); - await userEvent.click(screen.getByRole("button", { name: "Actions for deploy_window" })); - await userEvent.click(await screen.findByRole("menuitem", { name: "Reject" })); + vi.mocked(api.listProposals).mockResolvedValue({ proposals: [], total: 0 }); + await open(); + await userEvent.click(screen.getByRole("button", { name: "Reject" })); await waitFor(() => expect(toast).toHaveBeenCalledWith("Not decided: already accepted", "info")); await waitFor(() => expect(api.listProposals).toHaveBeenCalledTimes(2)); }); @@ -166,28 +245,20 @@ describe("ProposalsPanel", () => { decided: 1, results: [{ memory_key: "deploy_window", decided: true, status: "rejected", reason: "" }], }); - vi.mocked(api.listProposals).mockResolvedValue({ proposals: [], total: 0 }); const before = useStore.getState().reviewDecisions; await show([P]); - await userEvent.click(screen.getByRole("button", { name: "Actions for deploy_window" })); - await userEvent.click(await screen.findByRole("menuitem", { name: "Reject" })); + vi.mocked(api.listProposals).mockResolvedValue({ proposals: [], total: 0 }); + await open(); + await userEvent.click(screen.getByRole("button", { name: "Reject" })); await waitFor(() => expect(useStore.getState().reviewDecisions).toBe(before + 1)); + expect(toast).toHaveBeenCalledWith("Rejected", "ok"); }); - it("offers no decision on a key two agents proposed, shows a high one as sensitive, and says the list is cut", async () => { - const other = { ...P, memory_id: "m2", agent: "cursor", value_preview: "", sensitivity: "high" as const }; - const lone = { ...P, memory_id: "m3", memory_key: "standup_time" }; - await show([P, other, lone], 140); - expect(screen.getAllByText("deploy_window")).toHaveLength(2); - // A decision names only the key, so neither of the two can take one; each says why. - for (const accept of screen.getAllByRole("button", { name: "Accept deploy_window" })) { - expect(accept).toHaveAttribute("aria-disabled", "true"); - expect(accept).toHaveAccessibleDescription(/More than one proposal holds this key/); - } - expect(screen.queryByRole("button", { name: "Actions for deploy_window" })).toBeNull(); - expect(screen.getByRole("button", { name: "Accept standup_time" })).toBeInTheDocument(); + it("shows a high proposal as sensitive, and says the list is cut", async () => { + const high = { ...P, memory_id: "m2", memory_key: "door_code", value_preview: "", sensitivity: "high" as const }; + await show([P, high], 140); expect(screen.getByText("sensitive")).toBeInTheDocument(); - expect(screen.getByText("The newest 3 proposals are listed; decide some to see the rest.")).toBeInTheDocument(); + expect(screen.getByText("The newest 2 proposals are listed; decide some to see the rest.")).toBeInTheDocument(); }); it("says an accepted fact that contradicts another waits in Conflicts", async () => { @@ -195,11 +266,9 @@ describe("ProposalsPanel", () => { decided: 1, results: [{ memory_key: "deploy_window", decided: true, status: "conflicted", reason: "" }], }); - vi.mocked(api.listProposals).mockResolvedValue({ proposals: [], total: 0 }); await show([P]); - await userEvent.click(screen.getByRole("button", { name: "Accept deploy_window" })); - expect(api.decideProposals).not.toHaveBeenCalled(); - await screen.findByText("The complete proposal text"); + vi.mocked(api.listProposals).mockResolvedValue({ proposals: [], total: 0 }); + await open(); await userEvent.click(screen.getByRole("button", { name: "Accept reviewed fact" })); await waitFor(() => expect(toast).toHaveBeenCalledWith("Accepted; it contradicts another fact, so it waits in Conflicts", "ok"), @@ -207,17 +276,314 @@ describe("ProposalsPanel", () => { }); it("holds every row until the list is read again after a decision", async () => { - let answer: (v: { proposals: MemoryProposal[]; total: number }) => void = () => {}; + let answer: (v: Listed) => void = () => {}; const lone = { ...P, memory_id: "m3", memory_key: "standup_time" }; await show([P, lone]); vi.mocked(api.listProposals).mockImplementationOnce(() => new Promise((r) => (answer = r))); - await userEvent.click(screen.getByRole("button", { name: "Accept deploy_window" })); - expect(api.decideProposals).not.toHaveBeenCalled(); - await screen.findByText("The complete proposal text"); + await open(); await userEvent.click(screen.getByRole("button", { name: "Accept reviewed fact" })); await waitFor(() => expect(api.listProposals).toHaveBeenCalledTimes(2)); - expect(screen.getByRole("button", { name: "Accept standup_time" })).toBeDisabled(); - answer({ proposals: [lone], total: 1 }); - await waitFor(() => expect(screen.getByRole("button", { name: "Accept standup_time" })).toBeEnabled()); + const other = screen.getByRole("button", { name: "standup_time" }); + expect(other).toHaveAttribute("aria-disabled", "true"); + await userEvent.click(other); + expect(api.getMemoryById).toHaveBeenCalledTimes(1); + await act(async () => answer({ proposals: [lone], total: 1 })); + await waitFor(() => + expect(screen.getByRole("button", { name: "standup_time" })).not.toHaveAttribute("aria-disabled"), + ); + }); + + it("a row names who proposed it, and the cell is empty for a server that sends none", async () => { + const { actor: _none, ...unnamed } = { ...P, memory_id: "m2", memory_key: "standup_time" }; + await show([{ ...P, actor: "human:bob@example.com" }, unnamed]); + expect(screen.getByRole("columnheader", { name: "Proposed by" })).toBeInTheDocument(); + const cells = (key: string) => + within(screen.getByRole("button", { name: key }).closest("tr") as HTMLElement).getAllByRole("cell"); + expect(cells("deploy_window")[2]).toHaveTextContent("bob@example.com"); + // The table repeats the column's name in each cell for a narrow screen; nothing follows it. + expect(cells("standup_time")[2]).toHaveTextContent(/^Proposed by$/); + }); + + it("the dialog shows the proposer, the agent, when it was first proposed and its graded runs above the text", async () => { + await show([{ ...P, graded_passes: 4, graded_fails: 1 }]); + const dialog = await open(); + expect(fact(dialog, "Key")).toHaveTextContent(P.memory_key); + expect(fact(dialog, "Proposed by")).toHaveTextContent("Release Bot bot"); + expect(fact(dialog, "Proposed by")).toHaveTextContent("an agent"); + expect(fact(dialog, "Agent")).toHaveTextContent("claude-code"); + expect(fact(dialog, "First proposed").querySelector("time")).toHaveAttribute( + "dateTime", + "2000-01-01T00:00:00.000Z", + ); + expect(fact(dialog, "Graded runs")).toHaveTextContent("4 passed · 1 failed"); + expect(fact(dialog, "Graded runs")).toHaveTextContent("Graded runs relied on this key, not on this exact text."); + const text = within(dialog).getByText("The complete proposal text"); + const facts = fact(dialog, "Graded runs").closest("dl") as HTMLElement; + expect(facts.compareDocumentPosition(text) & Node.DOCUMENT_POSITION_FOLLOWING).toBeTruthy(); + }); + + it("says no graded run has used the key when none has", async () => { + await show([{ ...P, graded_passes: 0, graded_fails: 0, ready: "" }]); + const dialog = await open(); + const runs = fact(dialog, "Graded runs"); + expect(runs).toHaveTextContent("No graded run has used this key."); + expect(runs).not.toHaveTextContent("passed"); + }); + + it("says so when the reader proposed it", async () => { + await show([{ ...P, actor: "human:Alice" }]); + const dialog = await open(); + const by = fact(dialog, "Proposed by"); + expect(by).toHaveTextContent("a person"); + expect(by).toHaveTextContent("You proposed this, so another administrator accepts it."); + // A hint: the server's answer decides, so the decision stays available. + expect(screen.getByRole("button", { name: "Accept reviewed fact" })).not.toHaveAttribute("aria-disabled"); + }); + + it("shows no proposer for a server that sends none", async () => { + const { actor: _none, ...unnamed } = P; + await show([unnamed]); + const dialog = await open(); + expect(within(dialog).queryByText("Proposed by")).toBeNull(); + expect(fact(dialog, "Agent")).toHaveTextContent("claude-code"); + }); + + it("Reject sends the hash of the text shown and the reason", async () => { + const shown = "c".repeat(64); + vi.mocked(api.getMemoryById).mockResolvedValueOnce(whole(P, { content_sha256: shown, version: 2 })); + await show([P]); + vi.mocked(api.listProposals).mockResolvedValue({ proposals: [], total: 0 }); + await open(); + const reason = screen.getByRole("textbox", { name: "Reason for rejecting" }); + expect(reason).toHaveAccessibleDescription( + "Optional. Kept on the rejected fact. A rejection cannot be undone: the fact has to be proposed again.", + ); + expect(reason).toHaveAttribute("maxlength", "512"); + await userEvent.type(reason, " Out of date "); + await userEvent.click(screen.getByRole("button", { name: "Reject" })); + await waitFor(() => + expect(api.decideProposals).toHaveBeenCalledWith( + SCOPE, + ["deploy_window"], + "reject", + { deploy_window: shown }, + "Out of date", + ), + ); + }); + + it("Accept sends no reason", async () => { + // The client drops the reason of an acceptance, so this case runs it and reads the request. + const actual = await vi.importActual("../../api"); + vi.mocked(api.decideProposals).mockImplementationOnce(actual.decideProposals); + const fetchMock = vi.fn(async (_url: string, _init?: RequestInit) => Response.json({ decided: 1, results: [] })); + vi.stubGlobal("fetch", fetchMock); + await show([P]); + vi.mocked(api.listProposals).mockResolvedValue({ proposals: [], total: 0 }); + await open(); + await userEvent.type(screen.getByRole("textbox", { name: "Reason for rejecting" }), "typed, then accepted"); + await userEvent.click(screen.getByRole("button", { name: "Accept reviewed fact" })); + await waitFor(() => expect(toast).toHaveBeenCalledWith("Accepted", "ok")); + const sent = fetchMock.mock.calls.filter(([url]) => url.endsWith("/v1/memory.proposal_decide")); + expect(sent).toHaveLength(1); + const { consumer: _every, ...body } = JSON.parse(String(sent[0][1]?.body)); + expect(body).toEqual({ + ...SCOPE, + memory_keys: ["deploy_window"], + decision: "accept", + approved_sha256: { deploy_window: P.content_sha256 }, + }); + }); + + it("a decision that fails keeps the review open, with its text and the typed reason", async () => { + vi.mocked(api.decideProposals).mockRejectedValueOnce(new Error("no answer")); + await show([P]); + const dialog = await open(); + await userEvent.type(screen.getByRole("textbox", { name: "Reason for rejecting" }), "Out of date"); + await userEvent.click(screen.getByRole("button", { name: "Reject" })); + await waitFor(() => expect(toastError).toHaveBeenCalledWith("Decision failed", expect.any(Error))); + // Nothing was decided: both decisions are offered again over the same review. + await waitFor(() => expect(screen.getByRole("button", { name: "Reject" })).toBeEnabled()); + expect(dialog).toBeInTheDocument(); + expect(within(dialog).getByText("The complete proposal text")).toBeInTheDocument(); + expect(screen.getByRole("textbox", { name: "Reason for rejecting" })).toHaveValue("Out of date"); + expect(address()).toBe(`${HOME}&key=deploy_window`); + // The list holds what it held, so it is not read again. + expect(api.listProposals).toHaveBeenCalledTimes(1); + // The second try sends the reason typed before the first. + vi.mocked(api.listProposals).mockResolvedValue({ proposals: [], total: 0 }); + await userEvent.click(screen.getByRole("button", { name: "Reject" })); + await screen.findByText("No proposals"); + expect(api.decideProposals).toHaveBeenCalledTimes(2); + expect(api.decideProposals).toHaveBeenLastCalledWith( + SCOPE, + ["deploy_window"], + "reject", + { deploy_window: P.content_sha256 }, + "Out of date", + ); + }); + + it("a key two proposals hold opens with neither decision available", async () => { + const other = { ...P, memory_id: "m2", agent: "cursor" }; + const lone = { ...P, memory_id: "m3", memory_key: "standup_time" }; + await show([P, other, lone]); + expect(screen.getAllByRole("button", { name: "deploy_window" })).toHaveLength(2); + await open(); + // A decision names only the key, so neither of the two can take one; each says why. + for (const name of ["Reject", "Accept reviewed fact"]) { + const decision = screen.getByRole("button", { name }); + expect(decision).toHaveAttribute("aria-disabled", "true"); + expect(decision).toHaveAccessibleDescription(/More than one proposal holds this key/); + await userEvent.click(decision); + } + expect(api.decideProposals).not.toHaveBeenCalled(); + await userEvent.click(screen.getByRole("button", { name: "Cancel" })); + await open("standup_time"); + expect(screen.getByRole("button", { name: "Reject" })).not.toHaveAttribute("aria-disabled"); + }); + + it("opening a proposal writes its key to the address and closing drops it", async () => { + await show([P]); + const length = window.history.length; + await open(); + expect(address()).toBe(`${HOME}&key=deploy_window`); + await userEvent.click(screen.getByRole("button", { name: "Cancel" })); + await waitFor(() => expect(screen.queryByRole("dialog")).toBeNull()); + expect(address()).toBe(HOME); + // Closing returns the focus to the row's key. + await waitFor(() => expect(screen.getByRole("button", { name: "deploy_window" })).toHaveFocus()); + await open(); + await userEvent.click(screen.getByRole("button", { name: "Close" })); + expect(address()).toBe(HOME); + // A decision drops it too, and the focus goes to the panel: the decided row leaves. + vi.mocked(api.listProposals).mockResolvedValue({ proposals: [], total: 0 }); + await open(); + await userEvent.click(screen.getByRole("button", { name: "Reject" })); + await screen.findByText("No proposals"); + expect(address()).toBe(HOME); + expect(screen.getByText("No proposals").closest("[tabindex='-1']")).toHaveFocus(); + expect(window.history.length).toBe(length); + }); + + it("the key in the address opens its dialog", async () => { + showLinked("deploy_window", [P], { proposals: [P], total: 1 }); + const dialog = await screen.findByRole("dialog", { name: "Review proposal" }); + await within(dialog).findByText("The complete proposal text"); + // No row has to be on screen behind it, so the review names the key itself. + expect(fact(dialog, "Key")).toHaveTextContent(P.memory_key); + expect(api.listProposals).toHaveBeenCalledWith(SCOPE, expect.objectContaining({ keys: ["deploy_window"] })); + // One read beside the list's. + expect(api.listProposals).toHaveBeenCalledTimes(2); + expect(api.getMemoryById).toHaveBeenCalledWith("acme", "m1"); + expect(address()).toBe(`${HOME}&key=deploy_window`); + await userEvent.click(screen.getByRole("button", { name: "Cancel" })); + await waitFor(() => expect(screen.queryByRole("dialog")).toBeNull()); + expect(address()).toBe(HOME); + // No row opened it: the focus goes to the panel. + expect(screen.getByRole("table", { name: "Proposals" }).closest("[tabindex='-1']")).toHaveFocus(); + }); + + it("Back to an address that names a key opens it, and to one that names none closes it", async () => { + await show([P]); + vi.mocked(api.listProposals).mockResolvedValue({ proposals: [P], total: 1 }); + window.history.replaceState(null, "", `${HOME}&key=deploy_window`); + act(() => void window.dispatchEvent(new PopStateEvent("popstate"))); + await screen.findByRole("dialog", { name: "Review proposal" }); + window.history.replaceState(null, "", HOME); + act(() => void window.dispatchEvent(new PopStateEvent("popstate"))); + await waitFor(() => expect(screen.queryByRole("dialog")).toBeNull()); + }); + + it("a key that is not pending shows the missing notice, and dismissing it drops the key", async () => { + showLinked("gone_key", [P], { proposals: [], total: 0 }); + const missing = await notice("No pending proposal has this key."); + expect(screen.queryByRole("dialog")).toBeNull(); + expect(address()).toBe(`${HOME}&key=gone_key`); + await userEvent.click(within(missing).getByRole("button", { name: "close" })); + expect(screen.queryByText("No pending proposal has this key.")).toBeNull(); + expect(address()).toBe(HOME); + // The button pressed leaves with the notice: the focus goes to the panel. + expect(screen.getByRole("table", { name: "Proposals" }).closest("[tabindex='-1']")).toHaveFocus(); + }); + + it("a key several proposals hold says how many and opens no dialog", async () => { + const other = { ...P, memory_id: "m2", agent: "cursor" }; + showLinked("deploy_window", [P, other], { proposals: [P, other], total: 2 }); + await notice("2 pending proposals hold this key, so this link opens none of them."); + expect(screen.queryByRole("dialog")).toBeNull(); + expect(api.getMemoryById).not.toHaveBeenCalled(); + }); + + it("a server that ignores the key filter still opens the right row", async () => { + const asked = { ...P, memory_id: "m2", memory_key: "standup_time" }; + showLinked("standup_time", [P, asked], { + proposals: [P, asked], + total: 2, + ignored_args: ["memory_keys"], + }); + await screen.findByRole("dialog", { name: "Review proposal" }); + expect(api.getMemoryById).toHaveBeenCalledWith("acme", "m2"); + }); + + it("a server that ignores the key filter says the proposal is not among the newest listed", async () => { + showLinked("old_key", [P], { proposals: [P], total: 140, ignored_args: ["memory_keys"] }); + await notice("This proposal is not among the newest 1 listed."); + expect(screen.queryByRole("dialog")).toBeNull(); + }); + + it("says a proposal could not be opened, and keeps the key for a reload", async () => { + const failed = new Error("unreachable"); + showLinked("deploy_window", [P], failed); + await waitFor(() => expect(toastError).toHaveBeenCalledWith("Couldn't open the proposal", failed, { read: true })); + expect(address()).toBe(`${HOME}&key=deploy_window`); + expect(screen.queryByRole("dialog")).toBeNull(); + }); + + // The address names key_a, and its read is still out when a click opens a row: another + // key's, or key_a's own. + describe.each(["key_b", "key_a"])("with the review of %s opened by a click", (opened) => { + it.each<[string, Listed | Error]>([ + ["with a match", { proposals: [{ ...P, memory_id: "ma", memory_key: "key_a" }], total: 1 }], + ["with no match", { proposals: [], total: 0 }], + ["with a failure", new Error("unreachable")], + ])("a read of the address's key that answers late %s leaves that review as it is", async (_how, late) => { + const a = { ...P, memory_id: "ma", memory_key: "key_a" }; + const b = { ...P, memory_id: "mb", memory_key: "key_b" }; + const answer = showLinkedHeld("key_a", [a, b]); + await screen.findAllByText("key_b"); + const dialog = await open(opened); + await userEvent.type(screen.getByRole("textbox", { name: "Reason for rejecting" }), "Out of date"); + await answer(late); + expect(screen.getByRole("dialog", { name: "Review proposal" })).toBe(dialog); + expect(fact(dialog, "Key")).toHaveTextContent(opened); + expect(within(dialog).getByText("The complete proposal text")).toBeInTheDocument(); + expect(screen.getByRole("textbox", { name: "Reason for rejecting" })).toHaveValue("Out of date"); + expect(address()).toBe(`${HOME}&key=${opened}`); + expect(api.getMemoryById).toHaveBeenCalledTimes(1); + expect(screen.queryByText("No pending proposal has this key.")).toBeNull(); + expect(toastError).not.toHaveBeenCalled(); + }); + }); + + it("the table is one tab stop and Enter opens the current row", async () => { + const second = { ...P, memory_id: "m2", memory_key: "standup_time" }; + await show([P, second]); + const keys = ["deploy_window", "standup_time"].map((name) => screen.getByRole("button", { name })); + await waitFor(() => expect(keys.map((k) => k.tabIndex)).toEqual([0, -1])); + keys[0].focus(); + await userEvent.keyboard("{ArrowDown}"); + expect(keys[1]).toHaveFocus(); + expect(keys.map((k) => k.tabIndex)).toEqual([-1, 0]); + vi.mocked(api.getMemoryById).mockResolvedValueOnce(whole(second, { value: "Standup is at ten" })); + await userEvent.keyboard("{Enter}"); + const dialog = await screen.findByRole("dialog", { name: "Review proposal" }); + expect(await within(dialog).findByText("Standup is at ten")).toBeInTheDocument(); + }); + + it("the open dialog has no accessibility violation", async () => { + await show([P]); + const dialog = await open(); + expect(await axeViolations(dialog)).toEqual([]); }); }); diff --git a/frontend/src/views/admin/Proposals.tsx b/frontend/src/views/admin/Proposals.tsx index 5f1cc71a09..8d4afa6613 100644 --- a/frontend/src/views/admin/Proposals.tsx +++ b/frontend/src/views/admin/Proposals.tsx @@ -1,17 +1,22 @@ -import { useRef, useState } from "react"; +import { useEffect, useId, useRef, useState } from "react"; import { Badge } from "@clickhouse/click-ui/Badge"; import { Button } from "@clickhouse/click-ui/Button"; +import { Link } from "@clickhouse/click-ui/Link"; import { Table } from "@clickhouse/click-ui/Table"; +import { TextAreaField } from "@clickhouse/click-ui/TextAreaField"; import { decideProposals, getMemoryById, listProposals, type MemoryProposal, type MemoryById } from "../../api"; -import { useIdentity, useStore } from "../../lib/state"; +import { setViewParam, urlParam, useIdentity, useStore } from "../../lib/state"; import { useNamespaceRoleRead } from "../../lib/namespaceRole"; import { callReason } from "../../lib/callReason"; import { useAbortableEffect } from "../../lib/hooks"; +import { useRowNav } from "../../lib/useRowNav"; +import { actorKind, actorName } from "../../lib/tasks"; import { toast, toastError } from "../../components/Toast"; -import { AgentBadge } from "../../components/AgentBadge"; +import { AgentBadge, NameBadge } from "../../components/AgentBadge"; +import { Alert } from "../../components/ui/Alert"; import { ListState } from "../../components/ui/ListState"; import { ListTime } from "../../components/ui/ListTime"; -import { RowMenu } from "../../components/ui/RowMenu"; +import { MetaList, MetaRow } from "../../components/ui/Meta"; import { Unavailable } from "../../components/ui/Unavailable"; import { Modal, ModalFooter } from "../../components/ui/Modal"; import { TableSkeleton } from "../../components/Skeleton"; @@ -19,16 +24,27 @@ import { TableSkeleton } from "../../components/Skeleton"; const HEADERS = [ { label: "Fact" }, { label: "Agent", width: "160px" }, + { label: "Proposed by", width: "150px" }, { label: "Graded runs", width: "200px" }, { label: "Written", width: "110px" }, - { label: Decision, width: "150px" }, ]; const SHARED_KEY = "More than one proposal holds this key; a decision names only the key, so it cannot choose between them."; +// The server keeps at most this much of a rejection's reason. +const REASON_MAX = 512; + +/** The proposal under review, the complete row once it is read, and why it cannot be shown. */ +interface Review { + proposal: MemoryProposal; + row?: MemoryById; + error?: string; +} + /** Facts on trial (written with `proposed=true`) and how the runs that relied on each - * went: accept one to serve it by default, reject it to retire it. */ + * went: a row's key opens its review, which accepts it to serve it by default or rejects + * it to retire it. The address names the proposal under review (`?key=`). */ export function ProposalsPanel() { const identity = useIdentity(); const scope = { org: identity.org, namespace: identity.namespace }; @@ -38,7 +54,14 @@ export function ProposalsPanel() { const [error, setError] = useState(null); const [reload, setReload] = useState(0); const [busy, setBusy] = useState(false); - const [review, setReview] = useState<{ proposal: MemoryProposal; row?: MemoryById; error?: string } | null>(null); + const [review, setReview] = useState(null); + // The key under review as of the latest render, for a read that answers after it opened. + const reviewKey = useRef(null); + reviewKey.current = review?.proposal.memory_key ?? null; + const [reason, setReason] = useState(""); + // What a key in the address opened instead of a review. + const [notice, setNotice] = useState(null); + const reasonHint = useId(); const whoami = useStore((s) => s.whoami); const roleRead = useNamespaceRoleRead(identity.namespace); // Accept and Reject stay in view for a role that cannot decide, with the role it needs. @@ -50,8 +73,16 @@ export function ProposalsPanel() { ? "Acceptance needs an authenticated human administrator." : null); - const openReview = async (proposal: MemoryProposal) => { + // Closing a review returns the focus to the row's key (the Modal's opener); after a + // decision, or with no row behind it (the address opened it), the panel takes it. + const focusPanel = useRef(false); + + const openReview = async (proposal: MemoryProposal, fromAddress = false) => { + focusPanel.current = fromAddress; + setNotice(null); + setReason(""); setReview({ proposal }); + setViewParam("key", proposal.memory_key); try { const row = await getMemoryById(identity.org, proposal.memory_id); setReview((current) => @@ -77,6 +108,10 @@ export function ProposalsPanel() { ); } }; + const closeReview = () => { + setReview(null); + setViewParam("key", null); + }; // A decision holds every row until the list is read again. const [reading, setReading] = useState(false); @@ -96,27 +131,74 @@ export function ProposalsPanel() { [identity.org, identity.namespace, reload], ); - const decide = async (key: string, decision: "accept" | "reject", approvedHash = "") => { + // The key the address names, as the panel opens and as Back or Forward lands on it. + const [linked, setLinked] = useState(() => ({ key: urlParam("key") })); + useEffect(() => { + const sync = () => setLinked({ key: urlParam("key") }); + window.addEventListener("popstate", sync); + return () => window.removeEventListener("popstate", sync); + }, []); + useAbortableEffect( + (signal, live) => { + const key = linked.key; + if (!key) { + // The address names no proposal, so none stays open over it. + setNotice(null); + setReview(null); + return; + } + // A row opened or closed while this read is out rewrites the address. The answer for a + // key the address does not name, or whose review is already open, changes nothing. + const wanted = () => live() && urlParam("key") === key && reviewKey.current !== key; + // One read beside the list's: the proposal may wait past the rows the list shows. + listProposals(scope, { keys: [key], signal }) + .then((r) => { + if (!wanted()) return; + // Matched by key here: a server a release behind answers its whole list. + const matches = r.proposals.filter((p) => p.memory_key === key); + if (matches.length === 1) return void openReview(matches[0], true); + setReview(null); + setNotice( + matches.length > 1 + ? `${matches.length} pending proposals hold this key, so this link opens none of them.` + : r.ignored_args?.includes("memory_keys") && r.total > r.proposals.length + ? `This proposal is not among the newest ${r.proposals.length} listed.` + : "No pending proposal has this key.", + ); + }) + // The address keeps the key, so a reload asks again. + .catch((e) => wanted() && toastError("Couldn't open the proposal", e, { read: true })); + }, + [identity.org, identity.namespace, linked], + ); + + const decide = async (decision: "accept" | "reject") => { + if (!review?.row?.content_sha256) return; + const key = review.proposal.memory_key; + // The hash served with the text on screen goes with either decision. + const read = { [key]: review.row.content_sha256 }; setBusy(true); try { - const r = await decideProposals(scope, [key], decision, { - [key]: approvedHash, - }); + const r = await decideProposals(scope, [key], decision, read, reason.trim()); const result = r.results[0]; // The sidebar reads its counts again now, not at its next minute. useStore.setState((s) => ({ reviewDecisions: s.reviewDecisions + 1 })); if (r.decided === 0) // Not a proposal any more: decided by the policy or by someone else first. - toast(`Not decided: ${result.reason || "it is no longer a proposal"}`, "info"); - else if (result.status === "conflicted") + toast(`Not decided: ${result?.reason || "it is no longer a proposal"}`, "info"); + else if (result?.status === "conflicted") toast("Accepted; it contradicts another fact, so it waits in Conflicts", "ok"); else toast(decision === "accept" ? "Accepted" : "Rejected", "ok"); } catch (e) { toastError("Decision failed", e); + // No answer, so nothing is known to be decided: the review stays open with its text + // and the typed reason, for another try. + return; } finally { setBusy(false); - setReview(null); } + focusPanel.current = true; + closeReview(); // The decided row unmounts; focus goes to the panel, and the list is read again. setReading(true); panel.current?.focus(); @@ -127,17 +209,31 @@ export function ProposalsPanel() { // key more than one proposal holds cannot be decided for one of them. const perKey = new Map(); for (const p of rows ?? []) perKey.set(p.memory_key, (perKey.get(p.memory_key) ?? 0) + 1); + const shared = review !== null && (perKey.get(review.proposal.memory_key) ?? 0) > 1 ? SHARED_KEY : null; + const rejectReason = decideReason ?? shared; + const unread = !review?.row || !!review.error; + // The rows are one tab stop; the review over them owns the keys while it is open. + const rowNav = useRowNav({ enabled: review === null && (rows?.length ?? 0) > 0 }); // One wrapper in every state, so the focus a decision gives it survives an empty answer. return (
!open && !busy && setReview(null)} + onOpenChange={(open) => !open && !busy && closeReview()} title="Review proposal" - description="Read the complete fact before accepting it." + description="Read the complete fact before deciding." className="w-full max-w-[720px]" + // The reviewer starts at the facts and the text, not in the reason field. + initialFocus="dialog" + onCloseAutoFocus={(e) => { + if (!focusPanel.current) return; + focusPanel.current = false; + e.preventDefault(); + panel.current?.focus(); + }} > + {review && } {review?.error ? (

{review.error}

) : !review?.row ? ( @@ -147,22 +243,51 @@ export function ProposalsPanel() { {typeof review.row.value === "string" ? review.row.value : JSON.stringify(review.row.value, null, 2)} )} +
+ +

+ Optional. Kept on the rejected fact. A rejection cannot be undone: the fact has to be proposed again. +

+
- - - + + +
+ {notice && ( + { + setNotice(null); + setViewParam("key", null); + // The button pressed leaves with the notice. + panel.current?.focus(); + }} + /> + )} {error ? ( setReload((n) => n + 1)} /> ) : rows?.length === 0 ? ( @@ -173,83 +298,103 @@ export function ProposalsPanel() { description="A fact an agent writes as proposed waits here until it is accepted or rejected." /> ) : ( - <> +
: undefined} size="sm" headers={HEADERS} - rows={(rows ?? []).map((p) => { - const lone = perKey.get(p.memory_key) === 1; - return { - id: p.memory_id, - items: [ - { - label: ( -
-
{p.memory_key}
- {p.sensitivity === "high" ? ( - - ) : ( -
{p.value_preview}
- )} -
- ), - overflowMode: "wrap", - }, - { label: }, - { - label: ( - - {p.graded_passes} passed · {p.graded_fails} failed - {p.ready && } - - ), - }, - { label: }, - { - label: ( - - - - - {lone && ( - void decide(p.memory_key, "reject"), - }, - ]} - /> - )} - - ), - }, - ], - }; - })} + rows={(rows ?? []).map((p) => ({ + id: p.memory_id, + items: [ + { + label: ( +
+ !held && void openReview(p)} + > + {p.memory_key} + + {p.sensitivity === "high" ? ( + + ) : ( +
{p.value_preview}
+ )} +
+ ), + overflowMode: "wrap", + }, + { label: }, + { label: p.actor ? : null }, + { + label: ( + + {p.graded_passes} passed · {p.graded_fails} failed + {p.ready && } + + ), + }, + { label: }, + ], + }))} /> {rows !== null && total > rows.length && (

The newest {rows.length} proposals are listed; decide some to see the rest.

)} - + )} ); } + +/** What the reviewer weighs before the text: the key a decision names, who proposed it, + * through which agent, since when, and how the graded runs that used its key went. */ +function ProposalFacts({ proposal, reader }: { proposal: MemoryProposal; reader: string }) { + const actor = proposal.actor ?? ""; + // A hint only: the server knows the reviewer's linked identities and decides. + const own = reader !== "" && actor.replace(/^(human|process):/, "").toLowerCase() === reader.toLowerCase(); + const graded = proposal.graded_passes + proposal.graded_fails > 0; + return ( + + + {proposal.memory_key} + + {actor && ( + + + + {actorKind(actor) === "human" ? "a person" : "an agent"} + + {own && You proposed this, so another administrator accepts it.} + + )} + + + + + + + + {graded ? ( + <> + {proposal.graded_passes} passed · {proposal.graded_fails} failed + Graded runs relied on this key, not on this exact text. + + ) : ( + "No graded run has used this key." + )} + + + ); +} diff --git a/frontend/src/views/admin/ReviewQueue.test.tsx b/frontend/src/views/admin/ReviewQueue.test.tsx index 441f80c812..f99199db03 100644 --- a/frontend/src/views/admin/ReviewQueue.test.tsx +++ b/frontend/src/views/admin/ReviewQueue.test.tsx @@ -83,6 +83,9 @@ import { const ORG = "dev"; const WAIT = { timeout: 5000 }; +const QUEUE = "/admin/review_queue"; +const address = () => window.location.pathname + window.location.search; +const selected = (name: RegExp) => expect(screen.getByRole("tab", { name })).toHaveAttribute("aria-selected", "true"); const conflict = (key: string): ConflictRow => ({ memory_id: `id-${key}`, @@ -181,10 +184,14 @@ const panelReads = () => vi.mocked(listAutoResolved).mock.calls.filter(([, o]) = describe("ReviewQueue", () => { beforeEach(() => { + window.history.replaceState(null, "", QUEUE); vi.mocked(listConflicts).mockReset(); vi.mocked(listAllowlist).mockReset(); vi.mocked(listLearnings).mockReset(); vi.mocked(listProposals).mockReset(); + // A test that opens Duplicates as an admin reads them; the next one starts from none. + vi.mocked(listMemoryDuplicates).mockClear(); + vi.mocked(listDocumentDuplicates).mockClear(); vi.mocked(listAllowlist).mockResolvedValue({ rows: [] }); vi.mocked(listLearnings).mockResolvedValue({ rows: [] }); vi.mocked(listAutoResolved).mockReset(); @@ -229,6 +236,8 @@ describe("ReviewQueue", () => { render(); const tab = (name: RegExp) => screen.getByRole("tab", { name }); await waitFor(() => expect(tab(/Proposals/)).toHaveAttribute("aria-selected", "true"), WAIT); + // The page's own move is not a pick: the address names no tab. + expect(address()).toBe(QUEUE); // The person's pick stays: Conflicts reads its count again and the tab does not move. await user.click(tab(/Conflicts/)); await waitFor(() => expect(countReview).toHaveBeenCalledTimes(2), WAIT); @@ -267,6 +276,139 @@ describe("ReviewQueue", () => { expect(screen.getByRole("tab", { name: /Conflicts/ })).toHaveAttribute("aria-selected", "true"); }); + // The address carries the open tab, so a link, a reload and Back reopen it. + it("a tab in the address opens that tab, and the first count does not move it", async () => { + let first: (r: ReviewCounts) => void = () => {}; + vi.mocked(countReview).mockImplementationOnce(() => new Promise((r) => (first = r))); + vi.mocked(listConflicts).mockResolvedValue({ rows: [], next_before_version: null }); + window.history.replaceState(null, "", `${QUEUE}?tab=conflicts`); + seed("ns-a", "admin"); + render(); + await screen.findByText("No conflicts", {}, WAIT); + // The count that moves a page asked for no tab to Proposals. + await act(async () => first({ total: 0, proposals: 2 })); + selected(/Conflicts/); + // Back to an entry that names another tab opens it. + window.history.replaceState(null, "", `${QUEUE}?tab=duplicates`); + act(() => void window.dispatchEvent(new PopStateEvent("popstate"))); + await waitFor(() => selected(/Duplicates/), WAIT); + cleanup(); + // A reload of that address opens the tab at once. + render(); + selected(/Duplicates/); + }); + + it("Back to an address that names no tab leaves the open tab as it is", async () => { + vi.mocked(listConflicts).mockResolvedValue({ rows: [], next_before_version: null }); + vi.mocked(listProposals).mockResolvedValue({ proposals: [], total: 0 }); + vi.mocked(countReview).mockResolvedValue({ total: 0, proposals: 2 }); + onTestFinished(() => { + vi.mocked(countReview).mockImplementation(async () => ({ total: 0 })); + }); + seed("ns-a", "admin"); + render(); + // The first count moves the page to Proposals and writes no tab. + await waitFor(() => selected(/Proposals/), WAIT); + expect(address()).toBe(QUEUE); + act(() => void window.dispatchEvent(new PopStateEvent("popstate"))); + selected(/Proposals/); + expect(address()).toBe(QUEUE); + }); + + it("a picked tab is written to the address, Conflicts included", async () => { + vi.mocked(listConflicts).mockResolvedValue({ rows: [], next_before_version: null }); + vi.mocked(listProposals).mockResolvedValue({ proposals: [], total: 0 }); + seed("ns-a", "admin"); + const length = window.history.length; + render(); + await userEvent.click(await screen.findByRole("tab", { name: /Proposals/ }, WAIT)); + expect(address()).toBe(`${QUEUE}?tab=proposals`); + await userEvent.click(screen.getByRole("tab", { name: /Conflicts/ })); + expect(address()).toBe(`${QUEUE}?tab=conflicts`); + // A pick writes to the entry it is on: Back leaves the page. + expect(window.history.length).toBe(length); + }); + + it("a key in the address opens Proposals", async () => { + vi.mocked(listConflicts).mockResolvedValue({ rows: [], next_before_version: null }); + vi.mocked(listProposals).mockResolvedValue({ proposals: [proposal], total: 1 }); + vi.mocked(getMemoryById).mockResolvedValue({ + found: true, + memory_id: proposal.memory_id, + namespace: "ns-a", + memory_key: proposal.memory_key, + content_sha256: proposal.content_sha256, + value: "Deploys run on Tuesdays", + version: 1, + pinned: false, + created_at: null, + }); + window.history.replaceState(null, "", `${QUEUE}?key=deploy_window`); + seed("ns-a", "admin"); + render(); + selected(/Proposals/); + const dialog = await screen.findByRole("dialog", { name: "Review proposal" }, WAIT); + expect(await within(dialog).findByText("Deploys run on Tuesdays", {}, WAIT)).toBeInTheDocument(); + expect(address()).toBe(`${QUEUE}?key=deploy_window`); + }); + + it("a probed tab in the address opens when its probe finds rows, and falls back to Conflicts when it finds none", async () => { + vi.mocked(listConflicts).mockResolvedValue({ rows: [], next_before_version: null }); + let answer: (v: { rows: LearningEntry[] }) => void = () => {}; + vi.mocked(listLearnings).mockReturnValueOnce(new Promise((r) => (answer = r))); + window.history.replaceState(null, "", `${QUEUE}?tab=learnings`); + seed("ns-a"); + render(); + // Held while the probe is out: Conflicts shows, and the address keeps the tab. + await screen.findByText("No conflicts", {}, WAIT); + expect(address()).toBe(`${QUEUE}?tab=learnings`); + await act(async () => answer({ rows: [learning("a/learned")] })); + await waitFor(() => selected(/Learnings/), WAIT); + expect(await screen.findByText("a/learned", {}, WAIT)).toBeInTheDocument(); + cleanup(); + + // A probe that finds none hands the page to Conflicts, in the address too. + render(); + await waitFor(() => expect(address()).toBe(QUEUE), WAIT); + selected(/Conflicts/); + expect(screen.queryByRole("tab", { name: /Learnings/ })).toBeNull(); + }); + + it("a tab of another page in the address is dropped", async () => { + vi.mocked(listConflicts).mockResolvedValue({ rows: [], next_before_version: null }); + window.history.replaceState(null, "", `${QUEUE}?tab=memory`); + seed("ns-a", "admin"); + render(); + await screen.findByText("No conflicts", {}, WAIT); + selected(/Conflicts/); + expect(address()).toBe(QUEUE); + }); + + it("leaving Proposals drops the key", async () => { + vi.mocked(listConflicts).mockResolvedValue({ rows: [], next_before_version: null }); + vi.mocked(listProposals).mockResolvedValue({ proposals: [], total: 0 }); + window.history.replaceState(null, "", `${QUEUE}?tab=proposals&key=gone_key`); + seed("ns-a", "admin"); + render(); + await screen.findByText("No pending proposal has this key.", {}, WAIT); + await userEvent.click(screen.getByRole("tab", { name: /Duplicates/ })); + expect(address()).toBe(`${QUEUE}?tab=duplicates`); + }); + + it("a namespace switch drops the tab from the address", async () => { + vi.mocked(listConflicts).mockResolvedValue({ rows: [], next_before_version: null }); + window.history.replaceState(null, "", `${QUEUE}?tab=duplicates`); + seed("ns-a", "admin"); + render(); + // The mount keeps the tab the address asked for. + await waitFor(() => expect(listLearnings).toHaveBeenCalled(), WAIT); + selected(/Duplicates/); + expect(address()).toBe(`${QUEUE}?tab=duplicates`); + seed("ns-b", "admin"); + await waitFor(() => selected(/Conflicts/), WAIT); + expect(address()).toBe(QUEUE); + }); + it("shows Duplicates to every role, read for an admin only; Proposals to a reader; none read for an unknown role", async () => { vi.mocked(listConflicts).mockResolvedValue({ rows: [conflict("city")], next_before_version: null }); seed("ns-a"); @@ -278,6 +420,8 @@ describe("ReviewQueue", () => { expect(await screen.findByText("Your role on this namespace is still loading.", {}, WAIT)).toBeVisible(); expect(listProposals).not.toHaveBeenCalled(); cleanup(); + // The next visit asks for no tab: the pick above stays in the address otherwise. + window.history.replaceState(null, "", QUEUE); seed("ns-a", "writer"); const user = userEvent.setup(); @@ -290,6 +434,7 @@ describe("ReviewQueue", () => { expect(listMemoryDuplicates).not.toHaveBeenCalled(); expect(listDocumentDuplicates).not.toHaveBeenCalled(); cleanup(); + window.history.replaceState(null, "", QUEUE); seed("ns-a", "admin"); render(); @@ -324,6 +469,8 @@ describe("ReviewQueue", () => { expect(await screen.findByText("Your role on this namespace is still loading.", {}, WAIT)).toBeVisible(); expect(listDefinitions).not.toHaveBeenCalled(); cleanup(); + // The next visit asks for no tab: the pick above stays in the address otherwise. + window.history.replaceState(null, "", QUEUE); seed("ns-a", "writer"); render(); @@ -331,6 +478,7 @@ describe("ReviewQueue", () => { expect(await screen.findByText("Needs admin on ns-a. An admin of it can grant that.", {}, WAIT)).toBeVisible(); expect(listDefinitions).not.toHaveBeenCalled(); cleanup(); + window.history.replaceState(null, "", QUEUE); seed("ns-a", "admin"); render(); diff --git a/frontend/src/views/admin/ReviewQueue.tsx b/frontend/src/views/admin/ReviewQueue.tsx index 462d6e35c3..c102d598cf 100644 --- a/frontend/src/views/admin/ReviewQueue.tsx +++ b/frontend/src/views/admin/ReviewQueue.tsx @@ -34,7 +34,7 @@ import { import { DefinitionsPanel } from "./Definitions"; import { DuplicatesPanel } from "./Duplicates"; import { ProposalsPanel } from "./Proposals"; -import { useIdentity, useStore } from "../../lib/state"; +import { setViewParam, urlParam, useIdentity, useStore } from "../../lib/state"; import { Panel } from "../../components/ui/Panel"; import { LoadingSkeleton, PageHeader, SectionHeading, TabTrigger, Unavailable } from "../../components/ui"; import { Skeleton, TableSkeleton } from "../../components/Skeleton"; @@ -82,6 +82,18 @@ const QUEUE_TABS: Record = { definitions: "Definitions", }; +function isQueueTab(v: string | null): v is QueueTab { + return v !== null && Object.hasOwn(QUEUE_TABS, v); +} + +/** The tab the address asks for: its `tab`, else Proposals when it names a proposal's + * `key`; null when it asks for none. */ +function readTab(): QueueTab | null { + const tab = urlParam("tab"); + if (isQueueTab(tab)) return tab; + return urlParam("key") === null ? null : "proposals"; +} + export function ReviewQueue() { const identity = useIdentity(); // Probe whether the two niche sub-tabs (Learnings, Exceptions) have @@ -128,18 +140,35 @@ export function ReviewQueue() { const proposalsReason = callReason("memory.proposals", queueRole, whoami, identity.namespace); // Shown to every role; one below admin sees what it needs, and nothing is read. const definitionsReason = callReason("memory.definitions.list", queueRole, whoami, identity.namespace); - const [tab, setTab] = useState("conflicts"); + // The address carries the open tab (`?tab=`), so a link, a reload and Back reopen it. + const [asked] = useState(readTab); + const [tab, setTab] = useState(asked ?? "conflicts"); // The page's first count of a namespace moves it to Proposals when proposals wait and no - // conflict is open, unless a tab was picked first. Later counts leave the tab alone, and a - // count a decision overtook (null) keeps Conflicts, where that decision was made. - const settled = useRef(false); + // conflict is open, unless a tab was asked for or picked first; that move writes nothing + // to the address. Later counts leave the tab alone, and a count a decision overtook + // (null) keeps Conflicts, where that decision was made. + const settled = useRef(asked !== null); const settle = useCallback((r: ReviewCounts | null) => { if (settled.current) return; settled.current = true; if (r && r.total === 0 && (r.proposals ?? 0) > 0) setTab("proposals"); }, []); - // A tab that is no longer offered (its probe found nothing, or its access went) hands the - // page back to Conflicts. + // A link or browser history can change the tab without remounting the page. An address + // that asks for none leaves the tab as it is. + const navSeq = useStore((s) => s.navSeq); + useEffect(() => { + const sync = () => { + // Settings owns `tab` too, and a navigation carries it between the two pages. + if (urlParam("tab") !== null && !isQueueTab(urlParam("tab"))) setViewParam("tab", null); + const next = readTab(); + if (!next) return; + settled.current = true; + setTab(next); + }; + sync(); + window.addEventListener("popstate", sync); + return () => window.removeEventListener("popstate", sync); + }, [navSeq]); const offered: Record = { conflicts: true, learnings: hasLearnings, @@ -149,10 +178,32 @@ export function ReviewQueue() { duplicates: true, definitions: true, }; + // A tab the address asks for is held while the probe that offers it is unanswered. + const pending: Record = { + conflicts: false, + learnings: probedLearnings === null, + auto: !roleKnown || (autoReadable && probedAuto?.scope !== scopeKey), + exceptions: probedExceptions === null, + proposals: false, + duplicates: false, + definitions: false, + }; const tabOffered = offered[tab]; + const tabPending = pending[tab]; + // A tab that is not offered (its probe found nothing, or its access went) hands the page + // back to Conflicts, in the address too. + useEffect(() => { + if (tabOffered || tabPending) return; + setTab("conflicts"); + setViewParam("tab", null); + }, [tabOffered, tabPending]); + // What the page shows while a held tab waits for its probe. + const shown: QueueTab = tabOffered ? tab : "conflicts"; useEffect(() => { - if (!tabOffered) setTab("conflicts"); - }, [tabOffered]); + if (shown === "auto") setAutoOpened(true); + }, [shown]); + // The namespace the tab belongs to: a switch starts over, a mount does not. + const tabScope = useRef(scopeKey); // A probe seeds its panel's first view once: a panel opened again (the tabs unmount an // inactive one) reads afresh, so a learning promoted or an exception removed since does // not come back from the probe. @@ -163,10 +214,14 @@ export function ReviewQueue() { setProbedExceptions(null); setSeedsUsed({ learnings: false, exceptions: false }); // A namespace switch starts from Conflicts: the previous namespace's probes (and a tab - // they revealed) must not outlive it. - settled.current = false; - setTab("conflicts"); - setAutoOpened(false); + // they revealed) must not outlive it. The mount keeps the tab the address asked for. + if (tabScope.current !== scopeKey) { + tabScope.current = scopeKey; + settled.current = false; + setTab("conflicts"); + setViewParam("tab", null); + setAutoOpened(false); + } listLearnings({ org: identity.org, namespace: identity.namespace }, "pending", LEARNINGS_READ, { signal }) .then((r) => { if (live()) setProbedLearnings(r.rows || []); @@ -205,7 +260,7 @@ export function ReviewQueue() { @@ -214,11 +269,14 @@ export function ReviewQueue() { rows or the role reaches them. Until then the lone panel is the page itself, not a tab panel without tabs. */} { settled.current = true; setTab(t as QueueTab); - if (t === "auto") setAutoOpened(true); + // Every pick is written, Conflicts too: a reload keeps it over what the count says. + setViewParam("tab", t); + // A proposal's key belongs to the Proposals tab. + if (t !== "proposals") setViewParam("key", null); }} > diff --git a/sdk/go/wire/models.gen.go b/sdk/go/wire/models.gen.go index 6868f00309..10d9fe3d7c 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: 89731d59fda7a96ab4476c4e23f20a5d4cb501cc1de5a67c5960b8ad4bbadc43 +// Registry model schema SHA-256: 7f87ddc5fbd02902979af5035477706d52ada42f8ff0cbbf67dc49e3ef77b521 // Package wire contains the Go requests and responses for Loom operations. package wire @@ -7967,6 +7967,7 @@ type MemoryProposal struct { MemoryID string `json:"memory_id"` ContentSHA256 *string `json:"content_sha256,omitempty"` Agent *string `json:"agent,omitempty"` + Actor *string `json:"actor,omitempty"` MemoryType *string `json:"memory_type,omitempty"` ValuePreview *string `json:"value_preview,omitempty"` Sensitivity *string `json:"sensitivity,omitempty"` @@ -8011,13 +8012,14 @@ type MemoryProposalDecision struct { // MemoryProposalsInput is the request to memory.proposals. type MemoryProposalsInput struct { - Org string `json:"org"` - Namespace string `json:"namespace"` - Prefix *string `json:"prefix,omitempty"` - Tags *[]string `json:"tags,omitempty"` - Only *string `json:"only,omitempty"` - Limit *int64 `json:"limit,omitempty"` - CountOnly *bool `json:"count_only,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Prefix *string `json:"prefix,omitempty"` + Tags *[]string `json:"tags,omitempty"` + MemoryKeys *[]string `json:"memory_keys,omitempty"` + Only *string `json:"only,omitempty"` + Limit *int64 `json:"limit,omitempty"` + CountOnly *bool `json:"count_only,omitempty"` } // MemoryProposalsOutput is the response from memory.proposals. diff --git a/sdk/python/loom/ops.py b/sdk/python/loom/ops.py index 8b0c6c6e7a..3643c24894 100644 --- a/sdk/python/loom/ops.py +++ b/sdk/python/loom/ops.py @@ -15801,6 +15801,7 @@ class MemoryProposalsInput(TypedDict, total=False): namespace: Required[str] prefix: NotRequired[str] tags: NotRequired[list[str]] + memory_keys: NotRequired[list[str]] only: NotRequired[Literal["", "ready"]] limit: NotRequired[int] count_only: NotRequired[bool] @@ -15811,6 +15812,7 @@ class MemoryProposalsBody(TypedDict, total=False): namespace: NotRequired[str] prefix: NotRequired[str] tags: NotRequired[list[str]] + memory_keys: NotRequired[list[str]] only: NotRequired[Literal["", "ready"]] limit: NotRequired[int] count_only: NotRequired[bool] @@ -15827,6 +15829,7 @@ class MemoryProposal(TypedDict, total=False): memory_id: Required[str] content_sha256: NotRequired[str] agent: NotRequired[str] + actor: NotRequired[str] memory_type: NotRequired[str] value_preview: NotRequired[str] sensitivity: NotRequired[str] diff --git a/sdk/ruby/lib/clickhouse/loom/generated/ops.rb b/sdk/ruby/lib/clickhouse/loom/generated/ops.rb index 08e7c12d35..39654d9c32 100644 --- a/sdk/ruby/lib/clickhouse/loom/generated/ops.rb +++ b/sdk/ruby/lib/clickhouse/loom/generated/ops.rb @@ -244,7 +244,7 @@ module Generated "memory.pin" => OpSpec.new("memory.pin", "memory", "pin", true, false, "writer", "experimental", %w[org namespace agent user_id session_id run_id memory_key memory_type value tags entities relations files confidence source_trace source_class source_resource_id ttl_seconds clear_expiry on_expire expire_reason valid_at valid_to pinned classify if_match_sha256 char_limit sensitivity dry_run proposed].freeze, %w[org namespace agent memory_key value].freeze), "memory.promote" => OpSpec.new("memory.promote", "memory", "promote", false, false, "admin", "experimental", %w[org namespace agent user_id session_id memory_key target_key rationale approver reversible_for_days promoted_from_candidate_id approved_sha256].freeze, %w[org namespace agent memory_key].freeze), "memory.proposal_decide" => OpSpec.new("memory.proposal_decide", "memory", "proposal_decide", true, false, "admin", "experimental", %w[org namespace memory_keys decision approved_sha256 reason].freeze, %w[org namespace memory_keys decision].freeze), - "memory.proposals" => OpSpec.new("memory.proposals", "memory", "proposals", true, true, "viewer", "experimental", %w[org namespace prefix tags only limit count_only].freeze, %w[org namespace].freeze), + "memory.proposals" => OpSpec.new("memory.proposals", "memory", "proposals", true, true, "viewer", "experimental", %w[org namespace prefix tags memory_keys only limit count_only].freeze, %w[org namespace].freeze), "memory.provenance" => OpSpec.new("memory.provenance", "memory", "provenance", true, true, "viewer", "stable", %w[org namespace agent user_id session_id run_id memory_key].freeze, %w[org namespace agent memory_key].freeze), "memory.recall" => OpSpec.new("memory.recall", "memory", "recall", true, true, "viewer", "stable", %w[org namespace agent user_id session_id run_id query since until thread role match order top_k cursor offset max_chars read_scope].freeze, %w[org namespace agent].freeze), "memory.record.conflicts" => OpSpec.new("memory.record.conflicts", "memory", "record_conflicts", true, true, "viewer", "experimental", %w[org namespace schema_name memory_key open_only limit].freeze, %w[org namespace].freeze), diff --git a/sdk/rust/src/wire_models.rs b/sdk/rust/src/wire_models.rs index bbe9ff73eb..aacace973c 100644 --- a/sdk/rust/src/wire_models.rs +++ b/sdk/rust/src/wire_models.rs @@ -39603,28 +39603,30 @@ pub struct MemoryProposal { #[serde(default = "default_1793")] pub agent: String, #[serde(default = "default_1794")] - pub memory_type: String, + pub actor: String, #[serde(default = "default_1795")] - pub value_preview: String, + pub memory_type: String, #[serde(default = "default_1796")] - pub sensitivity: String, + pub value_preview: String, #[serde(default = "default_1797")] - pub tags: Vec, + pub sensitivity: String, #[serde(default = "default_1798")] - pub created_at: String, + pub tags: Vec, #[serde(default = "default_1799")] - pub graded_passes: Integer, + pub created_at: String, #[serde(default = "default_1800")] - pub graded_fails: Integer, + pub graded_passes: Integer, #[serde(default = "default_1801")] - pub last_graded_at: String, + pub graded_fails: Integer, #[serde(default = "default_1802")] - pub used_count: Integer, + pub last_graded_at: String, #[serde(default = "default_1803")] - pub harm_count: Integer, + pub used_count: Integer, #[serde(default = "default_1804")] - pub ready: MemoryProposalReady, + pub harm_count: Integer, #[serde(default = "default_1805")] + pub ready: MemoryProposalReady, + #[serde(default = "default_1806")] pub conflict_with: Vec, } @@ -39640,24 +39642,24 @@ pub enum ProposalPolicyMode { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProposalPolicy { - #[serde(default = "default_1808")] - pub mode: ProposalPolicyMode, #[serde(default = "default_1809")] - pub min_passes: Integer, + pub mode: ProposalPolicyMode, #[serde(default = "default_1810")] - pub max_fails: Integer, + pub min_passes: Integer, #[serde(default = "default_1811")] + pub max_fails: Integer, + #[serde(default = "default_1812")] pub reject_after_fails: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryProposalsOutput { - #[serde(default = "default_1806")] - pub proposals: Vec, #[serde(default = "default_1807")] + pub proposals: Vec, + #[serde(default = "default_1808")] pub total: Integer, - #[serde(default = "default_1812")] + #[serde(default = "default_1813")] pub policy: ProposalPolicy, } @@ -39702,6 +39704,12 @@ pub struct MemoryProposalsInput { skip_serializing_if = "Option::is_none", deserialize_with = "present_value" )] + pub memory_keys: Option>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] pub only: Option, #[serde( default, @@ -39728,6 +39736,7 @@ impl MemoryProposalsInput { namespace: None, prefix: None, tags: None, + memory_keys: None, only: None, limit: None, count_only: None, @@ -39749,6 +39758,10 @@ impl MemoryProposalsInput { self.tags = Some(tags.into_iter().map(Into::into).collect()); self } + pub fn memory_keys(mut self, memory_keys: impl IntoIterator>) -> Self { + self.memory_keys = Some(memory_keys.into_iter().map(Into::into).collect()); + self + } pub fn only(mut self, only: MemoryProposalsInputOnly) -> Self { self.only = Some(only); self @@ -39775,19 +39788,19 @@ impl MemoryProposalsInput { pub struct MemoryProvenanceLink { pub direction: String, pub memory_key: String, - #[serde(default = "default_1826")] - pub relation: String, #[serde(default = "default_1827")] - pub label: String, + pub relation: String, #[serde(default = "default_1828")] - pub explanation: String, + pub label: String, #[serde(default = "default_1829")] - pub evidence: Vec, + pub explanation: String, #[serde(default = "default_1830")] - pub confidence: f64, + pub evidence: Vec, #[serde(default = "default_1831")] - pub author: String, + pub confidence: f64, #[serde(default = "default_1832")] + pub author: String, + #[serde(default = "default_1833")] pub run_id: String, } @@ -39795,33 +39808,33 @@ pub struct MemoryProvenanceLink { #[non_exhaustive] pub struct MemoryProvenanceOutput { pub found: bool, - #[serde(default = "default_1813")] - pub source_trace: String, #[serde(default = "default_1814")] - pub source_kind: String, + pub source_trace: String, #[serde(default = "default_1815")] - pub actor: String, + pub source_kind: String, #[serde(default = "default_1816")] - pub source_class: String, + pub actor: String, #[serde(default = "default_1817")] - pub source_label: String, + pub source_class: String, #[serde(default = "default_1818")] - pub thread_id: String, + pub source_label: String, #[serde(default = "default_1819")] - pub thread_exists: bool, + pub thread_id: String, #[serde(default = "default_1820")] - pub thread_title: String, + pub thread_exists: bool, #[serde(default = "default_1821")] - pub agent: String, + pub thread_title: String, #[serde(default = "default_1822")] - pub session_id: String, + pub agent: String, #[serde(default = "default_1823")] - pub run_id: String, + pub session_id: String, #[serde(default = "default_1824")] - pub written_at: String, + pub run_id: String, #[serde(default = "default_1825")] + pub written_at: String, + #[serde(default = "default_1826")] pub source_resource_id: String, - #[serde(default = "default_1833")] + #[serde(default = "default_1834")] pub links: Vec, } @@ -39916,17 +39929,17 @@ impl MemoryProvenanceInput { pub struct RecallTurn { pub evidence_id: String, pub session_id: String, - #[serde(default = "default_1834")] - pub role: String, #[serde(default = "default_1835")] - pub actor: String, + pub role: String, #[serde(default = "default_1836")] - pub observed_at: String, + pub actor: String, #[serde(default = "default_1837")] - pub content: String, + pub observed_at: String, #[serde(default = "default_1838")] - pub truncated: bool, + pub content: String, #[serde(default = "default_1839")] + pub truncated: bool, + #[serde(default = "default_1840")] pub matched_tokens: Integer, } @@ -39943,21 +39956,21 @@ pub enum MemoryRecallOutputOrder { #[non_exhaustive] pub struct MemoryRecallOutput { pub turns: Vec, - #[serde(default = "default_1840")] - pub total_matched: Integer, #[serde(default = "default_1841")] - pub returned: Integer, + pub total_matched: Integer, #[serde(default = "default_1842")] - pub has_more: bool, + pub returned: Integer, #[serde(default = "default_1843")] - pub next_cursor: String, + pub has_more: bool, #[serde(default = "default_1844")] - pub next_offset: Integer, + pub next_cursor: String, #[serde(default = "default_1845")] - pub order: MemoryRecallOutputOrder, + pub next_offset: Integer, #[serde(default = "default_1846")] - pub query_tokens: Vec, + pub order: MemoryRecallOutputOrder, #[serde(default = "default_1847")] + pub query_tokens: Vec, + #[serde(default = "default_1848")] pub tokens_returned: Integer, } @@ -40239,19 +40252,19 @@ pub struct MemoryRecordConflictRow { pub schema_name: String, pub memory_key: String, pub field_name: String, - #[serde(default = "default_1848")] - pub prior_value: Value, #[serde(default = "default_1849")] + pub prior_value: Value, + #[serde(default = "default_1850")] pub incoming_value: Value, pub prior_record_id: String, pub incoming_record_id: String, - #[serde(default = "default_1850")] - pub prior_memory_id: String, #[serde(default = "default_1851")] - pub incoming_memory_id: String, + pub prior_memory_id: String, #[serde(default = "default_1852")] - pub detected_at: Option, + pub incoming_memory_id: String, #[serde(default = "default_1853")] + pub detected_at: Option, + #[serde(default = "default_1854")] pub resolved_at: Option, } @@ -40259,7 +40272,7 @@ pub struct MemoryRecordConflictRow { #[non_exhaustive] pub struct MemoryRecordConflictsOutput { pub rows: Vec, - #[serde(default = "default_1854")] + #[serde(default = "default_1855")] pub truncated: bool, } @@ -40369,19 +40382,19 @@ pub enum MemoryRecordRowStatus { #[non_exhaustive] pub struct MemoryRecordRow { pub record_id: String, - #[serde(default = "default_1855")] - pub memory_key: String, #[serde(default = "default_1856")] - pub memory_id: String, + pub memory_key: String, #[serde(default = "default_1857")] - pub record: std::collections::HashMap, + pub memory_id: String, #[serde(default = "default_1858")] - pub field_states: std::collections::HashMap, + pub record: std::collections::HashMap, #[serde(default = "default_1859")] - pub status: MemoryRecordRowStatus, + pub field_states: std::collections::HashMap, #[serde(default = "default_1860")] - pub valid_at: Option, + pub status: MemoryRecordRowStatus, #[serde(default = "default_1861")] + pub valid_at: Option, + #[serde(default = "default_1862")] pub valid_to: Option, } @@ -40448,7 +40461,7 @@ impl MemoryRecordHistoryInput { #[non_exhaustive] pub struct MemoryRecordQueryOutput { pub rows: Vec, - #[serde(default = "default_1862")] + #[serde(default = "default_1863")] pub truncated: bool, } @@ -40672,15 +40685,15 @@ pub enum MemoryRecordWriteOutputKeySource { pub struct MemoryRecordWriteOutput { pub record_id: String, pub field_count: Integer, - #[serde(default = "default_1863")] - pub memory_key: String, #[serde(default = "default_1864")] - pub key_source: MemoryRecordWriteOutputKeySource, + pub memory_key: String, #[serde(default = "default_1865")] - pub fold: std::collections::HashMap, + pub key_source: MemoryRecordWriteOutputKeySource, #[serde(default = "default_1866")] - pub superseded_record_id: String, + pub fold: std::collections::HashMap, #[serde(default = "default_1867")] + pub superseded_record_id: String, + #[serde(default = "default_1868")] pub conflicts: Integer, } @@ -40923,13 +40936,13 @@ impl MemoryRecordWriteInput { #[non_exhaustive] pub struct MemoryRedactOutput { pub redacted: bool, - #[serde(default = "default_1868")] - pub refused_head: bool, #[serde(default = "default_1869")] - pub redacted_at: Option, + pub refused_head: bool, #[serde(default = "default_1870")] - pub cache_rows_deleted: Integer, + pub redacted_at: Option, #[serde(default = "default_1871")] + pub cache_rows_deleted: Integer, + #[serde(default = "default_1872")] pub precedent_rows_deleted: Integer, } @@ -41089,7 +41102,7 @@ impl MemoryReindexInput { #[non_exhaustive] pub struct MemoryRejectOutput { pub rejected: bool, - #[serde(default = "default_1872")] + #[serde(default = "default_1873")] pub rejected_at: Option, } @@ -41205,7 +41218,7 @@ pub struct MemoryRelatedHit { pub struct MemoryRelatedOutput { pub results: Vec, pub source_entities: Vec, - #[serde(default = "default_1873")] + #[serde(default = "default_1874")] pub reason: String, } @@ -41320,13 +41333,13 @@ impl MemoryRelatedInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryResolveOrphanDuplicatesOutput { - #[serde(default = "default_1874")] - pub candidates: Integer, #[serde(default = "default_1875")] - pub reactivated: Integer, + pub candidates: Integer, #[serde(default = "default_1876")] - pub dry_run: bool, + pub reactivated: Integer, #[serde(default = "default_1877")] + pub dry_run: bool, + #[serde(default = "default_1878")] pub memory_ids: Vec, } @@ -41403,15 +41416,15 @@ impl MemoryResolveOrphanDuplicatesInput { #[non_exhaustive] pub struct MemoryRestoreOutput { pub restored: bool, - #[serde(default = "default_1878")] - pub memory_id: Option, #[serde(default = "default_1879")] - pub version: Option, + pub memory_id: Option, #[serde(default = "default_1880")] - pub expired: bool, + pub version: Option, #[serde(default = "default_1881")] - pub redacted: bool, + pub expired: bool, #[serde(default = "default_1882")] + pub redacted: bool, + #[serde(default = "default_1883")] pub from_status: String, } @@ -41531,13 +41544,13 @@ pub struct SearchTraceHit { pub content_excerpt: String, pub distance: f64, pub similarity: f64, - #[serde(default = "default_1883")] + #[serde(default = "default_1884")] pub entity_boost: f64, pub rank_score: f64, pub rank: Integer, - #[serde(default = "default_1884")] - pub source: String, #[serde(default = "default_1885")] + pub source: String, + #[serde(default = "default_1886")] pub parent_memory_key: String, } @@ -41547,11 +41560,11 @@ pub struct MemorySearchTraceOutput { pub results: Vec, pub embedding_model: String, pub entity_filter: Vec, - #[serde(default = "default_1886")] - pub query_spellings: std::collections::HashMap, #[serde(default = "default_1887")] - pub query_spellings_skipped: bool, + pub query_spellings: std::collections::HashMap, #[serde(default = "default_1888")] + pub query_spellings_skipped: bool, + #[serde(default = "default_1889")] pub stale_dropped: Integer, } @@ -42754,7 +42767,7 @@ pub struct SearchTraceLogRow { pub embedding_model: String, pub latency_ms: Integer, pub run_id: String, - #[serde(default = "default_1889")] + #[serde(default = "default_1890")] pub operation: String, } @@ -42863,71 +42876,71 @@ pub struct RefusedFact { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemorySetFromMessagesOutput { - #[serde(default = "default_1890")] - pub written: Vec, #[serde(default = "default_1891")] - pub refused: Vec, + pub written: Vec, #[serde(default = "default_1892")] - pub tokens_in: Integer, + pub refused: Vec, #[serde(default = "default_1893")] - pub tokens_out: Integer, + pub tokens_in: Integer, #[serde(default = "default_1894")] - pub llm_provider: String, + pub tokens_out: Integer, #[serde(default = "default_1895")] - pub llm_model: String, + pub llm_provider: String, #[serde(default = "default_1896")] - pub segments: Integer, + pub llm_model: String, #[serde(default = "default_1897")] - pub foresight: Integer, + pub segments: Integer, #[serde(default = "default_1898")] - pub forgotten: Integer, + pub foresight: Integer, #[serde(default = "default_1899")] - pub forgotten_keys: Vec, + pub forgotten: Integer, #[serde(default = "default_1900")] - pub forget_requests: Integer, + pub forgotten_keys: Vec, #[serde(default = "default_1901")] - pub about_other: Integer, + pub forget_requests: Integer, #[serde(default = "default_1902")] - pub premise_facts: Integer, + pub about_other: Integer, #[serde(default = "default_1903")] - pub learning_candidates: Integer, + pub premise_facts: Integer, #[serde(default = "default_1904")] - pub ignored_args: Vec, + pub learning_candidates: Integer, #[serde(default = "default_1905")] - pub segmenter: String, + pub ignored_args: Vec, #[serde(default = "default_1906")] - pub cached_tokens_in: Integer, + pub segmenter: String, #[serde(default = "default_1907")] - pub ontology_warnings: Vec, + pub cached_tokens_in: Integer, #[serde(default = "default_1908")] - pub evidence_ids: Vec, + pub ontology_warnings: Vec, #[serde(default = "default_1909")] - pub belief_source_links: Integer, + pub evidence_ids: Vec, #[serde(default = "default_1910")] - pub pipeline_errors: Vec, + pub belief_source_links: Integer, #[serde(default = "default_1911")] - pub value_updates_linked: Integer, + pub pipeline_errors: Vec, #[serde(default = "default_1912")] - pub stubbed_fields: Vec, + pub value_updates_linked: Integer, #[serde(default = "default_1913")] - pub degraded: Vec, + pub stubbed_fields: Vec, #[serde(default = "default_1914")] - pub deferred: bool, + pub degraded: Vec, #[serde(default = "default_1915")] - pub queue_id: String, + pub deferred: bool, #[serde(default = "default_1916")] - pub deferred_by: String, + pub queue_id: String, #[serde(default = "default_1917")] - pub stage_ms: std::collections::HashMap, + pub deferred_by: String, #[serde(default = "default_1918")] - pub observation_date_source: String, + pub stage_ms: std::collections::HashMap, #[serde(default = "default_1919")] - pub under_operator_policy: bool, + pub observation_date_source: String, #[serde(default = "default_1920")] - pub extract_prompt_keys: Vec, + pub under_operator_policy: bool, #[serde(default = "default_1921")] - pub llm_cache_hits: Integer, + pub extract_prompt_keys: Vec, #[serde(default = "default_1922")] + pub llm_cache_hits: Integer, + #[serde(default = "default_1923")] pub llm_cache_misses: Integer, } @@ -43382,22 +43395,22 @@ pub enum StackEntrySection { #[non_exhaustive] pub struct StackEntry { pub section: StackEntrySection, - #[serde(default = "default_1923")] - pub memory_key: String, #[serde(default = "default_1924")] - pub memory_type: String, + pub memory_key: String, #[serde(default = "default_1925")] + pub memory_type: String, + #[serde(default = "default_1926")] pub value: String, pub tokens: Integer, - #[serde(default = "default_1926")] - pub pinned: bool, #[serde(default = "default_1927")] - pub recall_count: Integer, + pub pinned: bool, #[serde(default = "default_1928")] - pub last_recalled_at: Option, + pub recall_count: Integer, #[serde(default = "default_1929")] - pub actor: String, + pub last_recalled_at: Option, #[serde(default = "default_1930")] + pub actor: String, + #[serde(default = "default_1931")] pub namespace: String, } @@ -43582,14 +43595,14 @@ impl MemoryStackInput { pub struct MemoryStatus { pub memory_id: String, pub status: String, - #[serde(default = "default_1931")] + #[serde(default = "default_1932")] pub superseded_by: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryStatusesOutput { - #[serde(default = "default_1932")] + #[serde(default = "default_1933")] pub rows: Vec, } @@ -43638,23 +43651,23 @@ impl MemoryStatusesInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemorySweepExpiredOutput { - #[serde(default = "default_1933")] - pub scanned: Integer, #[serde(default = "default_1934")] - pub tombstoned: Integer, + pub scanned: Integer, #[serde(default = "default_1935")] - pub demoted: Integer, + pub tombstoned: Integer, #[serde(default = "default_1936")] - pub anonymized: Integer, + pub demoted: Integer, #[serde(default = "default_1937")] - pub locked_skipped: Integer, + pub anonymized: Integer, #[serde(default = "default_1938")] - pub moved_skipped: Integer, + pub locked_skipped: Integer, #[serde(default = "default_1939")] - pub dry_run: bool, + pub moved_skipped: Integer, #[serde(default = "default_1940")] - pub sample: Vec>, + pub dry_run: bool, #[serde(default = "default_1941")] + pub sample: Vec>, + #[serde(default = "default_1942")] pub failures: Vec, } @@ -43731,10 +43744,10 @@ pub struct MemoryTimelineEntry { pub memory_key: String, pub memory_type: String, pub content_excerpt: String, - #[serde(default = "default_1942")] + #[serde(default = "default_1943")] pub valid_at: Option, pub created_at: String, - #[serde(default = "default_1943")] + #[serde(default = "default_1944")] pub namespace: String, } @@ -43742,7 +43755,7 @@ pub struct MemoryTimelineEntry { #[non_exhaustive] pub struct MemoryTimelineOutput { pub events: Vec, - #[serde(default = "default_1944")] + #[serde(default = "default_1945")] pub total_matching: Integer, } @@ -43934,9 +43947,9 @@ impl MemoryTimelineInput { pub struct MemoryTouchResult { pub memory_key: String, pub touched: bool, - #[serde(default = "default_1947")] - pub version: Option, #[serde(default = "default_1948")] + pub version: Option, + #[serde(default = "default_1949")] pub expires_at: Option, } @@ -43944,13 +43957,13 @@ pub struct MemoryTouchResult { #[non_exhaustive] pub struct MemoryTouchOutput { pub touched: bool, - #[serde(default = "default_1945")] - pub version: Option, #[serde(default = "default_1946")] + pub version: Option, + #[serde(default = "default_1947")] pub expires_at: Option, - #[serde(default = "default_1949")] - pub results: Vec, #[serde(default = "default_1950")] + pub results: Vec, + #[serde(default = "default_1951")] pub touched_count: Integer, } @@ -44130,15 +44143,15 @@ impl MemoryTouchInput { #[non_exhaustive] pub struct MemoryUnlockOutput { pub unlocked: bool, - #[serde(default = "default_1951")] - pub reason: String, #[serde(default = "default_1952")] - pub memory_id: String, + pub reason: String, #[serde(default = "default_1953")] - pub version: Option, + pub memory_id: String, #[serde(default = "default_1954")] - pub previous_mode: String, + pub version: Option, #[serde(default = "default_1955")] + pub previous_mode: String, + #[serde(default = "default_1956")] pub unlocked_by: String, } @@ -44243,11 +44256,11 @@ impl MemoryUnlockInput { #[non_exhaustive] pub struct MemoryUnpinOutput { pub unpinned: bool, - #[serde(default = "default_1956")] - pub reason: String, #[serde(default = "default_1957")] - pub memory_id: String, + pub reason: String, #[serde(default = "default_1958")] + pub memory_id: String, + #[serde(default = "default_1959")] pub version: Option, } @@ -44341,15 +44354,15 @@ impl MemoryUnpinInput { #[non_exhaustive] pub struct MemoryUpdateCandidate { pub memory_id: String, - #[serde(default = "default_1964")] - pub agent: String, #[serde(default = "default_1965")] - pub user_id: String, + pub agent: String, #[serde(default = "default_1966")] - pub session_id: String, + pub user_id: String, #[serde(default = "default_1967")] - pub version: Integer, + pub session_id: String, #[serde(default = "default_1968")] + pub version: Integer, + #[serde(default = "default_1969")] pub status: String, } @@ -44357,23 +44370,23 @@ pub struct MemoryUpdateCandidate { #[non_exhaustive] pub struct MemoryUpdateOutput { pub updated: bool, - #[serde(default = "default_1959")] - pub memory_id: String, #[serde(default = "default_1960")] - pub memory_key: String, + pub memory_id: String, #[serde(default = "default_1961")] - pub new_version: Integer, + pub memory_key: String, #[serde(default = "default_1962")] - pub content_sha256: String, + pub new_version: Integer, #[serde(default = "default_1963")] + pub content_sha256: String, + #[serde(default = "default_1964")] pub reason: String, - #[serde(default = "default_1969")] - pub candidates: Vec, #[serde(default = "default_1970")] - pub conflict_verdict: String, + pub candidates: Vec, #[serde(default = "default_1971")] - pub conflict_peers: Integer, + pub conflict_verdict: String, #[serde(default = "default_1972")] + pub conflict_peers: Integer, + #[serde(default = "default_1973")] pub duplicate_of: String, } @@ -44582,15 +44595,15 @@ impl MemoryUpdateInput { #[non_exhaustive] pub struct MemoryUpdateByIdOutput { pub updated: bool, - #[serde(default = "default_1973")] - pub new_version: Integer, #[serde(default = "default_1974")] - pub content_sha256: String, + pub new_version: Integer, #[serde(default = "default_1975")] - pub conflict_verdict: String, + pub content_sha256: String, #[serde(default = "default_1976")] - pub conflict_peers: Integer, + pub conflict_verdict: String, #[serde(default = "default_1977")] + pub conflict_peers: Integer, + #[serde(default = "default_1978")] pub duplicate_of: String, } @@ -44718,23 +44731,23 @@ impl MemoryUpdateByIdInput { #[non_exhaustive] pub struct MemoryVerifyOutput { pub found: bool, - #[serde(default = "default_1978")] - pub changed: bool, #[serde(default = "default_1979")] - pub memory_id: String, + pub changed: bool, #[serde(default = "default_1980")] - pub memory_key: String, + pub memory_id: String, #[serde(default = "default_1981")] - pub namespace: String, + pub memory_key: String, #[serde(default = "default_1982")] - pub verified_by: String, + pub namespace: String, #[serde(default = "default_1983")] - pub verified_at: Option, + pub verified_by: String, #[serde(default = "default_1984")] - pub verification: String, + pub verified_at: Option, #[serde(default = "default_1985")] - pub version: Integer, + pub verification: String, #[serde(default = "default_1986")] + pub version: Integer, + #[serde(default = "default_1987")] pub content_sha256: String, } @@ -44939,13 +44952,13 @@ pub struct SchemaFieldOutput { #[serde(rename = "type")] pub r#type: String, pub required: bool, - #[serde(default = "default_1989")] - pub identity: bool, #[serde(default = "default_1990")] - pub enum_values: Vec, + pub identity: bool, #[serde(default = "default_1991")] - pub constraints: std::collections::HashMap, + pub enum_values: Vec, #[serde(default = "default_1992")] + pub constraints: std::collections::HashMap, + #[serde(default = "default_1993")] pub description: String, } @@ -44954,11 +44967,11 @@ pub struct SchemaFieldOutput { pub struct MemorySchemaSummary { pub schema_id: String, pub name: String, - #[serde(default = "default_1987")] - pub description: String, #[serde(default = "default_1988")] + pub description: String, + #[serde(default = "default_1989")] pub status: String, - #[serde(default = "default_1993")] + #[serde(default = "default_1994")] pub fields: Vec, } @@ -45373,13 +45386,13 @@ impl MemorySchemaRegisterInput { #[non_exhaustive] pub struct MentorPlane { pub plane: String, - #[serde(default = "default_1995")] - pub calls: Integer, #[serde(default = "default_1996")] - pub available: Option, + pub calls: Integer, #[serde(default = "default_1997")] - pub when: String, + pub available: Option, #[serde(default = "default_1998")] + pub when: String, + #[serde(default = "default_1999")] pub mentored: bool, } @@ -45389,11 +45402,11 @@ pub struct MentorHint { pub code: String, pub severity: String, pub text: String, - #[serde(default = "default_2000")] - pub ops: Vec, #[serde(default = "default_2001")] - pub evidence: std::collections::HashMap, + pub ops: Vec, #[serde(default = "default_2002")] + pub evidence: std::collections::HashMap, + #[serde(default = "default_2003")] pub plane: Option, } @@ -45401,9 +45414,9 @@ pub struct MentorHint { #[non_exhaustive] pub struct MentorAdoption { pub code: String, - #[serde(default = "default_2004")] - pub shown_sessions: Integer, #[serde(default = "default_2005")] + pub shown_sessions: Integer, + #[serde(default = "default_2006")] pub followed_sessions: Integer, } @@ -45439,7 +45452,7 @@ pub enum UsageRungSource { #[non_exhaustive] pub struct UsageRung { pub rung: UsageRungRung, - #[serde(default = "default_2007")] + #[serde(default = "default_2008")] pub count: Option, pub source: UsageRungSource, pub meaning: String, @@ -45454,27 +45467,27 @@ pub struct MentorBriefOutput { pub window_seconds: Integer, pub computed_at: String, pub sessions: Integer, - #[serde(default = "default_1994")] + #[serde(default = "default_1995")] pub usage: std::collections::HashMap, - #[serde(default = "default_1999")] + #[serde(default = "default_2000")] pub planes: Vec, - #[serde(default = "default_2003")] + #[serde(default = "default_2004")] pub hints: Vec, - #[serde(default = "default_2006")] + #[serde(default = "default_2007")] pub adoption: Vec, - #[serde(default = "default_2008")] - pub usage_evidence: Vec, #[serde(default = "default_2009")] - pub ledger_from: Option, + pub usage_evidence: Vec, #[serde(default = "default_2010")] - pub ledger_retention_days: Option, + pub ledger_from: Option, #[serde(default = "default_2011")] - pub agents: Vec, + pub ledger_retention_days: Option, #[serde(default = "default_2012")] - pub agent_defaulted: bool, + pub agents: Vec, #[serde(default = "default_2013")] - pub skipped: Vec, + pub agent_defaulted: bool, #[serde(default = "default_2014")] + pub skipped: Vec, + #[serde(default = "default_2015")] pub healthy: bool, } @@ -45623,33 +45636,33 @@ impl MentorGuideInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct NamespaceAuditSummary { - #[serde(default = "default_2015")] - pub live_rows: Integer, #[serde(default = "default_2016")] - pub live_bytes: Integer, + pub live_rows: Integer, #[serde(default = "default_2017")] - pub excerpt_bytes: Integer, + pub live_bytes: Integer, #[serde(default = "default_2018")] - pub version_rows: Integer, + pub excerpt_bytes: Integer, #[serde(default = "default_2019")] - pub version_bytes: Integer, + pub version_rows: Integer, #[serde(default = "default_2020")] - pub unembedded_rows: Integer, + pub version_bytes: Integer, #[serde(default = "default_2021")] - pub gets: Integer, + pub unembedded_rows: Integer, #[serde(default = "default_2022")] - pub searches: Integer, + pub gets: Integer, #[serde(default = "default_2023")] - pub sets: Integer, + pub searches: Integer, #[serde(default = "default_2024")] - pub get_search_ratio: f64, + pub sets: Integer, #[serde(default = "default_2025")] - pub inspector_calls: Integer, + pub get_search_ratio: f64, #[serde(default = "default_2026")] - pub typed_gets: Integer, + pub inspector_calls: Integer, #[serde(default = "default_2027")] - pub written_in_window: Integer, + pub typed_gets: Integer, #[serde(default = "default_2028")] + pub written_in_window: Integer, + #[serde(default = "default_2029")] pub ledger_calls: Integer, } @@ -45681,25 +45694,25 @@ pub struct NamespaceAuditFinding { pub kind: NamespaceAuditFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_2029")] - pub window_seconds: Option, #[serde(default = "default_2030")] + pub window_seconds: Option, + #[serde(default = "default_2031")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_2031")] - pub evidence: Vec, #[serde(default = "default_2032")] - pub exceptions: String, + pub evidence: Vec, #[serde(default = "default_2033")] + pub exceptions: String, + #[serde(default = "default_2034")] pub uncertainty: String, pub code: String, pub severity: NamespaceAuditFindingSeverity, pub count: Integer, pub share: f64, - #[serde(default = "default_2034")] - pub bytes: Integer, #[serde(default = "default_2035")] + pub bytes: Integer, + #[serde(default = "default_2036")] pub samples: Vec>, pub detail: String, pub remedy: String, @@ -45714,7 +45727,7 @@ pub struct NamespaceAuditOutput { pub window_seconds: Integer, pub summary: NamespaceAuditSummary, pub findings: Vec, - #[serde(default = "default_2036")] + #[serde(default = "default_2037")] pub skipped: Vec, pub coverage: ReportCoverage, pub healthy: bool, @@ -45805,29 +45818,29 @@ pub enum BrowseEntryMyStatus { #[non_exhaustive] pub struct BrowseEntry { pub namespace: String, - #[serde(default = "default_2037")] + #[serde(default = "default_2038")] pub kind: String, pub description: String, pub owner_email: String, pub member_count: Integer, - #[serde(default = "default_2038")] + #[serde(default = "default_2039")] pub requires_approval: bool, pub created_at: String, - #[serde(default = "default_2039")] - pub join_policy: String, #[serde(default = "default_2040")] - pub visibility: String, + pub join_policy: String, #[serde(default = "default_2041")] - pub my_status: BrowseEntryMyStatus, + pub visibility: String, #[serde(default = "default_2042")] - pub my_role: String, + pub my_status: BrowseEntryMyStatus, #[serde(default = "default_2043")] - pub repo: String, + pub my_role: String, #[serde(default = "default_2044")] - pub branch: String, + pub repo: String, #[serde(default = "default_2045")] - pub guide_revision: Integer, + pub branch: String, #[serde(default = "default_2046")] + pub guide_revision: Integer, + #[serde(default = "default_2047")] pub guide_summary: String, } @@ -45931,9 +45944,9 @@ pub enum NamespaceCancelRequestOutputClearedRole { pub struct NamespaceCancelRequestOutput { pub cancelled: bool, pub namespace: String, - #[serde(default = "default_2047")] - pub cleared_role: Option, #[serde(default = "default_2048")] + pub cleared_role: Option, + #[serde(default = "default_2049")] pub cancelled_at: Option, } @@ -46005,7 +46018,7 @@ pub struct NamespaceDeleteOutput { pub deleted: bool, pub namespace: String, pub updated_at: String, - #[serde(default = "default_2049")] + #[serde(default = "default_2050")] pub sources_retired: Vec, } @@ -46074,67 +46087,67 @@ pub enum NamespaceGetOutputClassification { pub struct NamespaceGetOutput { pub found: bool, pub namespace: String, - #[serde(default = "default_2050")] - pub kind: Option, #[serde(default = "default_2051")] - pub owner_email: Option, + pub kind: Option, #[serde(default = "default_2052")] - pub description: Option, + pub owner_email: Option, #[serde(default = "default_2053")] - pub tags: Option>, + pub description: Option, #[serde(default = "default_2054")] - pub active: Option, + pub tags: Option>, #[serde(default = "default_2055")] - pub conversation_logging_enabled: Option, + pub active: Option, #[serde(default = "default_2056")] - pub capture_generation_io: Option, + pub conversation_logging_enabled: Option, #[serde(default = "default_2057")] - pub coverage_sweep: Option, + pub capture_generation_io: Option, #[serde(default = "default_2058")] - pub consolidation_enabled: Option, + pub coverage_sweep: Option, #[serde(default = "default_2059")] - pub daily_cost_cap_usd: Option, + pub consolidation_enabled: Option, #[serde(default = "default_2060")] - pub daily_user_cost_cap_usd: Option, + pub daily_cost_cap_usd: Option, #[serde(default = "default_2061")] - pub budget_alert_inbox: Option, + pub daily_user_cost_cap_usd: Option, #[serde(default = "default_2062")] - pub conflict_threshold: Option, + pub budget_alert_inbox: Option, #[serde(default = "default_2063")] - pub retention_days: Option, + pub conflict_threshold: Option, #[serde(default = "default_2064")] - pub warm_days: Option, + pub retention_days: Option, #[serde(default = "default_2065")] - pub visibility: Option, + pub warm_days: Option, #[serde(default = "default_2066")] - pub requires_approval: Option, + pub visibility: Option, #[serde(default = "default_2067")] - pub join_policy: Option, + pub requires_approval: Option, #[serde(default = "default_2068")] - pub effective_join_policy: Option, + pub join_policy: Option, #[serde(default = "default_2069")] - pub retrieval_defaults: Option>, + pub effective_join_policy: Option, #[serde(default = "default_2070")] - pub rerank_endpoint: Option, + pub retrieval_defaults: Option>, #[serde(default = "default_2071")] - pub classify_endpoint: Option, + pub rerank_endpoint: Option, #[serde(default = "default_2072")] - pub default_conflict_policy: Option, + pub classify_endpoint: Option, #[serde(default = "default_2073")] - pub proposal_policy: Option, + pub default_conflict_policy: Option, #[serde(default = "default_2074")] - pub code_change_policy: Option, + pub proposal_policy: Option, #[serde(default = "default_2075")] - pub tag_registry: Option>>, + pub code_change_policy: Option, #[serde(default = "default_2076")] - pub classification: Option, + pub tag_registry: Option>>, #[serde(default = "default_2077")] - pub guide_revision: Option, + pub classification: Option, #[serde(default = "default_2078")] - pub guide_summary: Option, + pub guide_revision: Option, #[serde(default = "default_2079")] - pub created_at: Option, + pub guide_summary: Option, #[serde(default = "default_2080")] + pub created_at: Option, + #[serde(default = "default_2081")] pub updated_at: Option, } @@ -46187,17 +46200,17 @@ impl NamespaceGetInput { #[non_exhaustive] pub struct NamespaceGuideGetOutput { pub found: bool, - #[serde(default = "default_2081")] - pub revision: Integer, #[serde(default = "default_2082")] - pub content: String, + pub revision: Integer, #[serde(default = "default_2083")] - pub summary: String, + pub content: String, #[serde(default = "default_2084")] - pub note: String, + pub summary: String, #[serde(default = "default_2085")] - pub updated_by: String, + pub note: String, #[serde(default = "default_2086")] + pub updated_by: String, + #[serde(default = "default_2087")] pub updated_at: Option, } @@ -46334,17 +46347,17 @@ impl NamespaceGuideHistoryInput { #[non_exhaustive] pub struct NamespaceGuideSetOutputNamespaceGuideGetOutput { pub found: bool, - #[serde(default = "default_2088")] - pub revision: Integer, #[serde(default = "default_2089")] - pub content: String, + pub revision: Integer, #[serde(default = "default_2090")] - pub summary: String, + pub content: String, #[serde(default = "default_2091")] - pub note: String, + pub summary: String, #[serde(default = "default_2092")] - pub updated_by: String, + pub note: String, #[serde(default = "default_2093")] + pub updated_by: String, + #[serde(default = "default_2094")] pub updated_at: Option, } @@ -46352,10 +46365,10 @@ pub struct NamespaceGuideSetOutputNamespaceGuideGetOutput { #[non_exhaustive] pub struct NamespaceGuideSetOutput { pub written: bool, - #[serde(default = "default_2087")] + #[serde(default = "default_2088")] pub conflict: bool, pub revision: Integer, - #[serde(default = "default_2094")] + #[serde(default = "default_2095")] pub current: Option, } @@ -46476,7 +46489,7 @@ pub struct InventorySection { #[serde(deserialize_with = "required_nullable")] pub latest_at: Option, pub complete: bool, - #[serde(default = "default_2095")] + #[serde(default = "default_2096")] pub reason: String, } @@ -46506,10 +46519,10 @@ pub struct InventoryPopulation { pub population: InventoryPopulationPopulation, #[serde(deserialize_with = "required_nullable")] pub total: Option, - #[serde(default = "default_2096")] + #[serde(default = "default_2097")] pub top: Vec, pub complete: bool, - #[serde(default = "default_2097")] + #[serde(default = "default_2098")] pub reason: String, } @@ -46675,11 +46688,11 @@ pub struct NamespaceJoinOutput { pub joined: bool, pub namespace: String, pub role: NamespaceJoinOutputRole, - #[serde(default = "default_2098")] - pub status: String, #[serde(default = "default_2099")] - pub requested_role: Option, + pub status: String, #[serde(default = "default_2100")] + pub requested_role: Option, + #[serde(default = "default_2101")] pub pending_admins: Vec, pub joined_at: String, } @@ -46771,7 +46784,7 @@ impl NamespaceJoinInput { pub struct NamespaceLeaveOutput { pub left: bool, pub namespace: String, - #[serde(default = "default_2101")] + #[serde(default = "default_2102")] pub left_at: Option, } @@ -46848,27 +46861,27 @@ pub enum NamespaceEntryVisibility { #[non_exhaustive] pub struct NamespaceEntry { pub namespace: String, - #[serde(default = "default_2102")] + #[serde(default = "default_2103")] pub kind: String, pub owner_email: String, pub description: String, pub tags: Vec, pub active: bool, - #[serde(default = "default_2103")] - pub consolidation_enabled: bool, #[serde(default = "default_2104")] - pub daily_cost_cap_usd: f64, + pub consolidation_enabled: bool, #[serde(default = "default_2105")] - pub daily_user_cost_cap_usd: f64, + pub daily_cost_cap_usd: f64, #[serde(default = "default_2106")] - pub budget_alert_inbox: String, + pub daily_user_cost_cap_usd: f64, #[serde(default = "default_2107")] - pub conflict_threshold: Option, + pub budget_alert_inbox: String, #[serde(default = "default_2108")] - pub retention_days: Integer, + pub conflict_threshold: Option, #[serde(default = "default_2109")] - pub warm_days: Integer, + pub retention_days: Integer, #[serde(default = "default_2110")] + pub warm_days: Integer, + #[serde(default = "default_2111")] pub visibility: NamespaceEntryVisibility, pub created_at: String, pub updated_at: String, @@ -47023,27 +47036,27 @@ pub enum MineEntryVisibility { pub struct MineEntry { pub namespace: String, pub role: String, - #[serde(default = "default_2111")] - pub status: String, #[serde(default = "default_2112")] - pub pending_role: Option, + pub status: String, #[serde(default = "default_2113")] - pub pending_since: Option, + pub pending_role: Option, #[serde(default = "default_2114")] - pub pending_admins: Vec, + pub pending_since: Option, #[serde(default = "default_2115")] - pub visibility: MineEntryVisibility, + pub pending_admins: Vec, #[serde(default = "default_2116")] - pub kind: String, + pub visibility: MineEntryVisibility, #[serde(default = "default_2117")] - pub title: String, + pub kind: String, #[serde(default = "default_2118")] - pub description: String, + pub title: String, #[serde(default = "default_2119")] - pub joined_at: Option, + pub description: String, #[serde(default = "default_2120")] - pub is_new: bool, + pub joined_at: Option, #[serde(default = "default_2121")] + pub is_new: bool, + #[serde(default = "default_2122")] pub inherited: bool, } @@ -47109,7 +47122,7 @@ pub struct OntologyEntry { pub name: String, pub status: String, pub description: String, - #[serde(default = "default_2122")] + #[serde(default = "default_2123")] pub cardinality: String, pub created_by: String, pub updated_at: String, @@ -47302,7 +47315,7 @@ pub struct NamespaceRegisterOutput { pub registered: bool, pub namespace: String, pub updated_at: String, - #[serde(default = "default_2123")] + #[serde(default = "default_2124")] pub visibility: NamespaceRegisterOutputVisibility, } @@ -48382,7 +48395,7 @@ impl NamespaceRegisterOntologyInput { #[non_exhaustive] pub struct NamespaceRestoreOutput { pub restored: bool, - #[serde(default = "default_2124")] + #[serde(default = "default_2125")] pub publication_pending: bool, pub target_namespace: String, pub snapshot_id: String, @@ -49269,15 +49282,15 @@ pub struct NamespaceRollbackOutput { pub version_at: Integer, pub reinstate: Integer, pub remove: Integer, - #[serde(default = "default_2125")] - pub skipped_no_head: Integer, #[serde(default = "default_2126")] - pub skipped_already_gone: Integer, + pub skipped_no_head: Integer, #[serde(default = "default_2127")] - pub truncated: bool, + pub skipped_already_gone: Integer, #[serde(default = "default_2128")] - pub sample: Vec>, + pub truncated: bool, #[serde(default = "default_2129")] + pub sample: Vec>, + #[serde(default = "default_2130")] pub applied_at: Option, } @@ -49456,101 +49469,101 @@ pub struct NamespaceSnapshotOutputSnapshotMemoryRow { pub confidence: f64, pub source_trace: String, pub pinned: bool, - #[serde(default = "default_2130")] - pub expires_at: Option, #[serde(default = "default_2131")] - pub entities: Vec, + pub expires_at: Option, #[serde(default = "default_2132")] - pub version: Integer, + pub entities: Vec, #[serde(default = "default_2133")] - pub content_sha256: String, + pub version: Integer, #[serde(default = "default_2134")] - pub actor: String, + pub content_sha256: String, #[serde(default = "default_2135")] - pub source_class: String, + pub actor: String, #[serde(default = "default_2136")] - pub source_resource_id: String, + pub source_class: String, #[serde(default = "default_2137")] - pub verified_by: String, + pub source_resource_id: String, #[serde(default = "default_2138")] - pub verified_at: Option, + pub verified_by: String, #[serde(default = "default_2139")] - pub verified_sha256: String, + pub verified_at: Option, #[serde(default = "default_2140")] - pub grounding: String, + pub verified_sha256: String, #[serde(default = "default_2141")] - pub evidence: String, + pub grounding: String, #[serde(default = "default_2142")] - pub tags: Vec, + pub evidence: String, #[serde(default = "default_2143")] - pub valid_at: Option, + pub tags: Vec, #[serde(default = "default_2144")] - pub valid_to: Option, + pub valid_at: Option, #[serde(default = "default_2145")] - pub created_at: Option, + pub valid_to: Option, #[serde(default = "default_2146")] - pub updated_at: Option, + pub created_at: Option, #[serde(default = "default_2147")] - pub value_json: String, + pub updated_at: Option, #[serde(default = "default_2148")] - pub status: NamespaceSnapshotOutputSnapshotMemoryRowStatus, + pub value_json: String, #[serde(default = "default_2149")] - pub requires_review: Option, + pub status: NamespaceSnapshotOutputSnapshotMemoryRowStatus, #[serde(default = "default_2150")] - pub conflict_with: Vec, + pub requires_review: Option, #[serde(default = "default_2151")] - pub duplicate_of: String, + pub conflict_with: Vec, #[serde(default = "default_2152")] - pub evidence_count: Integer, + pub duplicate_of: String, #[serde(default = "default_2153")] - pub recall_count: Integer, + pub evidence_count: Integer, #[serde(default = "default_2154")] - pub last_recalled_at: Option, + pub recall_count: Integer, #[serde(default = "default_2155")] - pub cross_promoted_from_memory_id: String, + pub last_recalled_at: Option, #[serde(default = "default_2156")] - pub cross_promoted_from_namespace: String, + pub cross_promoted_from_memory_id: String, #[serde(default = "default_2157")] - pub superseded_by: String, + pub cross_promoted_from_namespace: String, #[serde(default = "default_2158")] - pub rejection_reason: String, + pub superseded_by: String, #[serde(default = "default_2159")] - pub temporal_anchor: Option, + pub rejection_reason: String, #[serde(default = "default_2160")] - pub temporal_confidence: f64, + pub temporal_anchor: Option, #[serde(default = "default_2161")] - pub invalid_at: Option, + pub temporal_confidence: f64, #[serde(default = "default_2162")] - pub char_limit: Option, + pub invalid_at: Option, #[serde(default = "default_2163")] - pub reinforcement_count: Integer, + pub char_limit: Option, #[serde(default = "default_2164")] - pub last_reinforced_at: Option, + pub reinforcement_count: Integer, #[serde(default = "default_2165")] - pub mentioned_at: Option, + pub last_reinforced_at: Option, #[serde(default = "default_2166")] - pub sensitivity: String, + pub mentioned_at: Option, #[serde(default = "default_2167")] - pub redacted_at: Option, + pub sensitivity: String, #[serde(default = "default_2168")] - pub redaction_reason: String, + pub redacted_at: Option, #[serde(default = "default_2169")] - pub lock_mode: String, + pub redaction_reason: String, #[serde(default = "default_2170")] - pub lock_reason: String, + pub lock_mode: String, #[serde(default = "default_2171")] - pub lock_until: Option, + pub lock_reason: String, #[serde(default = "default_2172")] - pub locked_by: String, + pub lock_until: Option, #[serde(default = "default_2173")] - pub locked_at: Option, + pub locked_by: String, #[serde(default = "default_2174")] - pub on_expire: String, + pub locked_at: Option, #[serde(default = "default_2175")] - pub expire_reason: String, + pub on_expire: String, #[serde(default = "default_2176")] - pub files: Vec, + pub expire_reason: String, #[serde(default = "default_2177")] + pub files: Vec, + #[serde(default = "default_2178")] pub concepts: Vec, } @@ -49559,11 +49572,11 @@ pub struct NamespaceSnapshotOutputSnapshotMemoryRow { pub struct NamespaceSnapshotOutputSnapshotTypeRow { pub memory_type: String, pub retention_days: Integer, - #[serde(default = "default_2178")] - pub dedup_threshold: Option, #[serde(default = "default_2179")] - pub hot_quota: Integer, + pub dedup_threshold: Option, #[serde(default = "default_2180")] + pub hot_quota: Integer, + #[serde(default = "default_2181")] pub conflict_policy: String, } @@ -49778,7 +49791,7 @@ pub struct TaxonomyCommunity { pub community_id: Integer, pub label: String, pub size: Integer, - #[serde(default = "default_2181")] + #[serde(default = "default_2182")] pub top_entities: Vec, } @@ -49789,9 +49802,9 @@ pub struct NamespaceTaxonomyOutput { pub entities: Vec, pub memory_count: Integer, pub memory_types: Vec, - #[serde(default = "default_2182")] - pub communities: Vec, #[serde(default = "default_2183")] + pub communities: Vec, + #[serde(default = "default_2184")] pub communities_computed_at: String, } @@ -49891,15 +49904,15 @@ pub enum TuneProposalTarget { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TuneEvidence { - #[serde(default = "default_2185")] - pub finding_codes: Vec, #[serde(default = "default_2186")] - pub supporting_count: Integer, + pub finding_codes: Vec, #[serde(default = "default_2187")] - pub supporting: Vec, + pub supporting_count: Integer, #[serde(default = "default_2188")] - pub counter_count: Option, + pub supporting: Vec, #[serde(default = "default_2189")] + pub counter_count: Option, + #[serde(default = "default_2190")] pub documents: Vec, } @@ -49925,10 +49938,10 @@ pub enum TuneApplyVia { #[non_exhaustive] pub struct TuneApply { pub op: String, - #[serde(default = "default_2193")] + #[serde(default = "default_2194")] pub via: TuneApplyVia, pub args: std::collections::HashMap, - #[serde(default = "default_2194")] + #[serde(default = "default_2195")] pub args_complete: bool, pub required_role: String, pub guard: String, @@ -49947,7 +49960,7 @@ pub struct ChunkStats { pub sections: Integer, pub sections_cut: Integer, pub max_input_tokens: Integer, - #[serde(default = "default_2196")] + #[serde(default = "default_2197")] pub over_input_limit: Option, } @@ -49967,25 +49980,25 @@ pub struct TuneProposal { pub title: String, pub rationale: String, pub current: String, - #[serde(default = "default_2184")] + #[serde(default = "default_2185")] pub current_revision: Option, pub proposed: String, pub evidence: TuneEvidence, - #[serde(default = "default_2190")] - pub affected_agents: Vec, #[serde(default = "default_2191")] - pub affected_agents_total: Option, + pub affected_agents: Vec, #[serde(default = "default_2192")] + pub affected_agents_total: Option, + #[serde(default = "default_2193")] pub effect: TuneProposalEffect, pub historical: String, pub apply: TuneApply, - #[serde(default = "default_2195")] + #[serde(default = "default_2196")] pub apply_also: Vec, - #[serde(default = "default_2197")] - pub preview: Option, #[serde(default = "default_2198")] - pub limits: String, + pub preview: Option, #[serde(default = "default_2199")] + pub limits: String, + #[serde(default = "default_2200")] pub refs: Vec, } @@ -49993,13 +50006,13 @@ pub struct TuneProposal { #[non_exhaustive] pub struct ChunkingSample { pub cap: Integer, - #[serde(default = "default_2205")] + #[serde(default = "default_2206")] pub population: Option, pub documents: Integer, pub unread: Integer, pub load_cap: Integer, pub embedder_model: String, - #[serde(default = "default_2206")] + #[serde(default = "default_2207")] pub input_token_limit: Option, pub current: ChunkStats, } @@ -50010,21 +50023,21 @@ pub struct NamespaceTuneOutput { pub org: String, pub namespace: String, pub computed_at: String, - #[serde(default = "default_2200")] - pub proposals: Vec, #[serde(default = "default_2201")] - pub guide_revision: Option, + pub proposals: Vec, #[serde(default = "default_2202")] - pub categories_registered: Option, + pub guide_revision: Option, #[serde(default = "default_2203")] - pub extraction_policy: Option, + pub categories_registered: Option, #[serde(default = "default_2204")] + pub extraction_policy: Option, + #[serde(default = "default_2205")] pub extraction_policy_unavailable: String, - #[serde(default = "default_2207")] - pub chunking: Option, #[serde(default = "default_2208")] - pub skipped: Vec, + pub chunking: Option, #[serde(default = "default_2209")] + pub skipped: Vec, + #[serde(default = "default_2210")] pub model_used: bool, } @@ -50145,25 +50158,25 @@ pub struct NamespaceValidateFinding { pub kind: NamespaceValidateFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_2210")] - pub window_seconds: Option, #[serde(default = "default_2211")] + pub window_seconds: Option, + #[serde(default = "default_2212")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_2212")] - pub evidence: Vec, #[serde(default = "default_2213")] - pub exceptions: String, + pub evidence: Vec, #[serde(default = "default_2214")] + pub exceptions: String, + #[serde(default = "default_2215")] pub uncertainty: String, pub check: String, pub severity: NamespaceValidateFindingSeverity, pub count: Integer, - #[serde(default = "default_2215")] + #[serde(default = "default_2216")] pub samples: Vec>, pub detail: String, - #[serde(default = "default_2216")] + #[serde(default = "default_2217")] pub totals: std::collections::HashMap, } @@ -50177,9 +50190,9 @@ pub struct NamespaceValidateOutput { pub warnings: Integer, pub infos: Integer, pub findings: Vec, - #[serde(default = "default_2217")] - pub skipped: Vec, #[serde(default = "default_2218")] + pub skipped: Vec, + #[serde(default = "default_2219")] pub keys_scoped: Integer, pub coverage: ReportCoverage, pub checked_at: String, @@ -50299,9 +50312,9 @@ impl NamespaceValidateInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ObserveCrystallizeOutput { - #[serde(default = "default_2219")] - pub enqueued: Integer, #[serde(default = "default_2220")] + pub enqueued: Integer, + #[serde(default = "default_2221")] pub session_id: String, } @@ -50398,23 +50411,23 @@ impl ObserveCrystallizeInput { #[non_exhaustive] pub struct ObserveRecordOutput { pub memory_key: String, - #[serde(default = "default_2221")] - pub memory_id: String, #[serde(default = "default_2222")] - pub kind: String, + pub memory_id: String, #[serde(default = "default_2223")] - pub tags: Vec, + pub kind: String, #[serde(default = "default_2224")] - pub file_paths: Vec, + pub tags: Vec, #[serde(default = "default_2225")] - pub content_sha256: String, + pub file_paths: Vec, #[serde(default = "default_2226")] - pub tool_name: String, + pub content_sha256: String, #[serde(default = "default_2227")] - pub has_error: bool, + pub tool_name: String, #[serde(default = "default_2228")] - pub narrative_chars: Integer, + pub has_error: bool, #[serde(default = "default_2229")] + pub narrative_chars: Integer, + #[serde(default = "default_2230")] pub skipped_reason: String, } @@ -50645,7 +50658,7 @@ pub struct OpsIncident { pub subject: String, pub severity: OpsIncidentSeverity, pub detail: String, - #[serde(default = "default_2230")] + #[serde(default = "default_2231")] pub age_s: Option, } @@ -50664,7 +50677,7 @@ pub enum OpsIncidentsOutputRequests { #[non_exhaustive] pub struct OpsIncidentsOutput { pub status: OpsIncidentsOutputStatus, - #[serde(default = "default_2231")] + #[serde(default = "default_2232")] pub incidents: Vec, pub window_minutes: Integer, pub requests: OpsIncidentsOutputRequests, @@ -50708,26 +50721,26 @@ pub struct ProjectionFailureRow { pub failure_id: String, pub org: String, pub namespace: String, - #[serde(default = "default_2232")] + #[serde(default = "default_2233")] pub agent: String, pub projection: String, - #[serde(default = "default_2233")] - pub source_operation: String, #[serde(default = "default_2234")] - pub source_resource_id: String, + pub source_operation: String, #[serde(default = "default_2235")] - pub memory_keys: Vec, + pub source_resource_id: String, #[serde(default = "default_2236")] - pub error_type: String, + pub memory_keys: Vec, #[serde(default = "default_2237")] - pub error_message: String, + pub error_type: String, #[serde(default = "default_2238")] - pub payload: std::collections::HashMap, + pub error_message: String, #[serde(default = "default_2239")] - pub status: String, + pub payload: std::collections::HashMap, #[serde(default = "default_2240")] - pub created_at: Option, + pub status: String, #[serde(default = "default_2241")] + pub created_at: Option, + #[serde(default = "default_2242")] pub resolved_at: Option, } @@ -50881,22 +50894,22 @@ pub struct ProjectionFailureRetryRow { pub projection: String, pub retried: bool, pub resolved: bool, - #[serde(default = "default_2242")] - pub abandoned: bool, #[serde(default = "default_2243")] - pub reason: String, + pub abandoned: bool, #[serde(default = "default_2244")] + pub reason: String, + #[serde(default = "default_2245")] pub error: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProjectionFailureRetryOutput { - #[serde(default = "default_2245")] + #[serde(default = "default_2246")] pub results: Vec, pub retried: Integer, pub resolved: Integer, - #[serde(default = "default_2246")] + #[serde(default = "default_2247")] pub abandoned: Integer, } @@ -50978,15 +50991,15 @@ impl ProjectionFailureRetryInput { pub struct OrgModelCallsOutput { pub org: String, pub enabled: bool, - #[serde(default = "default_2247")] - pub reason: String, #[serde(default = "default_2248")] - pub updated_by: String, + pub reason: String, #[serde(default = "default_2249")] - pub updated_at: Option, + pub updated_by: String, #[serde(default = "default_2250")] - pub locked: bool, + pub updated_at: Option, #[serde(default = "default_2251")] + pub locked: bool, + #[serde(default = "default_2252")] pub locked_by: String, } @@ -51325,7 +51338,7 @@ impl PolicyDecisionsInput { #[non_exhaustive] pub struct PolicyDeleteOutput { pub removed: bool, - #[serde(default = "default_2252")] + #[serde(default = "default_2253")] pub widening: bool, } @@ -51391,12 +51404,12 @@ pub struct PolicyRuleOut { pub condition: std::collections::HashMap, pub description: String, pub enabled: bool, - #[serde(default = "default_2253")] + #[serde(default = "default_2254")] pub mode: String, pub created_by: String, - #[serde(default = "default_2254")] - pub created_at: Option, #[serde(default = "default_2255")] + pub created_at: Option, + #[serde(default = "default_2256")] pub updated_at: Option, } @@ -51468,9 +51481,9 @@ impl PolicyListInput { pub struct PolicySetOutput { pub rule: PolicyRuleOut, pub leaf_count: Integer, - #[serde(default = "default_2256")] - pub widening: bool, #[serde(default = "default_2257")] + pub widening: bool, + #[serde(default = "default_2258")] pub change: Vec, } @@ -51740,37 +51753,37 @@ pub struct ProcedureEvolveOutput { pub revision: Integer, pub changed: bool, pub template: bool, - #[serde(default = "default_2258")] - pub folded_runs: Integer, #[serde(default = "default_2259")] - pub gate: ProcedureEvolveOutputGate, + pub folded_runs: Integer, #[serde(default = "default_2260")] - pub gate_mode: String, + pub gate: ProcedureEvolveOutputGate, #[serde(default = "default_2261")] - pub gate_llr: f64, + pub gate_mode: String, #[serde(default = "default_2262")] - pub gate_before: std::collections::HashMap, + pub gate_llr: f64, #[serde(default = "default_2263")] - pub gate_after: std::collections::HashMap, + pub gate_before: std::collections::HashMap, #[serde(default = "default_2264")] - pub gate_cost_before: std::collections::HashMap, + pub gate_after: std::collections::HashMap, #[serde(default = "default_2265")] - pub gate_cost_after: std::collections::HashMap, + pub gate_cost_before: std::collections::HashMap, #[serde(default = "default_2266")] - pub gate_reason: String, + pub gate_cost_after: std::collections::HashMap, #[serde(default = "default_2267")] - pub dead_end_steps: Vec, + pub gate_reason: String, #[serde(default = "default_2268")] - pub fail_prone_steps: Vec, + pub dead_end_steps: Vec, #[serde(default = "default_2269")] - pub fail_prone_transitions: Vec, + pub fail_prone_steps: Vec, #[serde(default = "default_2270")] - pub run_stats: std::collections::HashMap, + pub fail_prone_transitions: Vec, #[serde(default = "default_2271")] - pub strikes: Integer, + pub run_stats: std::collections::HashMap, #[serde(default = "default_2272")] - pub quarantined: bool, + pub strikes: Integer, #[serde(default = "default_2273")] + pub quarantined: bool, + #[serde(default = "default_2274")] pub retention: std::collections::HashMap, } @@ -51993,9 +52006,9 @@ pub struct ProcedureForkOutput { pub memory_key: String, pub version: Integer, pub name: String, - #[serde(default = "default_2274")] - pub steps: Vec, #[serde(default = "default_2275")] + pub steps: Vec, + #[serde(default = "default_2276")] pub forked_from: std::collections::HashMap, } @@ -52255,32 +52268,32 @@ pub enum ProcedureLocateOutputStatus { #[non_exhaustive] pub struct ProcedureLocateOutput { pub memory_key: String, - #[serde(default = "default_2276")] - pub name: String, #[serde(default = "default_2277")] + pub name: String, + #[serde(default = "default_2278")] pub status: ProcedureLocateOutputStatus, pub matched: bool, - #[serde(default = "default_2278")] - pub active: Option>, #[serde(default = "default_2279")] - pub hops: Vec>>, + pub active: Option>, #[serde(default = "default_2280")] - pub entry_nodes: Vec, + pub hops: Vec>>, #[serde(default = "default_2281")] - pub dominant_next: Vec, + pub entry_nodes: Vec, #[serde(default = "default_2282")] - pub revisits: std::collections::HashMap, + pub dominant_next: Vec, #[serde(default = "default_2283")] - pub looping: bool, + pub revisits: std::collections::HashMap, #[serde(default = "default_2284")] - pub exits: Vec, + pub looping: bool, #[serde(default = "default_2285")] - pub failure_notes: Vec>, + pub exits: Vec, #[serde(default = "default_2286")] - pub rendered: String, + pub failure_notes: Vec>, #[serde(default = "default_2287")] - pub run_stats: std::collections::HashMap, + pub rendered: String, #[serde(default = "default_2288")] + pub run_stats: std::collections::HashMap, + #[serde(default = "default_2289")] pub for_agent: std::collections::HashMap, } @@ -52435,43 +52448,43 @@ pub struct ProcedureMatch { pub name: String, pub situation: String, pub steps: Vec, - #[serde(default = "default_2289")] - pub tags: Vec, #[serde(default = "default_2290")] + pub tags: Vec, + #[serde(default = "default_2291")] pub metadata: std::collections::HashMap, pub similarity: f64, pub memory_key: String, pub namespace: String, - #[serde(default = "default_2291")] - pub graph: Option>, #[serde(default = "default_2292")] - pub template: bool, + pub graph: Option>, #[serde(default = "default_2293")] - pub run_stats: std::collections::HashMap, + pub template: bool, #[serde(default = "default_2294")] - pub status: ProcedureMatchStatus, + pub run_stats: std::collections::HashMap, #[serde(default = "default_2295")] - pub quarantined: Option>, + pub status: ProcedureMatchStatus, #[serde(default = "default_2296")] - pub fail_prone_steps: Vec, + pub quarantined: Option>, #[serde(default = "default_2297")] - pub revision: Integer, + pub fail_prone_steps: Vec, #[serde(default = "default_2298")] - pub rejected_revisions: Vec>, + pub revision: Integer, #[serde(default = "default_2299")] - pub tool_overlap: f64, + pub rejected_revisions: Vec>, #[serde(default = "default_2300")] - pub score: f64, + pub tool_overlap: f64, #[serde(default = "default_2301")] - pub utility: f64, + pub score: f64, #[serde(default = "default_2302")] - pub goal_similarity: Option, + pub utility: f64, #[serde(default = "default_2303")] - pub for_agent: std::collections::HashMap, + pub goal_similarity: Option, #[serde(default = "default_2304")] + pub for_agent: std::collections::HashMap, + #[serde(default = "default_2305")] pub run_stats_by_agent: std::collections::HashMap>, - #[serde(default = "default_2305")] + #[serde(default = "default_2306")] pub actor: String, } @@ -52479,11 +52492,11 @@ pub struct ProcedureMatch { #[non_exhaustive] pub struct ProcedureMatchOutput { pub matches: Vec, - #[serde(default = "default_2306")] - pub matched: Integer, #[serde(default = "default_2307")] - pub procedure_key: String, + pub matched: Integer, #[serde(default = "default_2308")] + pub procedure_key: String, + #[serde(default = "default_2309")] pub score: f64, } @@ -52875,9 +52888,9 @@ pub struct ProcedureReviseOutput { pub revision: Integer, pub prior_revision: Integer, pub digest: String, - #[serde(default = "default_2309")] - pub steps: Vec, #[serde(default = "default_2310")] + pub steps: Vec, + #[serde(default = "default_2311")] pub outcome: ProcedureReviseOutputOutcome, } @@ -52989,14 +53002,14 @@ pub struct ProfileActivityEntry { pub agent: String, pub last_activated_at: String, pub event_count: Integer, - #[serde(default = "default_2311")] + #[serde(default = "default_2312")] pub operations: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProfileActivityOutput { - #[serde(default = "default_2312")] + #[serde(default = "default_2313")] pub entries: Vec, } @@ -53104,17 +53117,17 @@ impl ProfileActivityInput { #[non_exhaustive] pub struct ProfileMutationOutput { pub version: Integer, - #[serde(default = "default_2313")] - pub memory_id: String, #[serde(default = "default_2314")] - pub content_sha256: String, + pub memory_id: String, #[serde(default = "default_2315")] - pub namespace: String, + pub content_sha256: String, #[serde(default = "default_2316")] - pub label: String, + pub namespace: String, #[serde(default = "default_2317")] - pub char_limit: Option, + pub label: String, #[serde(default = "default_2318")] + pub char_limit: Option, + #[serde(default = "default_2319")] pub value_length: Integer, } @@ -53223,7 +53236,7 @@ pub struct ProfileRenderOutput { pub rendered: String, pub section_count: Integer, pub total_chars: Integer, - #[serde(default = "default_2319")] + #[serde(default = "default_2320")] pub labels: Vec, } @@ -53608,17 +53621,17 @@ pub enum ProfileStructuredOutputStatus { #[non_exhaustive] pub struct ProfileStructuredOutput { pub status: ProfileStructuredOutputStatus, - #[serde(default = "default_2320")] - pub profile: std::collections::HashMap, #[serde(default = "default_2321")] - pub built_at: Option, + pub profile: std::collections::HashMap, #[serde(default = "default_2322")] - pub memory_id: String, + pub built_at: Option, #[serde(default = "default_2323")] - pub version: Integer, + pub memory_id: String, #[serde(default = "default_2324")] - pub version_text: String, + pub version: Integer, #[serde(default = "default_2325")] + pub version_text: String, + #[serde(default = "default_2326")] pub schema_sha256: String, } @@ -53735,13 +53748,13 @@ impl ProfileStructuredInput { #[non_exhaustive] pub struct ProfileSchemaOutput { pub found: bool, - #[serde(default = "default_2326")] - pub json_schema: std::collections::HashMap, #[serde(default = "default_2327")] - pub schema_sha256: String, + pub json_schema: std::collections::HashMap, #[serde(default = "default_2328")] - pub updated_by: String, + pub schema_sha256: String, #[serde(default = "default_2329")] + pub updated_by: String, + #[serde(default = "default_2330")] pub updated_at: Option, } @@ -53894,10 +53907,10 @@ pub enum RunBeginOutputStatus { #[non_exhaustive] pub struct RunBeginOutput { pub run_id: String, - #[serde(default = "default_2330")] + #[serde(default = "default_2331")] pub status: RunBeginOutputStatus, pub started_at: String, - #[serde(default = "default_2331")] + #[serde(default = "default_2332")] pub next: String, } @@ -54105,31 +54118,31 @@ pub struct RunCompleteOutput { pub run_id: String, pub status: RunCompleteOutputStatus, pub duration_ms: Integer, - #[serde(default = "default_2332")] - pub used_applied: Integer, #[serde(default = "default_2333")] - pub undelivered: Integer, + pub used_applied: Integer, #[serde(default = "default_2334")] - pub evidence_applied: Integer, + pub undelivered: Integer, #[serde(default = "default_2335")] - pub harm_applied: Integer, + pub evidence_applied: Integer, #[serde(default = "default_2336")] - pub memories_written: Vec, + pub harm_applied: Integer, #[serde(default = "default_2337")] - pub recalled: Integer, + pub memories_written: Vec, #[serde(default = "default_2338")] - pub observations: Integer, + pub recalled: Integer, #[serde(default = "default_2339")] - pub procedure_runs_recorded: Integer, + pub observations: Integer, #[serde(default = "default_2340")] - pub reflection_key: String, + pub procedure_runs_recorded: Integer, #[serde(default = "default_2341")] - pub retain: String, + pub reflection_key: String, #[serde(default = "default_2342")] - pub retained: Integer, + pub retain: String, #[serde(default = "default_2343")] - pub demoted: Integer, + pub retained: Integer, #[serde(default = "default_2344")] + pub demoted: Integer, + #[serde(default = "default_2345")] pub expiring: Integer, } @@ -54670,25 +54683,25 @@ pub enum RunGetOutputOverBudgetItem { #[non_exhaustive] pub struct RunGetOutput { pub found: bool, - #[serde(default = "default_2345")] - pub run: Option, #[serde(default = "default_2346")] - pub recalled: Integer, + pub run: Option, #[serde(default = "default_2347")] - pub recalled_keys: Vec, + pub recalled: Integer, #[serde(default = "default_2348")] - pub memories_written: Vec, + pub recalled_keys: Vec, #[serde(default = "default_2349")] - pub observations: Integer, + pub memories_written: Vec, #[serde(default = "default_2350")] - pub turns: Integer, + pub observations: Integer, #[serde(default = "default_2351")] - pub unpriced_turns: Integer, + pub turns: Integer, #[serde(default = "default_2352")] - pub cost_usd: f64, + pub unpriced_turns: Integer, #[serde(default = "default_2353")] - pub elapsed_seconds: Integer, + pub cost_usd: f64, #[serde(default = "default_2354")] + pub elapsed_seconds: Integer, + #[serde(default = "default_2355")] pub over_budget: Vec, } @@ -54755,17 +54768,17 @@ pub struct RunGradeProposal { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct RunGradeOutput { - #[serde(default = "default_2355")] - pub graded: Integer, #[serde(default = "default_2356")] - pub run_ids: Vec, + pub graded: Integer, #[serde(default = "default_2357")] - pub skipped_active: Integer, + pub run_ids: Vec, #[serde(default = "default_2358")] - pub unchanged: Integer, + pub skipped_active: Integer, #[serde(default = "default_2359")] - pub memories_counted: Integer, + pub unchanged: Integer, #[serde(default = "default_2360")] + pub memories_counted: Integer, + #[serde(default = "default_2361")] pub proposals_decided: Vec, } @@ -54880,7 +54893,7 @@ impl RunGradeInput { #[non_exhaustive] pub struct RunListOutput { pub runs: Vec, - #[serde(default = "default_2361")] + #[serde(default = "default_2362")] pub total: Option, } @@ -55104,19 +55117,19 @@ impl RunListInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct RunRetractCreditOutput { - #[serde(default = "default_2362")] - pub run_id: String, #[serde(default = "default_2363")] - pub used_retracted: Integer, + pub run_id: String, #[serde(default = "default_2364")] - pub evidence_retracted: Integer, + pub used_retracted: Integer, #[serde(default = "default_2365")] - pub harm_retracted: Integer, + pub evidence_retracted: Integer, #[serde(default = "default_2366")] - pub events_written: Integer, + pub harm_retracted: Integer, #[serde(default = "default_2367")] - pub more: bool, + pub events_written: Integer, #[serde(default = "default_2368")] + pub more: bool, + #[serde(default = "default_2369")] pub dry_run: bool, } @@ -55273,39 +55286,39 @@ pub struct LiveSearchHit { pub title: String, pub url: String, pub provider: LiveSearchHitProvider, - #[serde(default = "default_2371")] - pub content: String, #[serde(default = "default_2372")] + pub content: String, + #[serde(default = "default_2373")] pub live: LiveSearchHitLive, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct LiveSearchResults { - #[serde(default = "default_2370")] + #[serde(default = "default_2371")] pub live: LiveSearchResultsLive, - #[serde(default = "default_2373")] + #[serde(default = "default_2374")] pub results: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SearchOutput { - #[serde(default = "default_2369")] + #[serde(default = "default_2370")] pub tracker: Option>, - #[serde(default = "default_2374")] - pub live: Option, #[serde(default = "default_2375")] - pub memory: std::collections::HashMap, + pub live: Option, #[serde(default = "default_2376")] - pub knowledge: std::collections::HashMap, + pub memory: std::collections::HashMap, #[serde(default = "default_2377")] - pub profile: std::collections::HashMap, + pub knowledge: std::collections::HashMap, #[serde(default = "default_2378")] - pub conversations: std::collections::HashMap, + pub profile: std::collections::HashMap, #[serde(default = "default_2379")] - pub withheld: Option>, + pub conversations: std::collections::HashMap, #[serde(default = "default_2380")] + pub withheld: Option>, + #[serde(default = "default_2381")] pub namespaces_skipped: Vec, } @@ -55509,7 +55522,7 @@ impl SearchInput { pub struct SessionBriefDeleteOutput { pub deleted: bool, pub brief_key: String, - #[serde(default = "default_2381")] + #[serde(default = "default_2382")] pub revision: Integer, } @@ -55602,67 +55615,67 @@ impl SessionBriefDeleteInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDecision { - #[serde(default = "default_2390")] - pub what: String, #[serde(default = "default_2391")] + pub what: String, + #[serde(default = "default_2392")] pub why: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDeadEnd { - #[serde(default = "default_2393")] - pub tried: String, #[serde(default = "default_2394")] + pub tried: String, + #[serde(default = "default_2395")] pub why_not: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDone { - #[serde(default = "default_2396")] + #[serde(default = "default_2397")] pub what: String, - #[serde(rename = "ref", default = "default_2397")] + #[serde(rename = "ref", default = "default_2398")] pub r#ref: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefFile { - #[serde(default = "default_2401")] - pub path: String, #[serde(default = "default_2402")] + pub path: String, + #[serde(default = "default_2403")] pub role: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefSections { - #[serde(default = "default_2387")] - pub goal: String, #[serde(default = "default_2388")] - pub status: String, + pub goal: String, #[serde(default = "default_2389")] + pub status: String, + #[serde(default = "default_2390")] pub verification: String, - #[serde(default = "default_2392")] + #[serde(default = "default_2393")] pub decisions: Vec, - #[serde(default = "default_2395")] + #[serde(default = "default_2396")] pub dead_ends: Vec, - #[serde(default = "default_2398")] - pub done: Vec, #[serde(default = "default_2399")] - pub open_questions: Vec, + pub done: Vec, #[serde(default = "default_2400")] + pub open_questions: Vec, + #[serde(default = "default_2401")] pub next_steps: Vec, - #[serde(default = "default_2403")] - pub files: Vec, #[serde(default = "default_2404")] - pub constraints: Vec, + pub files: Vec, #[serde(default = "default_2405")] - pub pointers: Vec, + pub constraints: Vec, #[serde(default = "default_2406")] - pub client_summary: String, + pub pointers: Vec, #[serde(default = "default_2407")] + pub client_summary: String, + #[serde(default = "default_2408")] pub client_summary_at: String, } @@ -55670,45 +55683,45 @@ pub struct BriefSections { #[non_exhaustive] pub struct SessionBriefGetOutput { pub found: bool, - #[serde(default = "default_2382")] - pub brief_key: String, #[serde(default = "default_2383")] - pub revision: Integer, + pub brief_key: String, #[serde(default = "default_2384")] - pub snapshot_id: String, + pub revision: Integer, #[serde(default = "default_2385")] - pub snapshot_key: String, + pub snapshot_id: String, #[serde(default = "default_2386")] + pub snapshot_key: String, + #[serde(default = "default_2387")] pub rendered: String, - #[serde(default = "default_2408")] - pub sections: Option, #[serde(default = "default_2409")] - pub project: String, + pub sections: Option, #[serde(default = "default_2410")] - pub branch: String, + pub project: String, #[serde(default = "default_2411")] - pub head_sha: String, + pub branch: String, #[serde(default = "default_2412")] - pub author: String, + pub head_sha: String, #[serde(default = "default_2413")] - pub trigger: String, + pub author: String, #[serde(default = "default_2414")] - pub actor: String, + pub trigger: String, #[serde(default = "default_2415")] - pub source_sessions: Vec, + pub actor: String, #[serde(default = "default_2416")] - pub updated_at: Option, + pub source_sessions: Vec, #[serde(default = "default_2417")] - pub age_seconds: Integer, + pub updated_at: Option, #[serde(default = "default_2418")] - pub revisions: Integer, + pub age_seconds: Integer, #[serde(default = "default_2419")] - pub events_total: Integer, + pub revisions: Integer, #[serde(default = "default_2420")] - pub source_chars: Integer, + pub events_total: Integer, #[serde(default = "default_2421")] - pub brief_chars: Integer, + pub source_chars: Integer, #[serde(default = "default_2422")] + pub brief_chars: Integer, + #[serde(default = "default_2423")] pub deleted: bool, } @@ -55883,34 +55896,34 @@ impl SessionBriefGetInput { pub struct SessionBriefSummary { pub brief_key: String, pub revision: Integer, - #[serde(default = "default_2423")] - pub project: String, #[serde(default = "default_2424")] - pub branch: String, + pub project: String, #[serde(default = "default_2425")] - pub agent: String, + pub branch: String, #[serde(default = "default_2426")] - pub goal: String, + pub agent: String, #[serde(default = "default_2427")] - pub status: String, + pub goal: String, #[serde(default = "default_2428")] - pub author: String, + pub status: String, #[serde(default = "default_2429")] - pub actor: String, + pub author: String, #[serde(default = "default_2430")] - pub updated_at: Option, + pub actor: String, #[serde(default = "default_2431")] - pub age_seconds: Integer, + pub updated_at: Option, #[serde(default = "default_2432")] + pub age_seconds: Integer, + #[serde(default = "default_2433")] pub brief_chars: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SessionBriefListOutput { - #[serde(default = "default_2433")] - pub briefs: Vec, #[serde(default = "default_2434")] + pub briefs: Vec, + #[serde(default = "default_2435")] pub rendered: String, } @@ -56050,25 +56063,25 @@ impl SessionBriefListInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SessionBriefStats { - #[serde(default = "default_2438")] - pub events_in: Integer, #[serde(default = "default_2439")] - pub windows: Integer, + pub events_in: Integer, #[serde(default = "default_2440")] - pub events_total: Integer, + pub windows: Integer, #[serde(default = "default_2441")] - pub source_chars: Integer, + pub events_total: Integer, #[serde(default = "default_2442")] - pub brief_chars: Integer, + pub source_chars: Integer, #[serde(default = "default_2443")] - pub compression_ratio: f64, + pub brief_chars: Integer, #[serde(default = "default_2444")] - pub dropped_ungrounded: Integer, + pub compression_ratio: f64, #[serde(default = "default_2445")] - pub tokens_in: Integer, + pub dropped_ungrounded: Integer, #[serde(default = "default_2446")] - pub tokens_out: Integer, + pub tokens_in: Integer, #[serde(default = "default_2447")] + pub tokens_out: Integer, + #[serde(default = "default_2448")] pub llm_model: String, } @@ -56078,13 +56091,13 @@ pub struct SessionBriefSaveOutput { pub brief_key: String, pub revision: Integer, pub changed: bool, - #[serde(default = "default_2435")] - pub author: String, #[serde(default = "default_2436")] - pub reason: String, + pub author: String, #[serde(default = "default_2437")] + pub reason: String, + #[serde(default = "default_2438")] pub rendered: String, - #[serde(default = "default_2448")] + #[serde(default = "default_2449")] pub stats: SessionBriefStats, } @@ -56829,39 +56842,39 @@ pub struct TaskPayload { pub priority: Integer, pub disclosure: TaskPayloadDisclosure, pub status: TaskPayloadStatus, - #[serde(default = "default_2449")] - pub reason: String, #[serde(default = "default_2450")] - pub blocked_on: String, + pub reason: String, #[serde(default = "default_2451")] - pub not_before: Option, + pub blocked_on: String, #[serde(default = "default_2452")] - pub resume_at: Option, + pub not_before: Option, #[serde(default = "default_2453")] - pub deadline: Option, + pub resume_at: Option, #[serde(default = "default_2454")] + pub deadline: Option, + #[serde(default = "default_2455")] pub defer_count: Integer, pub title: String, - #[serde(default = "default_2455")] + #[serde(default = "default_2456")] pub brief: std::collections::HashMap, pub from_agent: String, - #[serde(default = "default_2456")] - pub from_subject: String, #[serde(default = "default_2457")] - pub origin: String, + pub from_subject: String, #[serde(default = "default_2458")] - pub parent_task_id: Option, + pub origin: String, #[serde(default = "default_2459")] - pub owner: String, + pub parent_task_id: Option, #[serde(default = "default_2460")] - pub attempt: Integer, + pub owner: String, #[serde(default = "default_2461")] - pub fence: Integer, + pub attempt: Integer, #[serde(default = "default_2462")] - pub lease_until: Option, + pub fence: Integer, #[serde(default = "default_2463")] - pub outcome: std::collections::HashMap, + pub lease_until: Option, #[serde(default = "default_2464")] + pub outcome: std::collections::HashMap, + #[serde(default = "default_2465")] pub last_actor: String, pub created_at: String, pub updated_at: String, @@ -56872,7 +56885,7 @@ pub struct TaskPayload { #[non_exhaustive] pub struct TaskOutput { pub task: TaskPayload, - #[serde(default = "default_2465")] + #[serde(default = "default_2466")] pub seq: Integer, } @@ -57273,10 +57286,10 @@ impl TaskCompleteInput { pub struct InboxCount { pub inbox: String, pub status: String, - #[serde(default = "default_2466")] + #[serde(default = "default_2467")] pub blocked_on: String, pub n: Integer, - #[serde(default = "default_2467")] + #[serde(default = "default_2468")] pub oldest: Option, } @@ -57363,7 +57376,7 @@ pub struct TaskCreateOutput { pub task: TaskPayload, pub created: bool, pub seq: Integer, - #[serde(default = "default_2468")] + #[serde(default = "default_2469")] pub next: String, } @@ -57702,7 +57715,7 @@ impl TaskFailInput { #[non_exhaustive] pub struct TaskGetOutput { pub found: bool, - #[serde(default = "default_2469")] + #[serde(default = "default_2470")] pub task: Option, } @@ -57836,23 +57849,23 @@ pub struct TaskEventPayload { pub task_id: String, pub inbox: String, pub event: String, - #[serde(default = "default_2470")] - pub from_status: String, #[serde(default = "default_2471")] - pub to_status: String, + pub from_status: String, #[serde(default = "default_2472")] - pub actor: String, + pub to_status: String, #[serde(default = "default_2473")] - pub agent: String, + pub actor: String, #[serde(default = "default_2474")] - pub fence: Integer, + pub agent: String, #[serde(default = "default_2475")] - pub version: Integer, + pub fence: Integer, #[serde(default = "default_2476")] - pub reason: String, + pub version: Integer, #[serde(default = "default_2477")] - pub patch: std::collections::HashMap, + pub reason: String, #[serde(default = "default_2478")] + pub patch: std::collections::HashMap, + #[serde(default = "default_2479")] pub note: String, pub ts: String, } @@ -58192,7 +58205,7 @@ pub struct TaskPullOutput { pub tasks: Vec, pub waited_ms: Integer, pub backend: String, - #[serde(default = "default_2479")] + #[serde(default = "default_2480")] pub note: String, } @@ -58588,7 +58601,7 @@ impl TaskUnblockInput { pub struct TaskUpdateOutput { pub task: TaskPayload, pub seq: Integer, - #[serde(default = "default_2480")] + #[serde(default = "default_2481")] pub conflict: bool, } @@ -58951,19 +58964,19 @@ impl TaskReasonInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerAnswerOutput { - #[serde(default = "default_2481")] - pub intent: String, #[serde(default = "default_2482")] - pub anchors: std::collections::HashMap, + pub intent: String, #[serde(default = "default_2483")] - pub sections: Vec>, + pub anchors: std::collections::HashMap, #[serde(default = "default_2484")] - pub searched: Vec, + pub sections: Vec>, #[serde(default = "default_2485")] - pub lines: Vec, + pub searched: Vec, #[serde(default = "default_2486")] - pub restricted: bool, + pub lines: Vec, #[serde(default = "default_2487")] + pub restricted: bool, + #[serde(default = "default_2488")] pub verdict: String, } @@ -59059,17 +59072,17 @@ impl TrackerAnswerInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerBindingOutput { - #[serde(default = "default_2488")] - pub tracker_namespace: String, #[serde(default = "default_2489")] - pub tracker_namespaces: Vec, + pub tracker_namespace: String, #[serde(default = "default_2490")] - pub restricted: bool, + pub tracker_namespaces: Vec, #[serde(default = "default_2491")] - pub kind: String, + pub restricted: bool, #[serde(default = "default_2492")] - pub authorized: bool, + pub kind: String, #[serde(default = "default_2493")] + pub authorized: bool, + #[serde(default = "default_2494")] pub templates: Vec, } @@ -59122,13 +59135,13 @@ impl TrackerBindingInput { #[non_exhaustive] pub struct TrackerComponentOutput { pub component: String, - #[serde(default = "default_2494")] - pub risk: std::collections::HashMap, #[serde(default = "default_2495")] - pub open_issues: Vec>, + pub risk: std::collections::HashMap, #[serde(default = "default_2496")] - pub known: bool, + pub open_issues: Vec>, #[serde(default = "default_2497")] + pub known: bool, + #[serde(default = "default_2498")] pub tracker_unavailable: bool, } @@ -59189,9 +59202,9 @@ impl TrackerComponentInput { #[non_exhaustive] pub struct TrackerContractOutput { pub database: String, - #[serde(default = "default_2498")] - pub tables: Vec>, #[serde(default = "default_2499")] + pub tables: Vec>, + #[serde(default = "default_2500")] pub templates: std::collections::HashMap, } @@ -59244,66 +59257,66 @@ impl TrackerContractInput { #[non_exhaustive] pub struct TrackerLegStatus { pub name: String, - #[serde(default = "default_2510")] - pub status: String, #[serde(default = "default_2511")] - pub reason: String, + pub status: String, #[serde(default = "default_2512")] - pub message: String, + pub reason: String, #[serde(default = "default_2513")] - pub retried: bool, + pub message: String, #[serde(default = "default_2514")] - pub ms: Integer, + pub retried: bool, #[serde(default = "default_2515")] - pub cause: String, + pub ms: Integer, #[serde(default = "default_2516")] + pub cause: String, + #[serde(default = "default_2517")] pub namespace: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerDuplicateCheckOutput { - #[serde(default = "default_2500")] - pub verdict: String, #[serde(default = "default_2501")] - pub items: Vec>, + pub verdict: String, #[serde(default = "default_2502")] - pub undecided: bool, + pub items: Vec>, #[serde(default = "default_2503")] - pub epistemic: String, + pub undecided: bool, #[serde(default = "default_2504")] - pub thresholds: std::collections::HashMap, + pub epistemic: String, #[serde(default = "default_2505")] - pub judge: std::collections::HashMap, + pub thresholds: std::collections::HashMap, #[serde(default = "default_2506")] - pub fit_at: String, + pub judge: std::collections::HashMap, #[serde(default = "default_2507")] - pub fit: std::collections::HashMap, + pub fit_at: String, #[serde(default = "default_2508")] - pub query: std::collections::HashMap, + pub fit: std::collections::HashMap, #[serde(default = "default_2509")] + pub query: std::collections::HashMap, + #[serde(default = "default_2510")] pub legs: std::collections::HashMap, - #[serde(default = "default_2517")] - pub leg_status: Vec, #[serde(default = "default_2518")] - pub tracker_unavailable: bool, + pub leg_status: Vec, #[serde(default = "default_2519")] - pub namespaces: Vec, + pub tracker_unavailable: bool, #[serde(default = "default_2520")] - pub by_namespace: std::collections::HashMap>, + pub namespaces: Vec, #[serde(default = "default_2521")] - pub closest: Vec>, + pub by_namespace: std::collections::HashMap>, #[serde(default = "default_2522")] - pub needs: Vec>, + pub closest: Vec>, #[serde(default = "default_2523")] - pub closest_note: String, + pub needs: Vec>, #[serde(default = "default_2524")] - pub nearest: Vec>, + pub closest_note: String, #[serde(default = "default_2525")] - pub rerank: std::collections::HashMap, + pub nearest: Vec>, #[serde(default = "default_2526")] - pub answer: String, + pub rerank: std::collections::HashMap, #[serde(default = "default_2527")] + pub answer: String, + #[serde(default = "default_2528")] pub related_prs: Vec>, } @@ -59510,17 +59523,17 @@ impl TrackerDuplicateCheckInput { #[non_exhaustive] pub struct TrackerFlakyOutput { pub test_name: String, - #[serde(default = "default_2528")] - pub known_flaky: bool, #[serde(default = "default_2529")] - pub open_issues: Integer, + pub known_flaky: bool, #[serde(default = "default_2530")] - pub issues: Vec>, + pub open_issues: Integer, #[serde(default = "default_2531")] - pub verdict: String, + pub issues: Vec>, #[serde(default = "default_2532")] - pub tracker_unavailable: bool, + pub verdict: String, #[serde(default = "default_2533")] + pub tracker_unavailable: bool, + #[serde(default = "default_2534")] pub signal: Option>, } @@ -59603,9 +59616,9 @@ impl TrackerFlakyInput { #[non_exhaustive] pub struct TrackerItemOutput { pub items: Vec>, - #[serde(default = "default_2534")] - pub unknown: Vec, #[serde(default = "default_2535")] + pub unknown: Vec, + #[serde(default = "default_2536")] pub tracker_unavailable: bool, } @@ -59654,19 +59667,19 @@ impl TrackerItemInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerLinksOutput { - #[serde(default = "default_2536")] - pub subject: std::collections::HashMap, #[serde(default = "default_2537")] - pub verdict: String, + pub subject: std::collections::HashMap, #[serde(default = "default_2538")] - pub items: Vec>, + pub verdict: String, #[serde(default = "default_2539")] - pub epistemic: String, + pub items: Vec>, #[serde(default = "default_2540")] - pub record: std::collections::HashMap, + pub epistemic: String, #[serde(default = "default_2541")] - pub computed_at: String, + pub record: std::collections::HashMap, #[serde(default = "default_2542")] + pub computed_at: String, + #[serde(default = "default_2543")] pub tracker_unavailable: bool, } @@ -59764,11 +59777,11 @@ impl TrackerLinksInput { pub struct TrackerReleaseOutput { pub version: String, pub blockers: Vec>, - #[serde(default = "default_2543")] - pub active_blockers: Integer, #[serde(default = "default_2544")] - pub health: std::collections::HashMap, + pub active_blockers: Integer, #[serde(default = "default_2545")] + pub health: std::collections::HashMap, + #[serde(default = "default_2546")] pub tracker_unavailable: bool, } @@ -59817,17 +59830,17 @@ impl TrackerReleaseInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerSimilarOutput { - #[serde(default = "default_2546")] - pub items: Vec>, #[serde(default = "default_2547")] - pub query: std::collections::HashMap, + pub items: Vec>, #[serde(default = "default_2548")] - pub legs: std::collections::HashMap, + pub query: std::collections::HashMap, #[serde(default = "default_2549")] - pub epistemic: String, + pub legs: std::collections::HashMap, #[serde(default = "default_2550")] - pub tracker_unavailable: bool, + pub epistemic: String, #[serde(default = "default_2551")] + pub tracker_unavailable: bool, + #[serde(default = "default_2552")] pub namespaces: Vec, } @@ -59948,20 +59961,20 @@ pub struct TrackerSourceAddOutput { pub name: String, pub host: String, pub database: String, - #[serde(default = "default_2552")] - pub namespaces: Vec>, #[serde(default = "default_2553")] - pub contract: std::collections::HashMap, + pub namespaces: Vec>, #[serde(default = "default_2554")] - pub roles: Vec, + pub contract: std::collections::HashMap, #[serde(default = "default_2555")] - pub my_role: String, + pub roles: Vec, #[serde(default = "default_2556")] - pub dry_run: bool, + pub my_role: String, #[serde(default = "default_2557")] - pub written: bool, + pub dry_run: bool, #[serde(default = "default_2558")] - pub view_templates: std::collections::HashMap, + pub written: bool, + #[serde(default = "default_2559")] + pub view_templates: std::collections::HashMap, } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] @@ -60123,13 +60136,13 @@ impl TrackerSourceAddInput { #[non_exhaustive] pub struct TrackerSourceCheckOutput { pub name: String, - #[serde(default = "default_2559")] - pub database: String, #[serde(default = "default_2560")] - pub reachable: bool, + pub database: String, #[serde(default = "default_2561")] - pub contract: std::collections::HashMap, + pub reachable: bool, #[serde(default = "default_2562")] + pub contract: std::collections::HashMap, + #[serde(default = "default_2563")] pub view_templates: std::collections::HashMap, } @@ -60169,11 +60182,11 @@ impl TrackerSourceCheckInput { pub struct TrackerSourceInspectOutput { pub host: String, pub database: String, - #[serde(default = "default_2563")] - pub tables: Vec>, #[serde(default = "default_2564")] - pub roles: Vec, + pub tables: Vec>, #[serde(default = "default_2565")] + pub roles: Vec, + #[serde(default = "default_2566")] pub proposal: std::collections::HashMap, } @@ -60302,9 +60315,9 @@ impl TrackerSourceInspectInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerSourceListOutput { - #[serde(default = "default_2566")] - pub sources: Vec>, #[serde(default = "default_2567")] + pub sources: Vec>, + #[serde(default = "default_2568")] pub self_service: bool, } @@ -60357,9 +60370,9 @@ impl TrackerSourceListInput { #[non_exhaustive] pub struct TrackerSourceRemoveOutput { pub name: String, - #[serde(default = "default_2568")] - pub deactivated: bool, #[serde(default = "default_2569")] + pub deactivated: bool, + #[serde(default = "default_2570")] pub namespaces_retired: Vec, } @@ -60400,9 +60413,9 @@ impl TrackerSourceRemoveInput { #[non_exhaustive] pub struct TrackerSourceRotateOutput { pub name: String, - #[serde(default = "default_2570")] - pub contract: std::collections::HashMap, #[serde(default = "default_2571")] + pub contract: std::collections::HashMap, + #[serde(default = "default_2572")] pub rotated_at: String, } @@ -60449,11 +60462,11 @@ impl TrackerSourceRotateInput { #[non_exhaustive] pub struct TrackerSourceSetMappingOutput { pub name: String, - #[serde(default = "default_2572")] - pub contract: std::collections::HashMap, #[serde(default = "default_2573")] - pub dry_run: bool, + pub contract: std::collections::HashMap, #[serde(default = "default_2574")] + pub dry_run: bool, + #[serde(default = "default_2575")] pub written: bool, } @@ -60520,45 +60533,45 @@ impl TrackerSourceSetMappingInput { #[non_exhaustive] pub struct TrackerTestSignalOutput { pub test_name: String, - #[serde(default = "default_2575")] - pub verdict: String, #[serde(default = "default_2576")] - pub why: Vec, + pub verdict: String, #[serde(default = "default_2577")] - pub lower_bound: f64, + pub why: Vec, #[serde(default = "default_2578")] - pub window_days: Integer, + pub lower_bound: f64, #[serde(default = "default_2579")] - pub since: String, + pub window_days: Integer, #[serde(default = "default_2580")] - pub features: std::collections::HashMap, + pub since: String, #[serde(default = "default_2581")] - pub infra: std::collections::HashMap, + pub features: std::collections::HashMap, #[serde(default = "default_2582")] - pub churn: std::collections::HashMap, + pub infra: std::collections::HashMap, #[serde(default = "default_2583")] - pub thresholds: std::collections::HashMap, + pub churn: std::collections::HashMap, #[serde(default = "default_2584")] - pub source: String, + pub thresholds: std::collections::HashMap, #[serde(default = "default_2585")] - pub timings_ms: std::collections::HashMap, + pub source: String, #[serde(default = "default_2586")] - pub tracker_unavailable: bool, + pub timings_ms: std::collections::HashMap, #[serde(default = "default_2587")] - pub rollup: std::collections::HashMap, + pub tracker_unavailable: bool, #[serde(default = "default_2588")] - pub streak: std::collections::HashMap, + pub rollup: std::collections::HashMap, #[serde(default = "default_2589")] - pub smells: std::collections::HashMap, + pub streak: std::collections::HashMap, #[serde(default = "default_2590")] - pub prior: std::collections::HashMap, + pub smells: std::collections::HashMap, #[serde(default = "default_2591")] - pub unavailable_reason: String, + pub prior: std::collections::HashMap, #[serde(default = "default_2592")] - pub candidates: Vec>, + pub unavailable_reason: String, #[serde(default = "default_2593")] - pub candidate_matches: Integer, + pub candidates: Vec>, #[serde(default = "default_2594")] + pub candidate_matches: Integer, + #[serde(default = "default_2595")] pub resolved_from: String, } @@ -60662,9 +60675,9 @@ impl TrackerTestSignalInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct UiVitalsOutput { - #[serde(default = "default_2595")] - pub recorded: bool, #[serde(default = "default_2596")] + pub recorded: bool, + #[serde(default = "default_2597")] pub route: String, } @@ -60848,7 +60861,7 @@ pub struct WebhookDelivery { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct WebhookDeliveriesOutput { - #[serde(default = "default_2597")] + #[serde(default = "default_2598")] pub deliveries: Vec, } @@ -60970,14 +60983,14 @@ pub struct WebhookInfo { pub secret_ref: String, pub events: Vec, pub created_at: String, - #[serde(default = "default_2598")] + #[serde(default = "default_2599")] pub secret_present: bool, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct WebhookListOutput { - #[serde(default = "default_2599")] + #[serde(default = "default_2600")] pub webhooks: Vec, } @@ -61159,7 +61172,7 @@ pub struct WorkingMemoryMutationOutput { pub version: Integer, pub char_limit: Integer, pub value_length: Integer, - #[serde(default = "default_2600")] + #[serde(default = "default_2601")] pub fill_ratio: f64, } @@ -61383,15 +61396,15 @@ impl WorkingMemoryDeleteInput { pub struct WorkingMemoryGetOutput { pub found: bool, pub block_key: String, - #[serde(default = "default_2601")] - pub content: String, #[serde(default = "default_2602")] - pub char_limit: Integer, + pub content: String, #[serde(default = "default_2603")] - pub version: Integer, + pub char_limit: Integer, #[serde(default = "default_2604")] - pub updated_at: Option, + pub version: Integer, #[serde(default = "default_2605")] + pub updated_at: Option, + #[serde(default = "default_2606")] pub fill_ratio: f64, } @@ -61502,7 +61515,7 @@ pub struct WorkingMemoryBlock { pub content: String, pub char_limit: Integer, pub version: Integer, - #[serde(default = "default_2606")] + #[serde(default = "default_2607")] pub updated_at: Option, } @@ -61510,7 +61523,7 @@ pub struct WorkingMemoryBlock { #[non_exhaustive] pub struct WorkingMemoryRenderOutput { pub rendered: String, - #[serde(default = "default_2607")] + #[serde(default = "default_2608")] pub blocks: Vec, pub block_count: Integer, pub total_chars: Integer, @@ -67281,60 +67294,60 @@ fn default_1795() -> String { fn default_1796() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1797() -> Vec { +fn default_1797() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1798() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1798() -> String { +fn default_1799() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1799() -> Integer { +fn default_1800() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1800() -> Integer { +fn default_1801() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1801() -> String { +fn default_1802() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1802() -> Integer { +fn default_1803() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1803() -> Integer { +fn default_1804() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1804() -> MemoryProposalReady { +fn default_1805() -> MemoryProposalReady { serde_json::from_str("\"\"").expect("schema default") } -fn default_1805() -> Vec { +fn default_1806() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1806() -> Vec { +fn default_1807() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1807() -> Integer { +fn default_1808() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1808() -> ProposalPolicyMode { +fn default_1809() -> ProposalPolicyMode { serde_json::from_str("\"manual\"").expect("schema default") } -fn default_1809() -> Integer { +fn default_1810() -> Integer { serde_json::from_str("2").expect("schema default") } -fn default_1810() -> Integer { +fn default_1811() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1811() -> Integer { +fn default_1812() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1812() -> ProposalPolicy { +fn default_1813() -> ProposalPolicy { serde_json::from_str( "{\"mode\":\"manual\",\"min_passes\":2,\"max_fails\":0,\"reject_after_fails\":0}", ) .expect("schema default") } -fn default_1813() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1814() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67350,12 +67363,12 @@ fn default_1817() -> String { fn default_1818() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1819() -> bool { - serde_json::from_str("false").expect("schema default") -} -fn default_1820() -> String { +fn default_1819() -> String { serde_json::from_str("\"\"").expect("schema default") } +fn default_1820() -> bool { + serde_json::from_str("false").expect("schema default") +} fn default_1821() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67380,24 +67393,24 @@ fn default_1827() -> String { fn default_1828() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1829() -> Vec { +fn default_1829() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1830() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1830() -> f64 { +fn default_1831() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1831() -> String { +fn default_1832() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1832() -> String { +fn default_1833() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1833() -> Vec { +fn default_1834() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1834() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1835() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67407,11 +67420,11 @@ fn default_1836() -> String { fn default_1837() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1838() -> bool { - serde_json::from_str("false").expect("schema default") +fn default_1838() -> String { + serde_json::from_str("\"\"").expect("schema default") } -fn default_1839() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_1839() -> bool { + serde_json::from_str("false").expect("schema default") } fn default_1840() -> Integer { serde_json::from_str("0").expect("schema default") @@ -67419,183 +67432,183 @@ fn default_1840() -> Integer { fn default_1841() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1842() -> bool { +fn default_1842() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_1843() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1843() -> String { +fn default_1844() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1844() -> Integer { +fn default_1845() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_1845() -> MemoryRecallOutputOrder { +fn default_1846() -> MemoryRecallOutputOrder { serde_json::from_str("\"recent\"").expect("schema default") } -fn default_1846() -> Vec { +fn default_1847() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1847() -> Integer { +fn default_1848() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1848() -> Value { +fn default_1849() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1849() -> Value { +fn default_1850() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1850() -> String { +fn default_1851() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1851() -> String { +fn default_1852() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1852() -> Option { +fn default_1853() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1853() -> Option { +fn default_1854() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1854() -> bool { +fn default_1855() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1855() -> String { +fn default_1856() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1856() -> String { +fn default_1857() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1857() -> std::collections::HashMap { +fn default_1858() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1858() -> std::collections::HashMap { +fn default_1859() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1859() -> MemoryRecordRowStatus { +fn default_1860() -> MemoryRecordRowStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1860() -> Option { +fn default_1861() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1861() -> Option { +fn default_1862() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1862() -> bool { +fn default_1863() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1863() -> String { +fn default_1864() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1864() -> MemoryRecordWriteOutputKeySource { +fn default_1865() -> MemoryRecordWriteOutputKeySource { serde_json::from_str("\"anonymous\"").expect("schema default") } -fn default_1865() -> std::collections::HashMap { +fn default_1866() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1866() -> String { +fn default_1867() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1867() -> Integer { +fn default_1868() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1868() -> bool { +fn default_1869() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1869() -> Option { +fn default_1870() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1870() -> Integer { +fn default_1871() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1871() -> Integer { +fn default_1872() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1872() -> Option { +fn default_1873() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1873() -> String { +fn default_1874() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1874() -> Integer { +fn default_1875() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1875() -> Integer { +fn default_1876() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1876() -> bool { +fn default_1877() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1877() -> Vec { +fn default_1878() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1878() -> Option { +fn default_1879() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1879() -> Option { +fn default_1880() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1880() -> bool { +fn default_1881() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1881() -> bool { +fn default_1882() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1882() -> String { +fn default_1883() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1883() -> f64 { +fn default_1884() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1884() -> String { +fn default_1885() -> String { serde_json::from_str("\"fact\"").expect("schema default") } -fn default_1885() -> String { +fn default_1886() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1886() -> std::collections::HashMap { +fn default_1887() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1887() -> bool { +fn default_1888() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1888() -> Integer { +fn default_1889() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1889() -> String { +fn default_1890() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1890() -> Vec { +fn default_1891() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1891() -> Vec { +fn default_1892() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1892() -> Integer { +fn default_1893() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1893() -> Integer { +fn default_1894() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1894() -> String { +fn default_1895() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1895() -> String { +fn default_1896() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1896() -> Integer { +fn default_1897() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_1897() -> Integer { +fn default_1898() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1898() -> Integer { +fn default_1899() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1899() -> Vec { +fn default_1900() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1900() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_1901() -> Integer { serde_json::from_str("0").expect("schema default") } @@ -67605,65 +67618,65 @@ fn default_1902() -> Integer { fn default_1903() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1904() -> Vec { +fn default_1904() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_1905() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1905() -> String { +fn default_1906() -> String { serde_json::from_str("\"whole\"").expect("schema default") } -fn default_1906() -> Integer { +fn default_1907() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1907() -> Vec { +fn default_1908() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1908() -> Vec { +fn default_1909() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1909() -> Integer { +fn default_1910() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1910() -> Vec { +fn default_1911() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1911() -> Integer { +fn default_1912() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1912() -> Vec { +fn default_1913() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1913() -> Vec { +fn default_1914() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1914() -> bool { +fn default_1915() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1915() -> String { +fn default_1916() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1916() -> String { +fn default_1917() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1917() -> std::collections::HashMap { +fn default_1918() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1918() -> String { +fn default_1919() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1919() -> bool { +fn default_1920() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1920() -> Vec { +fn default_1921() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1921() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_1922() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1923() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_1923() -> Integer { + serde_json::from_str("0").expect("schema default") } fn default_1924() -> String { serde_json::from_str("\"\"").expect("schema default") @@ -67671,29 +67684,29 @@ fn default_1924() -> String { fn default_1925() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1926() -> bool { +fn default_1926() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1927() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1927() -> Integer { +fn default_1928() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1928() -> Option { +fn default_1929() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1929() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1930() -> String { serde_json::from_str("\"\"").expect("schema default") } fn default_1931() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1932() -> Vec { - serde_json::from_str("[]").expect("schema default") +fn default_1932() -> String { + serde_json::from_str("\"\"").expect("schema default") } -fn default_1933() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_1933() -> Vec { + serde_json::from_str("[]").expect("schema default") } fn default_1934() -> Integer { serde_json::from_str("0").expect("schema default") @@ -67710,54 +67723,54 @@ fn default_1937() -> Integer { fn default_1938() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1939() -> bool { +fn default_1939() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_1940() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1940() -> Vec> { +fn default_1941() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1941() -> Vec { +fn default_1942() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1942() -> Option { +fn default_1943() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1943() -> String { +fn default_1944() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1944() -> Integer { +fn default_1945() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1945() -> Option { +fn default_1946() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1946() -> Option { +fn default_1947() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1947() -> Option { +fn default_1948() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1948() -> Option { +fn default_1949() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1949() -> Vec { +fn default_1950() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1950() -> Integer { +fn default_1951() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1951() -> String { +fn default_1952() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1952() -> String { +fn default_1953() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1953() -> Option { +fn default_1954() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1954() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1955() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67767,21 +67780,21 @@ fn default_1956() -> String { fn default_1957() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1958() -> Option { +fn default_1958() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1959() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1959() -> String { +fn default_1960() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1960() -> String { +fn default_1961() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1961() -> Integer { +fn default_1962() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1962() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1963() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67794,45 +67807,45 @@ fn default_1965() -> String { fn default_1966() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1967() -> Integer { +fn default_1967() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1968() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1968() -> String { +fn default_1969() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1969() -> Vec { +fn default_1970() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1970() -> String { +fn default_1971() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1971() -> Integer { +fn default_1972() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1972() -> String { +fn default_1973() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1973() -> Integer { +fn default_1974() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1974() -> String { +fn default_1975() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1975() -> String { +fn default_1976() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1976() -> Integer { +fn default_1977() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1977() -> String { +fn default_1978() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1978() -> bool { +fn default_1979() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1979() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1980() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67842,105 +67855,105 @@ fn default_1981() -> String { fn default_1982() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1983() -> Option { +fn default_1983() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1984() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1984() -> String { +fn default_1985() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1985() -> Integer { +fn default_1986() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1986() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1987() -> String { serde_json::from_str("\"\"").expect("schema default") } fn default_1988() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1989() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1989() -> bool { +fn default_1990() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1990() -> Vec { +fn default_1991() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1991() -> std::collections::HashMap { +fn default_1992() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1992() -> String { +fn default_1993() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1993() -> Vec { +fn default_1994() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1994() -> std::collections::HashMap { +fn default_1995() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1995() -> Integer { +fn default_1996() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1996() -> Option { +fn default_1997() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1997() -> String { +fn default_1998() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1998() -> bool { +fn default_1999() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1999() -> Vec { +fn default_2000() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2000() -> Vec { +fn default_2001() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2001() -> std::collections::HashMap { +fn default_2002() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2002() -> Option { +fn default_2003() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2003() -> Vec { +fn default_2004() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2004() -> Integer { +fn default_2005() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2005() -> Integer { +fn default_2006() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2006() -> Vec { +fn default_2007() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2007() -> Option { +fn default_2008() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2008() -> Vec { +fn default_2009() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2009() -> Option { +fn default_2010() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2010() -> Option { +fn default_2011() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2011() -> Vec { +fn default_2012() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2012() -> bool { +fn default_2013() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2013() -> Vec { +fn default_2014() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2014() -> bool { +fn default_2015() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2015() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2016() -> Integer { serde_json::from_str("0").expect("schema default") } @@ -67965,12 +67978,12 @@ fn default_2022() -> Integer { fn default_2023() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2024() -> f64 { - serde_json::from_str("0.0").expect("schema default") -} -fn default_2025() -> Integer { +fn default_2024() -> Integer { serde_json::from_str("0").expect("schema default") } +fn default_2025() -> f64 { + serde_json::from_str("0.0").expect("schema default") +} fn default_2026() -> Integer { serde_json::from_str("0").expect("schema default") } @@ -67980,82 +67993,82 @@ fn default_2027() -> Integer { fn default_2028() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2029() -> Option { - serde_json::from_str("null").expect("schema default") +fn default_2029() -> Integer { + serde_json::from_str("0").expect("schema default") } fn default_2030() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2031() -> Vec { +fn default_2031() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_2032() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2032() -> String { +fn default_2033() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2033() -> String { +fn default_2034() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2034() -> Integer { +fn default_2035() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2035() -> Vec> { +fn default_2036() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2036() -> Vec { +fn default_2037() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2037() -> String { +fn default_2038() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2038() -> bool { +fn default_2039() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2039() -> String { +fn default_2040() -> String { serde_json::from_str("\"approval\"").expect("schema default") } -fn default_2040() -> String { +fn default_2041() -> String { serde_json::from_str("\"public\"").expect("schema default") } -fn default_2041() -> BrowseEntryMyStatus { +fn default_2042() -> BrowseEntryMyStatus { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2042() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2043() -> String { serde_json::from_str("\"\"").expect("schema default") } fn default_2044() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2045() -> Integer { +fn default_2045() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2046() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2046() -> String { +fn default_2047() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2047() -> Option { +fn default_2048() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2048() -> Option { +fn default_2049() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2049() -> Vec { +fn default_2050() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2050() -> Option { - serde_json::from_str("null").expect("schema default") -} fn default_2051() -> Option { serde_json::from_str("null").expect("schema default") } fn default_2052() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2053() -> Option> { +fn default_2053() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2054() -> Option { +fn default_2054() -> Option> { serde_json::from_str("null").expect("schema default") } fn default_2055() -> Option { @@ -68070,40 +68083,40 @@ fn default_2057() -> Option { fn default_2058() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2059() -> Option { +fn default_2059() -> Option { serde_json::from_str("null").expect("schema default") } fn default_2060() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2061() -> Option { +fn default_2061() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2062() -> Option { +fn default_2062() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2063() -> Option { +fn default_2063() -> Option { serde_json::from_str("null").expect("schema default") } fn default_2064() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2065() -> Option { +fn default_2065() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2066() -> Option { +fn default_2066() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2067() -> Option { +fn default_2067() -> Option { serde_json::from_str("null").expect("schema default") } fn default_2068() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2069() -> Option> { +fn default_2069() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2070() -> Option { +fn default_2070() -> Option> { serde_json::from_str("null").expect("schema default") } fn default_2071() -> Option { @@ -68112,22 +68125,22 @@ fn default_2071() -> Option { fn default_2072() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2073() -> Option { +fn default_2073() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2074() -> Option { +fn default_2074() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2075() -> Option>> { +fn default_2075() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2076() -> Option { +fn default_2076() -> Option>> { serde_json::from_str("null").expect("schema default") } -fn default_2077() -> Option { +fn default_2077() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2078() -> Option { +fn default_2078() -> Option { serde_json::from_str("null").expect("schema default") } fn default_2079() -> Option { @@ -68136,11 +68149,11 @@ fn default_2079() -> Option { fn default_2080() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2081() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_2081() -> Option { + serde_json::from_str("null").expect("schema default") } -fn default_2082() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_2082() -> Integer { + serde_json::from_str("0").expect("schema default") } fn default_2083() -> String { serde_json::from_str("\"\"").expect("schema default") @@ -68151,18 +68164,18 @@ fn default_2084() -> String { fn default_2085() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2086() -> Option { +fn default_2086() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2087() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2087() -> bool { +fn default_2088() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2088() -> Integer { +fn default_2089() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2089() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2090() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -68172,129 +68185,129 @@ fn default_2091() -> String { fn default_2092() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2093() -> Option { +fn default_2093() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2094() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2094() -> Option { +fn default_2095() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2095() -> String { +fn default_2096() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2096() -> Vec { +fn default_2097() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2097() -> String { +fn default_2098() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2098() -> String { +fn default_2099() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2099() -> Option { +fn default_2100() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2100() -> Vec { +fn default_2101() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2101() -> Option { +fn default_2102() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2102() -> String { +fn default_2103() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2103() -> bool { +fn default_2104() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2104() -> f64 { +fn default_2105() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2105() -> f64 { +fn default_2106() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2106() -> String { +fn default_2107() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2107() -> Option { +fn default_2108() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2108() -> Integer { +fn default_2109() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2109() -> Integer { +fn default_2110() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2110() -> NamespaceEntryVisibility { +fn default_2111() -> NamespaceEntryVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2111() -> String { +fn default_2112() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2112() -> Option { +fn default_2113() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2113() -> Option { +fn default_2114() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2114() -> Vec { +fn default_2115() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2115() -> MineEntryVisibility { +fn default_2116() -> MineEntryVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2116() -> String { +fn default_2117() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2117() -> String { +fn default_2118() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2118() -> String { +fn default_2119() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2119() -> Option { +fn default_2120() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2120() -> bool { +fn default_2121() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2121() -> bool { +fn default_2122() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2122() -> String { +fn default_2123() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2123() -> NamespaceRegisterOutputVisibility { +fn default_2124() -> NamespaceRegisterOutputVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2124() -> bool { +fn default_2125() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2125() -> Integer { +fn default_2126() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2126() -> Integer { +fn default_2127() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2127() -> bool { +fn default_2128() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2128() -> Vec> { +fn default_2129() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2129() -> Option { +fn default_2130() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2130() -> Option { +fn default_2131() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2131() -> Vec { +fn default_2132() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2132() -> Integer { +fn default_2133() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2133() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2134() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -68307,23 +68320,23 @@ fn default_2136() -> String { fn default_2137() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2138() -> Option { - serde_json::from_str("null").expect("schema default") -} -fn default_2139() -> String { +fn default_2138() -> String { serde_json::from_str("\"\"").expect("schema default") } +fn default_2139() -> Option { + serde_json::from_str("null").expect("schema default") +} fn default_2140() -> String { serde_json::from_str("\"\"").expect("schema default") } fn default_2141() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2142() -> Vec { - serde_json::from_str("[]").expect("schema default") +fn default_2142() -> String { + serde_json::from_str("\"\"").expect("schema default") } -fn default_2143() -> Option { - serde_json::from_str("null").expect("schema default") +fn default_2143() -> Vec { + serde_json::from_str("[]").expect("schema default") } fn default_2144() -> Option { serde_json::from_str("null").expect("schema default") @@ -68334,33 +68347,33 @@ fn default_2145() -> Option { fn default_2146() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2147() -> String { +fn default_2147() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_2148() -> String { serde_json::from_str("\"{}\"").expect("schema default") } -fn default_2148() -> NamespaceSnapshotOutputSnapshotMemoryRowStatus { +fn default_2149() -> NamespaceSnapshotOutputSnapshotMemoryRowStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2149() -> Option { +fn default_2150() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2150() -> Vec { +fn default_2151() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2151() -> String { +fn default_2152() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2152() -> Integer { +fn default_2153() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2153() -> Integer { +fn default_2154() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2154() -> Option { +fn default_2155() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2155() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2156() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -68370,191 +68383,191 @@ fn default_2157() -> String { fn default_2158() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2159() -> Option { +fn default_2159() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2160() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2160() -> f64 { +fn default_2161() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2161() -> Option { +fn default_2162() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2162() -> Option { +fn default_2163() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2163() -> Integer { +fn default_2164() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2164() -> Option { +fn default_2165() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2165() -> Option { +fn default_2166() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2166() -> String { +fn default_2167() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2167() -> Option { +fn default_2168() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2168() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2169() -> String { serde_json::from_str("\"\"").expect("schema default") } fn default_2170() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2171() -> Option { +fn default_2171() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2172() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2172() -> String { +fn default_2173() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2173() -> Option { +fn default_2174() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2174() -> String { +fn default_2175() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2175() -> String { +fn default_2176() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2176() -> Vec { +fn default_2177() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2177() -> Vec { +fn default_2178() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2178() -> Option { +fn default_2179() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2179() -> Integer { +fn default_2180() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2180() -> String { +fn default_2181() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2181() -> Vec { +fn default_2182() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2182() -> Vec { +fn default_2183() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2183() -> String { +fn default_2184() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2184() -> Option { +fn default_2185() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2185() -> Vec { +fn default_2186() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2186() -> Integer { +fn default_2187() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2187() -> Vec { +fn default_2188() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2188() -> Option { +fn default_2189() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2189() -> Vec { +fn default_2190() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2190() -> Vec { +fn default_2191() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2191() -> Option { +fn default_2192() -> Option { serde_json::from_str("0").expect("schema default") } -fn default_2192() -> TuneProposalEffect { +fn default_2193() -> TuneProposalEffect { serde_json::from_str("\"future\"").expect("schema default") } -fn default_2193() -> TuneApplyVia { +fn default_2194() -> TuneApplyVia { serde_json::from_str("\"op\"").expect("schema default") } -fn default_2194() -> bool { +fn default_2195() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2195() -> Vec { +fn default_2196() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2196() -> Option { +fn default_2197() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2197() -> Option { +fn default_2198() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2198() -> String { +fn default_2199() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2199() -> Vec { +fn default_2200() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2200() -> Vec { +fn default_2201() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2201() -> Option { +fn default_2202() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2202() -> Option { +fn default_2203() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2203() -> Option { +fn default_2204() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2204() -> String { +fn default_2205() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2205() -> Option { +fn default_2206() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2206() -> Option { +fn default_2207() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2207() -> Option { +fn default_2208() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2208() -> Vec { +fn default_2209() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2209() -> bool { +fn default_2210() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2210() -> Option { +fn default_2211() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2211() -> Option { +fn default_2212() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2212() -> Vec { +fn default_2213() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2213() -> String { +fn default_2214() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2214() -> String { +fn default_2215() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2215() -> Vec> { +fn default_2216() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2216() -> std::collections::HashMap { +fn default_2217() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2217() -> Vec { +fn default_2218() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2218() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2219() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2220() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_2220() -> Integer { + serde_json::from_str("0").expect("schema default") } fn default_2221() -> String { serde_json::from_str("\"\"").expect("schema default") @@ -68562,140 +68575,140 @@ fn default_2221() -> String { fn default_2222() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2223() -> Vec { - serde_json::from_str("[]").expect("schema default") +fn default_2223() -> String { + serde_json::from_str("\"\"").expect("schema default") } fn default_2224() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2225() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_2225() -> Vec { + serde_json::from_str("[]").expect("schema default") } fn default_2226() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2227() -> bool { +fn default_2227() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2228() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2228() -> Integer { +fn default_2229() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2229() -> String { +fn default_2230() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2230() -> Option { +fn default_2231() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2231() -> Vec { +fn default_2232() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2232() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2233() -> String { serde_json::from_str("\"\"").expect("schema default") } fn default_2234() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2235() -> Vec { +fn default_2235() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2236() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2236() -> String { +fn default_2237() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2237() -> String { +fn default_2238() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2238() -> std::collections::HashMap { +fn default_2239() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2239() -> String { +fn default_2240() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2240() -> Option { +fn default_2241() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2241() -> Option { +fn default_2242() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2242() -> bool { +fn default_2243() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2243() -> String { +fn default_2244() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2244() -> String { +fn default_2245() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2245() -> Vec { +fn default_2246() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2246() -> Integer { +fn default_2247() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2247() -> String { +fn default_2248() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2248() -> String { +fn default_2249() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2249() -> Option { +fn default_2250() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2250() -> bool { +fn default_2251() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2251() -> String { +fn default_2252() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2252() -> bool { +fn default_2253() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2253() -> String { +fn default_2254() -> String { serde_json::from_str("\"inherit\"").expect("schema default") } -fn default_2254() -> Option { +fn default_2255() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2255() -> Option { +fn default_2256() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2256() -> bool { +fn default_2257() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2257() -> Vec { +fn default_2258() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2258() -> Integer { +fn default_2259() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2259() -> ProcedureEvolveOutputGate { +fn default_2260() -> ProcedureEvolveOutputGate { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2260() -> String { +fn default_2261() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2261() -> f64 { +fn default_2262() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2262() -> std::collections::HashMap { - serde_json::from_str("{}").expect("schema default") -} fn default_2263() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2264() -> std::collections::HashMap { +fn default_2264() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } fn default_2265() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2266() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_2266() -> std::collections::HashMap { + serde_json::from_str("{}").expect("schema default") } -fn default_2267() -> Vec { - serde_json::from_str("[]").expect("schema default") +fn default_2267() -> String { + serde_json::from_str("\"\"").expect("schema default") } fn default_2268() -> Vec { serde_json::from_str("[]").expect("schema default") @@ -68703,138 +68716,138 @@ fn default_2268() -> Vec { fn default_2269() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2270() -> std::collections::HashMap { +fn default_2270() -> Vec { + serde_json::from_str("[]").expect("schema default") +} +fn default_2271() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2271() -> Integer { +fn default_2272() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2272() -> bool { +fn default_2273() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2273() -> std::collections::HashMap { +fn default_2274() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2274() -> Vec { +fn default_2275() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2275() -> std::collections::HashMap { +fn default_2276() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2276() -> String { +fn default_2277() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2277() -> ProcedureLocateOutputStatus { +fn default_2278() -> ProcedureLocateOutputStatus { serde_json::from_str("\"authored\"").expect("schema default") } -fn default_2278() -> Option> { +fn default_2279() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2279() -> Vec>> { +fn default_2280() -> Vec>> { serde_json::from_str("[]").expect("schema default") } -fn default_2280() -> Vec { +fn default_2281() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2281() -> Vec { +fn default_2282() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2282() -> std::collections::HashMap { +fn default_2283() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2283() -> bool { +fn default_2284() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2284() -> Vec { +fn default_2285() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2285() -> Vec> { +fn default_2286() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2286() -> String { +fn default_2287() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2287() -> std::collections::HashMap { +fn default_2288() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2288() -> std::collections::HashMap { +fn default_2289() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2289() -> Vec { +fn default_2290() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2290() -> std::collections::HashMap { +fn default_2291() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2291() -> Option> { +fn default_2292() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2292() -> bool { +fn default_2293() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2293() -> std::collections::HashMap { +fn default_2294() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2294() -> ProcedureMatchStatus { +fn default_2295() -> ProcedureMatchStatus { serde_json::from_str("\"authored\"").expect("schema default") } -fn default_2295() -> Option> { +fn default_2296() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2296() -> Vec { +fn default_2297() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2297() -> Integer { +fn default_2298() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2298() -> Vec> { +fn default_2299() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2299() -> f64 { - serde_json::from_str("0.0").expect("schema default") -} fn default_2300() -> f64 { serde_json::from_str("0.0").expect("schema default") } fn default_2301() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2302() -> Option { +fn default_2302() -> f64 { + serde_json::from_str("0.0").expect("schema default") +} +fn default_2303() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2303() -> std::collections::HashMap { +fn default_2304() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2304() -> std::collections::HashMap> { +fn default_2305() -> std::collections::HashMap> { serde_json::from_str("{}").expect("schema default") } -fn default_2305() -> String { +fn default_2306() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2306() -> Integer { +fn default_2307() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2307() -> String { +fn default_2308() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2308() -> f64 { +fn default_2309() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2309() -> Vec { +fn default_2310() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2310() -> ProcedureReviseOutputOutcome { +fn default_2311() -> ProcedureReviseOutputOutcome { serde_json::from_str("\"opened\"").expect("schema default") } -fn default_2311() -> Vec { +fn default_2312() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2312() -> Vec { +fn default_2313() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2313() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2314() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -68844,54 +68857,54 @@ fn default_2315() -> String { fn default_2316() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2317() -> Option { +fn default_2317() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2318() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2318() -> Integer { +fn default_2319() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2319() -> Vec { +fn default_2320() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2320() -> std::collections::HashMap { +fn default_2321() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2321() -> Option { +fn default_2322() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2322() -> String { +fn default_2323() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2323() -> Integer { +fn default_2324() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2324() -> String { +fn default_2325() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2325() -> String { +fn default_2326() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2326() -> std::collections::HashMap { +fn default_2327() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2327() -> String { +fn default_2328() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2328() -> String { +fn default_2329() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2329() -> Option { +fn default_2330() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2330() -> RunBeginOutputStatus { +fn default_2331() -> RunBeginOutputStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2331() -> String { +fn default_2332() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2332() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2333() -> Integer { serde_json::from_str("0").expect("schema default") } @@ -68901,47 +68914,47 @@ fn default_2334() -> Integer { fn default_2335() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2336() -> Vec { +fn default_2336() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_2337() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2337() -> Integer { +fn default_2338() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_2338() -> Integer { +fn default_2339() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2339() -> Integer { +fn default_2340() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2340() -> String { +fn default_2341() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2341() -> String { +fn default_2342() -> String { serde_json::from_str("\"keep\"").expect("schema default") } -fn default_2342() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2343() -> Integer { serde_json::from_str("0").expect("schema default") } fn default_2344() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2345() -> Option { +fn default_2345() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_2346() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2346() -> Integer { +fn default_2347() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_2347() -> Vec { - serde_json::from_str("[]").expect("schema default") -} fn default_2348() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2349() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_2349() -> Vec { + serde_json::from_str("[]").expect("schema default") } fn default_2350() -> Integer { serde_json::from_str("0").expect("schema default") @@ -68949,42 +68962,42 @@ fn default_2350() -> Integer { fn default_2351() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2352() -> f64 { +fn default_2352() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_2353() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2353() -> Integer { +fn default_2354() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2354() -> Vec { +fn default_2355() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2355() -> Integer { +fn default_2356() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2356() -> Vec { +fn default_2357() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2357() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2358() -> Integer { serde_json::from_str("0").expect("schema default") } fn default_2359() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2360() -> Vec { +fn default_2360() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_2361() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2361() -> Option { +fn default_2362() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2362() -> String { +fn default_2363() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2363() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2364() -> Integer { serde_json::from_str("0").expect("schema default") } @@ -68994,33 +69007,33 @@ fn default_2365() -> Integer { fn default_2366() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2367() -> bool { - serde_json::from_str("false").expect("schema default") +fn default_2367() -> Integer { + serde_json::from_str("0").expect("schema default") } fn default_2368() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2369() -> Option> { +fn default_2369() -> bool { + serde_json::from_str("false").expect("schema default") +} +fn default_2370() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2370() -> LiveSearchResultsLive { +fn default_2371() -> LiveSearchResultsLive { serde_json::from_str("true").expect("schema default") } -fn default_2371() -> String { +fn default_2372() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2372() -> LiveSearchHitLive { +fn default_2373() -> LiveSearchHitLive { serde_json::from_str("true").expect("schema default") } -fn default_2373() -> Vec { +fn default_2374() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2374() -> Option { +fn default_2375() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2375() -> std::collections::HashMap { - serde_json::from_str("{}").expect("schema default") -} fn default_2376() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } @@ -69030,24 +69043,24 @@ fn default_2377() -> std::collections::HashMap { fn default_2378() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2379() -> Option> { +fn default_2379() -> std::collections::HashMap { + serde_json::from_str("{}").expect("schema default") +} +fn default_2380() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2380() -> Vec { +fn default_2381() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2381() -> Integer { +fn default_2382() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2382() -> String { +fn default_2383() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2383() -> Integer { +fn default_2384() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2384() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2385() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -69069,60 +69082,60 @@ fn default_2390() -> String { fn default_2391() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2392() -> Vec { +fn default_2392() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2393() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2393() -> String { +fn default_2394() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2394() -> String { +fn default_2395() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2395() -> Vec { +fn default_2396() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2396() -> String { +fn default_2397() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2397() -> String { +fn default_2398() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2398() -> Vec { +fn default_2399() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2399() -> Vec { +fn default_2400() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2400() -> Vec { +fn default_2401() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2401() -> String { +fn default_2402() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2402() -> String { +fn default_2403() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2403() -> Vec { +fn default_2404() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2404() -> Vec { +fn default_2405() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2405() -> Vec { +fn default_2406() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2406() -> String { +fn default_2407() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2407() -> String { +fn default_2408() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2408() -> Option { +fn default_2409() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2409() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2410() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -69138,15 +69151,15 @@ fn default_2413() -> String { fn default_2414() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2415() -> Vec { +fn default_2415() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2416() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2416() -> Option { +fn default_2417() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2417() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2418() -> Integer { serde_json::from_str("0").expect("schema default") } @@ -69159,11 +69172,11 @@ fn default_2420() -> Integer { fn default_2421() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2422() -> bool { - serde_json::from_str("false").expect("schema default") +fn default_2422() -> Integer { + serde_json::from_str("0").expect("schema default") } -fn default_2423() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_2423() -> bool { + serde_json::from_str("false").expect("schema default") } fn default_2424() -> String { serde_json::from_str("\"\"").expect("schema default") @@ -69183,21 +69196,21 @@ fn default_2428() -> String { fn default_2429() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2430() -> Option { +fn default_2430() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2431() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2431() -> Integer { +fn default_2432() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2432() -> Integer { +fn default_2433() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2433() -> Vec { +fn default_2434() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2434() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2435() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -69207,8 +69220,8 @@ fn default_2436() -> String { fn default_2437() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2438() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_2438() -> String { + serde_json::from_str("\"\"").expect("schema default") } fn default_2439() -> Integer { serde_json::from_str("0").expect("schema default") @@ -69222,32 +69235,32 @@ fn default_2441() -> Integer { fn default_2442() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2443() -> f64 { - serde_json::from_str("0.0").expect("schema default") -} -fn default_2444() -> Integer { +fn default_2443() -> Integer { serde_json::from_str("0").expect("schema default") } +fn default_2444() -> f64 { + serde_json::from_str("0.0").expect("schema default") +} fn default_2445() -> Integer { serde_json::from_str("0").expect("schema default") } fn default_2446() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2447() -> String { +fn default_2447() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_2448() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2448() -> SessionBriefStats { +fn default_2449() -> 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_2449() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2450() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2451() -> Option { - serde_json::from_str("null").expect("schema default") +fn default_2451() -> String { + serde_json::from_str("\"\"").expect("schema default") } fn default_2452() -> Option { serde_json::from_str("null").expect("schema default") @@ -69255,57 +69268,57 @@ fn default_2452() -> Option { fn default_2453() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2454() -> Integer { +fn default_2454() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_2455() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2455() -> std::collections::HashMap { +fn default_2456() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2456() -> String { +fn default_2457() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2457() -> String { +fn default_2458() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2458() -> Option { +fn default_2459() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2459() -> String { +fn default_2460() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2460() -> Integer { +fn default_2461() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2461() -> Integer { +fn default_2462() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2462() -> Option { +fn default_2463() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2463() -> std::collections::HashMap { +fn default_2464() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2464() -> String { +fn default_2465() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2465() -> Integer { +fn default_2466() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2466() -> String { +fn default_2467() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2467() -> Option { +fn default_2468() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2468() -> String { +fn default_2469() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2469() -> Option { +fn default_2470() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2470() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2471() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -69315,327 +69328,327 @@ fn default_2472() -> String { fn default_2473() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2474() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_2474() -> String { + serde_json::from_str("\"\"").expect("schema default") } fn default_2475() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2476() -> String { +fn default_2476() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_2477() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2477() -> std::collections::HashMap { +fn default_2478() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2478() -> String { +fn default_2479() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2479() -> String { +fn default_2480() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2480() -> bool { +fn default_2481() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2481() -> String { +fn default_2482() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2482() -> std::collections::HashMap { +fn default_2483() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2483() -> Vec> { +fn default_2484() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2484() -> Vec { +fn default_2485() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2485() -> Vec { +fn default_2486() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2486() -> bool { +fn default_2487() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2487() -> String { +fn default_2488() -> String { serde_json::from_str("\"unknown\"").expect("schema default") } -fn default_2488() -> String { +fn default_2489() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2489() -> Vec { +fn default_2490() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2490() -> bool { +fn default_2491() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2491() -> String { +fn default_2492() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2492() -> bool { +fn default_2493() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2493() -> Vec { +fn default_2494() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2494() -> std::collections::HashMap { +fn default_2495() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2495() -> Vec> { +fn default_2496() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2496() -> bool { +fn default_2497() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2497() -> bool { +fn default_2498() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2498() -> Vec> { +fn default_2499() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2499() -> std::collections::HashMap { +fn default_2500() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2500() -> String { +fn default_2501() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2501() -> Vec> { +fn default_2502() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2502() -> bool { +fn default_2503() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2503() -> String { +fn default_2504() -> String { serde_json::from_str("\"calibrated\"").expect("schema default") } -fn default_2504() -> std::collections::HashMap { +fn default_2505() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2505() -> std::collections::HashMap { +fn default_2506() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2506() -> String { +fn default_2507() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2507() -> std::collections::HashMap { +fn default_2508() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2508() -> std::collections::HashMap { +fn default_2509() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2509() -> std::collections::HashMap { +fn default_2510() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2510() -> String { +fn default_2511() -> String { serde_json::from_str("\"ok\"").expect("schema default") } -fn default_2511() -> String { +fn default_2512() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2512() -> String { +fn default_2513() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2513() -> bool { +fn default_2514() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2514() -> Integer { +fn default_2515() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2515() -> String { +fn default_2516() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2516() -> String { +fn default_2517() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2517() -> Vec { +fn default_2518() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2518() -> bool { +fn default_2519() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2519() -> Vec { +fn default_2520() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2520() -> std::collections::HashMap> { +fn default_2521() -> std::collections::HashMap> { serde_json::from_str("{}").expect("schema default") } -fn default_2521() -> Vec> { +fn default_2522() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2522() -> Vec> { +fn default_2523() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2523() -> String { +fn default_2524() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2524() -> Vec> { +fn default_2525() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2525() -> std::collections::HashMap { +fn default_2526() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2526() -> String { +fn default_2527() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2527() -> Vec> { +fn default_2528() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2528() -> bool { +fn default_2529() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2529() -> Integer { +fn default_2530() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2530() -> Vec> { +fn default_2531() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2531() -> String { +fn default_2532() -> String { serde_json::from_str("\"no_flaky_signal\"").expect("schema default") } -fn default_2532() -> bool { +fn default_2533() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2533() -> Option> { +fn default_2534() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2534() -> Vec { +fn default_2535() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2535() -> bool { +fn default_2536() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2536() -> std::collections::HashMap { +fn default_2537() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2537() -> String { +fn default_2538() -> String { serde_json::from_str("\"not_computed\"").expect("schema default") } -fn default_2538() -> Vec> { +fn default_2539() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2539() -> String { +fn default_2540() -> String { serde_json::from_str("\"candidate\"").expect("schema default") } -fn default_2540() -> std::collections::HashMap { +fn default_2541() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2541() -> String { +fn default_2542() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2542() -> bool { +fn default_2543() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2543() -> Integer { +fn default_2544() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2544() -> std::collections::HashMap { +fn default_2545() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2545() -> bool { +fn default_2546() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2546() -> Vec> { +fn default_2547() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2547() -> std::collections::HashMap { +fn default_2548() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2548() -> std::collections::HashMap { +fn default_2549() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2549() -> String { +fn default_2550() -> String { serde_json::from_str("\"lower_bound\"").expect("schema default") } -fn default_2550() -> bool { +fn default_2551() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2551() -> Vec { +fn default_2552() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2552() -> Vec> { +fn default_2553() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2553() -> std::collections::HashMap { +fn default_2554() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2554() -> Vec { +fn default_2555() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2555() -> String { +fn default_2556() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2556() -> bool { +fn default_2557() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2557() -> bool { +fn default_2558() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2558() -> std::collections::HashMap { +fn default_2559() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2559() -> String { +fn default_2560() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2560() -> bool { +fn default_2561() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2561() -> std::collections::HashMap { +fn default_2562() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2562() -> std::collections::HashMap { +fn default_2563() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2563() -> Vec> { +fn default_2564() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2564() -> Vec { +fn default_2565() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2565() -> std::collections::HashMap { +fn default_2566() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2566() -> Vec> { +fn default_2567() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2567() -> bool { +fn default_2568() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2568() -> bool { +fn default_2569() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2569() -> Vec { +fn default_2570() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2570() -> std::collections::HashMap { +fn default_2571() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2571() -> String { +fn default_2572() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2572() -> std::collections::HashMap { +fn default_2573() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2573() -> bool { +fn default_2574() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2574() -> bool { +fn default_2575() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2575() -> String { +fn default_2576() -> String { serde_json::from_str("\"no_signal\"").expect("schema default") } -fn default_2576() -> Vec { +fn default_2577() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2577() -> f64 { +fn default_2578() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2578() -> Integer { +fn default_2579() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2579() -> String { +fn default_2580() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2580() -> std::collections::HashMap { - serde_json::from_str("{}").expect("schema default") -} fn default_2581() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } @@ -69645,18 +69658,18 @@ fn default_2582() -> std::collections::HashMap { fn default_2583() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2584() -> String { +fn default_2584() -> std::collections::HashMap { + serde_json::from_str("{}").expect("schema default") +} +fn default_2585() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2585() -> std::collections::HashMap { +fn default_2586() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2586() -> bool { +fn default_2587() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2587() -> std::collections::HashMap { - serde_json::from_str("{}").expect("schema default") -} fn default_2588() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } @@ -69666,54 +69679,57 @@ fn default_2589() -> std::collections::HashMap { fn default_2590() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2591() -> String { +fn default_2591() -> std::collections::HashMap { + serde_json::from_str("{}").expect("schema default") +} +fn default_2592() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2592() -> Vec> { +fn default_2593() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2593() -> Integer { +fn default_2594() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2594() -> String { +fn default_2595() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2595() -> bool { +fn default_2596() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2596() -> String { +fn default_2597() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2597() -> Vec { +fn default_2598() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2598() -> bool { +fn default_2599() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2599() -> Vec { +fn default_2600() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2600() -> f64 { +fn default_2601() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2601() -> String { +fn default_2602() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2602() -> Integer { +fn default_2603() -> Integer { serde_json::from_str("4096").expect("schema default") } -fn default_2603() -> Integer { +fn default_2604() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2604() -> Option { +fn default_2605() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2605() -> f64 { +fn default_2606() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2606() -> Option { +fn default_2607() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2607() -> Vec { +fn default_2608() -> Vec { serde_json::from_str("[]").expect("schema default") } diff --git a/sdk/typescript/src/generated/ops.ts b/sdk/typescript/src/generated/ops.ts index 2a902220d2..6542cbb2f1 100644 --- a/sdk/typescript/src/generated/ops.ts +++ b/sdk/typescript/src/generated/ops.ts @@ -7130,6 +7130,7 @@ export interface MemoryProposalsInput { namespace: string; prefix?: string; tags?: string[]; + memory_keys?: string[]; only?: "" | "ready"; limit?: number; count_only?: boolean; @@ -7140,6 +7141,7 @@ export interface MemoryProposal { memory_id: string; content_sha256?: string; agent?: string; + actor?: string; memory_type?: string; value_preview?: string; sensitivity?: string; diff --git a/server/core/ch_params.py b/server/core/ch_params.py index 533c26ead5..05bbb6249a 100644 --- a/server/core/ch_params.py +++ b/server/core/ch_params.py @@ -40,3 +40,8 @@ def fitting[T](values: Sequence[T], *, limit: int = FIELD_BYTES) -> list[T]: """The leading values of `values` that one parameter of at most `limit` bytes carries (all of them when they fit).""" return next(chunks(values, limit=limit), []) + + +def fits[T](values: Sequence[T], *, limit: int = FIELD_BYTES) -> bool: + """Whether one parameter of at most `limit` bytes carries all of `values`.""" + return len(format_bind_value(list(values)).encode()) <= limit diff --git a/server/memory/api/models_proposals.py b/server/memory/api/models_proposals.py index 6d11d88a1b..d181f93de2 100644 --- a/server/memory/api/models_proposals.py +++ b/server/memory/api/models_proposals.py @@ -12,7 +12,7 @@ from __future__ import annotations -from typing import Literal +from typing import Annotated, Literal from pydantic import BaseModel, Field @@ -26,21 +26,34 @@ class MemoryProposalsInput(BaseModel): prefix: str = Field(default="", max_length=256) # Only proposals carrying any of these tags; empty = no tag filter. tags: list[str] = Field(default_factory=list, max_length=20) + # Only pending proposals under these keys, cut by `limit` like any listing; empty lists + # every proposal. + memory_keys: list[Annotated[str, Field(min_length=1)]] = Field( + default_factory=list, max_length=500 + ) # `ready` keeps only proposals the policy thresholds would decide now # (accept or reject); "" lists every proposal. only: Literal["", "ready"] = "" # At most this many proposals returned, newest first. limit: int = Field(default=50, ge=1, le=500) - # Answer `total`, the exact number of pending proposals that match prefix and tags, - # and the namespace's `policy`, with no proposal or graded count read; default off. + # Answer `total`, the exact number of pending proposals that match prefix, tags and + # memory_keys, and the namespace's `policy`, with no proposal or graded count read; + # default off. count_only: bool = False class MemoryProposal(BaseModel): memory_key: str memory_id: str + # The stored content hash; "" for a high row, whose hash comes with its value + # (memory.get_by_id). content_sha256: str = "" agent: str = "" + # Who proposed it, as the server stamped the row: `human:` or + # `process:` from the writer's token, or a pipeline's own actor + # (`process:session_contrast`) for a proposal the server wrote. `agent` is the label + # the writing client sent. + actor: str = "" memory_type: str = "" # The first 400 characters of the value; "" for a high row, read by key (memory.get). value_preview: str = "" diff --git a/server/memory/app/proposals_ops.py b/server/memory/app/proposals_ops.py index 1a1e92e90d..c40c6f2fd6 100644 --- a/server/memory/app/proposals_ops.py +++ b/server/memory/app/proposals_ops.py @@ -5,6 +5,7 @@ import logging from typing import Any +from server.core import ch_params from server.core.ch import get_client from server.core.errors import ValidationError from server.core.hashing import hash_text @@ -25,8 +26,13 @@ log = logging.getLogger(__name__) +def _asked_keys(input: MemoryProposalsInput) -> list[str]: + """The distinct keys the caller named, in one order whatever order they came in.""" + return sorted(set(input.memory_keys)) + + def _pending_filter(input: MemoryProposalsInput) -> tuple[list[str], dict[str, Any]]: - """The pending proposals the caller may read, narrowed by prefix and tags.""" + """The pending proposals the caller may read, narrowed by prefix, tags and keys.""" where = [ "org = {org:String}", "namespace = {ns:String}", @@ -40,6 +46,9 @@ def _pending_filter(input: MemoryProposalsInput) -> tuple[list[str], dict[str, A if input.tags: where.append("hasAny(tags, {tags:Array(String)})") params["tags"] = list(input.tags) + if input.memory_keys: + where.append("memory_key IN {keys:Array(String)}") + params["keys"] = _asked_keys(input) where.extend(scope_where(request_scope(), params)) return where, params @@ -64,6 +73,9 @@ async def handle_memory_proposals(input: MemoryProposalsInput) -> MemoryProposal # Checked here, after the namespace grant, so a caller outside it is refused first. if input.count_only and input.only: raise ValidationError("count_only counts every pending proposal; leave `only` empty") + # The keys travel as one bound parameter, which ClickHouse refuses past its field limit. + if not ch_params.fits(_asked_keys(input)): + raise ValidationError("memory_keys is too long for one read; send fewer or shorter keys") ch = get_client() if input.count_only: return MemoryProposalsOutput( @@ -74,7 +86,7 @@ async def handle_memory_proposals(input: MemoryProposalsInput) -> MemoryProposal params["cap"] = settings.memory_proposals_scan_cap rows = await ch.query_all( f""" - SELECT memory_key, toString(memory_id) AS mid, content_sha256, agent, memory_type, + SELECT memory_key, toString(memory_id) AS mid, content_sha256, agent, actor, memory_type, -- a high value is readable by key only if(sensitivity = 'high', '', substring(value, 1, 400)) AS preview, sensitivity, tags, toString(created_at) AS created, @@ -98,15 +110,18 @@ async def handle_memory_proposals(input: MemoryProposalsInput) -> MemoryProposal if input.only == "ready" and not ready: continue used, harm = usage.get(mid, (0, 0)) + sensitivity = str(r.get("sensitivity") or "") out.append( MemoryProposal( memory_key=key, memory_id=mid, - content_sha256=hash_text(r.get("content_sha256")), + # A short secret's hash can be guessed, and this read leaves no audit row. + content_sha256="" if sensitivity == "high" else hash_text(r.get("content_sha256")), agent=str(r.get("agent") or ""), + actor=str(r.get("actor") or ""), memory_type=str(r.get("memory_type") or ""), value_preview=str(r.get("preview") or ""), - sensitivity=str(r.get("sensitivity") or ""), + sensitivity=sensitivity, tags=[str(t) for t in (r.get("tags") or [])], created_at=str(r.get("created") or ""), graded_passes=c.passes, diff --git a/server/transport/mcp_descriptions.py b/server/transport/mcp_descriptions.py index aa39ac5db5..3c46df3590 100644 --- a/server/transport/mcp_descriptions.py +++ b/server/transport/mcp_descriptions.py @@ -919,7 +919,8 @@ def revision_policy(update: str) -> str: "List facts on trial (written with memory.set proposed=true) with the " "graded runs that relied on each — passes, fails — and what the " "namespace's proposal policy says (`ready`: accept / reject). " - "`count_only` answers just how many wait." + "`actor` is the proposer; `memory_keys` lists named keys only; " + "`count_only` only counts." ), "memory.proposal_decide": ( "Accept (→ active, served by default) or reject a list of proposals. " diff --git a/tests/analyzer/cases/planes.py b/tests/analyzer/cases/planes.py index a635475a06..773a125ac6 100644 --- a/tests/analyzer/cases/planes.py +++ b/tests/analyzer/cases/planes.py @@ -1111,12 +1111,14 @@ async def _tune_reads(ch: RecordingCH, c: dict[str, Any]) -> None: async def _proposals(ch: RecordingCH, c: dict[str, Any]) -> None: - """`memory.proposals` lists or counts, each with and without its prefix and tags: the - handlers case fills `count_only`, which leaves the filtered listing undriven.""" + """`memory.proposals` lists or counts, each with and without its prefix, tags and keys: + the handlers case fills `count_only`, which leaves the filtered listing undriven.""" from server.memory.api.models_proposals import MemoryProposalsInput from server.memory.app.proposals_ops import handle_memory_proposals - filters: dict[str, Any] = {"prefix": "k", "tags": ["billing"]} if c["filters"] else {} + filters: dict[str, Any] = ( + {"prefix": "k", "tags": ["billing"], "memory_keys": ["k1", "k2"]} if c["filters"] else {} + ) await handle_memory_proposals( MemoryProposalsInput(org=ORG, namespace=NS, count_only=c["count_only"], **filters) ) diff --git a/tests/analyzer/shapes.txt b/tests/analyzer/shapes.txt index 48a0a83b3b..236c1044d3 100644 --- a/tests/analyzer/shapes.txt +++ b/tests/analyzer/shapes.txt @@ -739,7 +739,6 @@ 544bda275e23 ALTER TABLE loom.memory_code_link_queue DELETE WHERE (org = {org:String} AND user_id = {uid:String}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? 54688d6f363c SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, e.status AS status, e.version AS version, -- The content hash, for the read receipt of a hit this 548ad40962ec SELECT chunk_id, path, scope, kind, start_line, end_line, content, symbol_ids, context_description FROM loom.code_chunks FINAL WHERE org = {org:String} AND namespace = {ns:String} AND embedding_model -548b3de5bbd4 SELECT memory_key, toString(memory_id) AS mid, content_sha256, agent, memory_type, -- a high value is readable by key only if(sensitivity = ?, ?, substring(value, ?, ?)) AS preview, sensitivity, tags, 549dd1314271 SELECT count() AS n FROM loom.conversation_embeddings FINAL WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND tombstoned_at IS NULL 54acb234d492 SELECT src_path, test_path, max(confidence) AS confidence, arraySort(groupUniqArray(method)) AS methods FROM loom.code_test_map FINAL WHERE org = {org:String} AND namespace = {ns:String} AND src_path 54c661ce618d SELECT count() AS n FROM loom.conversation_threads FINAL WHERE org = {org:String} AND namespace IN {ns:Array(String)} @@ -1022,7 +1021,6 @@ 723f99f654df SELECT count() AS n FROM loom.memory_chunks FINAL WHERE org = {org:String} AND tombstoned_at IS NULL AND namespace = {ns:String} 7241de7a778c ALTER TABLE loom.context_blobs UPDATE tombstoned_at = {now:DateTime} WHERE (org = {org:String} AND tombstoned_at IS NULL AND namespace IN {ns:Array(String)}) AND ({erasure_mutation_tag:String} = {eras 72570c0878fd SELECT count() AS n FROM loom.conversation_threads FINAL WHERE org = {org:String} AND tombstoned_at IS NULL AND namespace = {ns:String} -72a96f3573e5 SELECT memory_key, toString(memory_id) AS mid, content_sha256, agent, memory_type, -- a high value is readable by key only if(sensitivity = ?, ?, substring(value, ?, ?)) AS preview, sensitivity, tags, 72b942d5fcfb SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, e.status AS status, e.version AS version, -- The content hash, for the read receipt of a hit this 72ba39630853 SELECT memory_key, memory_type, value, confidence, source_trace, memory_id, entities, tags, valid_at, char_limit, pinned, tombstoned_at, version, status, superseded_by FROM loom.memory FINAL WHERE org 72e4548118f7 SELECT count() AS n FROM loom.search_misses WHERE org = {org:String} AND namespace IN {ns:Array(String)} @@ -1436,6 +1434,7 @@ 9dffe07ed651 SELECT operation, count() AS calls, countIf(success) AS succeeded, min(ts) AS first_at, max(ts) AS last_at FROM (SELECT raw.ts AS ts, raw.org AS org, raw.namespace AS namespace, raw.agent AS agent, ra 9e0bc0ef26b0 SELECT toYYYYMM(ts) AS partition, ts, event_type, org, namespace, actor, subject, request_id, row_hash FROM loom.audit_log WHERE ts >= toDateTime64(now() - INTERVAL {lb:UInt32} SECOND, ?, ?) ORDER BY 9e328bb12721 SELECT count() AS n FROM loom.learnings_queue WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? +9e92bf9a2af7 SELECT memory_key, toString(memory_id) AS mid, content_sha256, agent, actor, memory_type, -- a high value is readable by key only if(sensitivity = ?, ?, substring(value, ?, ?)) AS preview, sensitivity 9e9adc05a7ef SELECT namespace, kind, owner_email, description, tags, active, conversation_logging_enabled, capture_generation_io, coverage_sweep, consolidation_enabled, daily_cost_cap_usd, daily_user_cost_cap_usd, 9eafee0b23b4 SELECT count() AS n FROM loom.memory_extraction_queue WHERE org = {org:String} AND user_id = {uid:String} AND ? 9ed5e750e8c9 DELETE FROM loom.chunks WHERE org = {org:String} AND namespace = {ns:String} AND (source_uri, doc_version) IN {rows:Array(Tuple(String, UInt64))} SETTINGS lightweight_deletes_sync = ? @@ -1738,6 +1737,7 @@ bc1c9ad1efe8 ALTER TABLE loom.entity_triple_memories DELETE WHERE (org = {org:St bc2fa2b83f5e 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 bc5b1bfc8719 SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, e.status AS status, e.version AS version, -- The content hash, for the read receipt of a hit this bc8de31fd6e5 DELETE FROM loom.memory_evidence WHERE (org = {org:String} AND user_id = {uid:String}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS lightweight_deletes_sync = ? +bca75c5b86bf SELECT count() AS n FROM loom.memory FINAL WHERE org = {org:String} AND namespace = {ns:String} AND tombstoned_at IS NULL AND status = ? AND startsWith(memory_key, {p:String}) AND hasAny(tags, {tags:A bcbd26618fa1 SELECT ? AS seen FROM (SELECT raw.ts AS ts, raw.org AS org, raw.namespace AS namespace, raw.agent AS agent, raw.user_id AS user_id, raw.session_id AS session_id, raw.run_id AS run_id, raw.operation AS bccb3b408622 SELECT count() AS n FROM loom.memory_embeddings FINAL WHERE org = {org:String} AND tombstoned_at IS NULL AND scope = ? AND (namespace, memory_key) IN {keys:Array(Tuple(String, String))} bcd0d6a01148 SELECT count() AS n FROM loom.code_search_trace WHERE org = {org:String} AND namespace IN {ns:Array(String)} @@ -1856,7 +1856,6 @@ c892414a0cf3 SELECT role, granted_by, status, pending_role, pending_since FROM l c8ce735d214f SELECT count() AS n FROM loom.memory_embeddings FINAL WHERE org = {org:String} AND tombstoned_at IS NULL AND namespace IN {ns:Array(String)} c8e4a254b959 SELECT count() AS n FROM loom.conversation_threads FINAL WHERE org = {org:String} AND tombstoned_at IS NULL AND user_id = {uid:String} c901eadb5f4f SELECT status AS was FROM loom.memory_versions WHERE org = {org:String} AND namespace = {ns:String} AND agent = {a:String} AND user_id = {u:String} AND session_id = {s:String} AND memory_key = {k:Stri -c91d7e14d509 SELECT count() AS n FROM loom.memory FINAL WHERE org = {org:String} AND namespace = {ns:String} AND tombstoned_at IS NULL AND status = ? AND startsWith(memory_key, {p:String}) AND hasAny(tags, {tags:A c924a3001167 SELECT memory_id, version, confidence, source_trace, pinned, created_at, updated_at, expires_at, tombstoned_at, redacted_at, redaction_reason, actor, source_class, agent, status, conflict_with, tags, c92bf0b39a95 SELECT chunk_index, content, embedding_dim FROM loom.memory_chunks FINAL WHERE org = {org:String} AND namespace = {namespace:String} AND session_id = {session_id:String} AND chunk_index BETWEEN {first c95045c50e46 SELECT count() AS n FROM loom.code_answers WHERE org = {org:String} AND (namespace = {ns:String} OR memory_namespace = {ns:String}) @@ -2383,6 +2382,7 @@ fd95e7268232 ALTER TABLE loom.events DELETE WHERE (org = {org:String} AND namesp fdceada98fca SELECT count() AS n FROM loom.procedure_runs WHERE org = {org:String} AND namespace = {ns:String} AND memory_key = {key:String} fdd8cdfb2f2c SELECT org, namespace, agent, user_id, session_id, name, source_id, host, port, secure, user, password_enc, cluster, databases, actor, source_class, created_at, tombstoned_at, version FROM loom.query_ fdd936553196 SELECT count() AS n FROM loom.llm_response_cache WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? +fe06adad450a SELECT memory_key, toString(memory_id) AS mid, content_sha256, agent, actor, memory_type, -- a high value is readable by key only if(sensitivity = ?, ?, substring(value, ?, ?)) AS preview, sensitivity fe2a68877fdd ALTER TABLE loom.entity_summaries UPDATE tombstoned_at = {now:DateTime} WHERE (org = {org:String} AND tombstoned_at IS NULL AND user_id = {uid:String}) AND ({erasure_mutation_tag:String} = {erasure_mu fe341cb202a9 SELECT * FROM ( SELECT j.*, ifNull(d.doc_live, ?) AS has_document, j.open_jobs = ? AND ifNull(d.doc_written_at, toDateTime(?)) > toDateTime(j.latest_updated_at) AS replaced FROM ( SELECT source_uri, c fe404d0b76ee SELECT toString(record_id) AS rid, memory_key, toString(memory_id) AS mid, record_json, status, valid_at, valid_to FROM loom.memory_record_versions WHERE org = {org:String} AND namespace = {ns:String} diff --git a/tests/integration/test_proposal_triage.py b/tests/integration/test_proposal_triage.py new file mode 100644 index 0000000000..66cd452a36 --- /dev/null +++ b/tests/integration/test_proposal_triage.py @@ -0,0 +1,86 @@ +"""`memory.proposals` reads one pending proposal by its key, with who proposed it.""" + +from __future__ import annotations + +import json +from collections.abc import Callable +from datetime import datetime +from typing import Any + +import httpx + +from tests.integration._resources import minted_identity + + +async def test_a_proposal_is_read_by_key_with_its_proposer( + control_plane_url: str, mint_test_token: Callable[..., str] +) -> None: + who = minted_identity(mint_test_token, "proposal-triage") + scope = {"org": who["org"], "namespace": who["namespace"]} + headers = {"Authorization": f"Bearer {who['token']}"} + + async with httpx.AsyncClient(base_url=control_plane_url, timeout=120) as client: + + async def post(op: str, body: dict[str, Any]) -> dict[str, Any]: + r = await client.post(f"/v1/{op}", json=body, headers=headers) + assert r.status_code == 200, r.text + answer: dict[str, Any] = r.json() + return answer + + async def propose(key: str, value: str) -> dict[str, Any]: + wrote = await post( + "memory.set", + { + **scope, + "agent": "release-bot", + "memory_key": key, + "value": value, + "tags": ["triage"], + "proposed": True, + }, + ) + assert wrote["status"] == "proposed", wrote + return wrote + + asked = await propose("deploy_window", "Deploys run on Tuesday mornings before ten") + await propose("standup_time", "The weekly planning call starts at half past nine") + + both = await post("memory.proposals", scope) + assert sorted(p["memory_key"] for p in both["proposals"]) == [ + "deploy_window", + "standup_time", + ] + + listed = await post("memory.proposals", {**scope, "memory_keys": ["deploy_window"]}) + assert listed["total"] == 1 + [row] = listed["proposals"] + whole = await post("memory.get_by_id", {"org": who["org"], "memory_id": asked["memory_id"]}) + assert whole["found"] and whole["actor"] == f"process:{who['subject']}" + assert whole["value"] == "Deploys run on Tuesday mornings before ten" + assert datetime.fromisoformat(row.pop("created_at")) == datetime.fromisoformat( + whole["created_at"] + ).replace(tzinfo=None, microsecond=0) + assert row == { + "memory_key": "deploy_window", + "memory_id": asked["memory_id"], + "content_sha256": asked["content_sha256"], + "agent": "release-bot", + "actor": whole["actor"], + "memory_type": whole["memory_type"], + # The preview is cut from the value as stored, which is JSON. + "value_preview": json.dumps(whole["value"]), + "sensitivity": whole["sensitivity"], + "tags": ["triage"], + "graded_passes": 0, + "graded_fails": 0, + "last_graded_at": "", + "used_count": 0, + "harm_count": 0, + "ready": "", + "conflict_with": [], + } + + counted = await post( + "memory.proposals", {**scope, "memory_keys": ["deploy_window"], "count_only": True} + ) + assert counted["total"] == 1 and counted["proposals"] == [] diff --git a/tests/unit/test_ch_params.py b/tests/unit/test_ch_params.py index a1e40c25b7..2b41b86b68 100644 --- a/tests/unit/test_ch_params.py +++ b/tests/unit/test_ch_params.py @@ -8,7 +8,7 @@ from clickhouse_connect.driver.binding import format_bind_value -from server.core.ch_params import FIELD_BYTES, chunks, fitting +from server.core.ch_params import FIELD_BYTES, chunks, fits, fitting def _cell_key(i: int) -> tuple[str, ...]: @@ -60,3 +60,16 @@ def test_fitting_takes_the_leading_values_one_parameter_carries() -> None: def test_a_value_longer_than_the_bound_goes_alone() -> None: big, small = "x" * (FIELD_BYTES + 10), "y" assert list(chunks([small, big, small])) == [[small], [big], [small]] + + +def test_fits_measures_the_whole_parameter_as_rendered() -> None: + assert fits([]) and fits(["a", "b"]) + # A value alone is measured too, where `chunks` yields it whatever its size. + assert not fits(["x" * (FIELD_BYTES + 1)]) + # `[`, two quotes and `]` are four of the bytes. + assert fits(["x" * (FIELD_BYTES - 4)]) and not fits(["x" * (FIELD_BYTES - 3)]) + # A quote is escaped: two bytes rendered for one character sent. + quotes = ["'" * (FIELD_BYTES // 2)] + assert len(quotes[0]) < FIELD_BYTES < _bytes(quotes) and not fits(quotes) + keys = [_cell_key(i) for i in range(1600)] + assert not fits(keys) and fits(fitting(keys)) diff --git a/tests/unit/test_proposal_triage.py b/tests/unit/test_proposal_triage.py new file mode 100644 index 0000000000..28a56af39c --- /dev/null +++ b/tests/unit/test_proposal_triage.py @@ -0,0 +1,165 @@ +"""`memory.proposals` as a triage read, on clickhouse-local against the real table: it +names who proposed each row, lists named keys only on request, stays inside the caller's +read scope, and serves no hash for a `high` row.""" + +from __future__ import annotations + +from typing import Any + +import pytest +from pydantic import ValidationError as ModelError + +from server.core import ch_params, errors +from server.identity.domain.read_scope import WHOLE_NAMESPACE, ReadFilters +from server.memory.api.models_proposals import MemoryProposalsInput, MemoryProposalsOutput +from server.memory.app import proposals, proposals_ops +from server.memory.domain.proposal_policy import ProposalPolicy +from tests.unit.clickhouse_local import CLICKHOUSE, LocalCH, ddl + +_A, _B, _C, _D = (f"00000000-0000-0000-0000-00000000000{i}" for i in "abcd") +_HASH = "ab" * 32 +_COLUMNS = ( + "org, namespace, agent, user_id, session_id, memory_id, memory_key, value, status, " + "sensitivity, actor, content_sha256, version" +) + + +def _row( + mid: str, + key: str, + *, + status: str = "proposed", + user: str = "-", + actor: str = "human:alice", + sensitivity: str = "", +) -> str: + return ( + f"('o', 'n', 'a', '{user}', '-', '{mid}', '{key}', 'text of {key}', '{status}', " + f"'{sensitivity}', '{actor}', '{_HASH}', 1)" + ) + + +def _memory(*rows: str) -> LocalCH: + return LocalCH(ddl("memory"), f"INSERT INTO loom.memory ({_COLUMNS}) VALUES " + ", ".join(rows)) + + +@pytest.fixture +def listing(monkeypatch: pytest.MonkeyPatch) -> Any: + """Runs the handler over `rows` under `scope`, with the reads beside the listing + (policy, graded runs, usage) answered empty.""" + + async def _policy(*_a: Any, **_k: Any) -> ProposalPolicy: + return ProposalPolicy() + + async def _empty(*_a: Any, **_k: Any) -> dict[str, Any]: + return {} + + monkeypatch.setattr(proposals, "policy_for", _policy) + monkeypatch.setattr(proposals, "graded_counts", _empty) + monkeypatch.setattr(proposals_ops, "_usage_counts", _empty) + + async def read( + rows: list[str], scope: ReadFilters = WHOLE_NAMESPACE, **asked: Any + ) -> MemoryProposalsOutput: + ch = _memory(*rows) + monkeypatch.setattr(proposals_ops, "get_client", lambda: ch) + monkeypatch.setattr(proposals_ops, "request_scope", lambda: scope) + return await proposals_ops.handle_memory_proposals( + MemoryProposalsInput(org="o", namespace="n", **asked) + ) + + return read + + +needs_clickhouse = pytest.mark.skipif(CLICKHOUSE is None, reason="clickhouse binary not installed") + + +@needs_clickhouse +async def test_the_listing_names_the_proposer(listing: Any) -> None: + out = await listing( + [ + _row(_A, "by_a_person", actor="human:alice"), + _row(_B, "by_a_pipeline", actor="process:session_contrast"), + ] + ) + assert {p.memory_key: (p.actor, p.agent) for p in out.proposals} == { + "by_a_person": ("human:alice", "a"), + "by_a_pipeline": ("process:session_contrast", "a"), + } + + +@needs_clickhouse +async def test_memory_keys_lists_only_those_pending_keys(listing: Any) -> None: + rows = [ + _row(_A, "asked"), + _row(_B, "asked_and_decided", status="active"), + _row(_C, "not_asked"), + ] + # A key named twice lists its row once. + out = await listing(rows, memory_keys=["asked", "asked_and_decided", "asked", "absent"]) + assert [(p.memory_key, p.memory_id) for p in out.proposals] == [("asked", _A)] + assert out.total == 1 + assert {p.memory_key for p in (await listing(rows)).proposals} == {"asked", "not_asked"} + # A repeated key is asked once: 500 copies of this one are longer than one parameter. + long = "k" * 400 + assert not ch_params.fits([long] * 500) + repeated = await listing([_row(_D, long)], memory_keys=[long] * 500) + assert [p.memory_key for p in repeated.proposals] == [long] + + +@needs_clickhouse +async def test_memory_keys_narrows_count_only(listing: Any) -> None: + rows = [_row(_A, "one"), _row(_B, "two"), _row(_C, "three"), _row(_D, "four", status="active")] + counted = await listing(rows, memory_keys=["one", "three", "four"], count_only=True) + assert counted.total == 2 and counted.proposals == [] + assert (await listing(rows, count_only=True)).total == 3 + + +@needs_clickhouse +async def test_a_key_outside_the_read_scope_reads_as_missing(listing: Any) -> None: + rows = [_row(_A, "mine", user="u"), _row(_B, "theirs", user="other")] + own_user = ReadFilters(scope="own_user", user_id="u", session_id=None) + listed = await listing(rows, own_user, memory_keys=["mine", "theirs"]) + assert [p.memory_key for p in listed.proposals] == ["mine"] and listed.total == 1 + # The same answer as for a key no proposal holds, in the list and in the count. + for asked in (["theirs"], ["absent"]): + out = await listing(rows, own_user, memory_keys=asked) + assert out.proposals == [] and out.total == 0 + assert (await listing(rows, own_user, memory_keys=asked, count_only=True)).total == 0 + + +@needs_clickhouse +async def test_a_high_proposal_is_listed_without_its_hash(listing: Any) -> None: + out = await listing([_row(_A, "plain"), _row(_B, "secret", sensitivity="high")]) + assert {p.memory_key: (p.content_sha256, p.value_preview) for p in out.proposals} == { + "plain": (_HASH, "text of plain"), + "secret": ("", ""), + } + + +async def test_keys_too_long_for_one_read_are_refused_before_any_read( + monkeypatch: pytest.MonkeyPatch, +) -> None: + def no_client() -> Any: + raise AssertionError("the refusal reads nothing") + + monkeypatch.setattr(proposals_ops, "get_client", no_client) + many = [f"{i:03d}" + "k" * 400 for i in range(500)] + # One key is measured too: alone, or named twice, it is the whole parameter. + one = ["k" * (ch_params.FIELD_BYTES + 1)] + for keys in (many, one, one * 2): + assert not ch_params.fits(sorted(set(keys))) + for count_only in (False, True): + asked = MemoryProposalsInput( + org="o", namespace="n", memory_keys=keys, count_only=count_only + ) + with pytest.raises(errors.ValidationError, match="memory_keys is too long"): + await proposals_ops.handle_memory_proposals(asked) + + +def test_an_empty_key_is_refused_by_the_model() -> None: + with pytest.raises(ModelError): + MemoryProposalsInput(org="o", namespace="n", memory_keys=["k", ""]) + with pytest.raises(ModelError): + MemoryProposalsInput(org="o", namespace="n", memory_keys=["k"] * 501) + assert MemoryProposalsInput(org="o", namespace="n").memory_keys == []