From edf64650638e42bface4ec7ac4d14f2253cedefa Mon Sep 17 00:00:00 2001 From: Mohammad Lareb Zafar Date: Fri, 4 Dec 2026 17:54:56 +0000 Subject: [PATCH 1/6] The Review queue opens a pending proposal by its address and names who proposed it A reviewer of proposed memory changes needs a link to one proposal, the identity that proposed it, and the complete text in front of both decisions. memory.proposals takes memory_keys (at most 500 keys) and lists only the pending proposals under them; total and count_only count the same rows. Keys that do not fit one bound parameter are refused with a 422 before any read. Each listed proposal carries actor, the identity the server recorded from the writer's token, beside agent, the label the client sent. A high row is listed with an empty content_sha256, because the list leaves no audit record and the hash of a short secret can be guessed: the hash comes with the value from memory.get_by_id, which audits that read. The Review queue's address carries its open tab (?tab=) and the proposal under review (?key=), so a link, a reload and Back reopen both. The Proposals table names each row's proposer and is one tab stop; a row's key opens its review. The review shows the proposer, the agent, when the fact was first proposed and its graded runs above the complete text, takes a reason for a rejection and holds both decisions, so neither is made without the text on screen. A rejection sends the hash served with that text and the reason; an acceptance sends that hash and no reason. Settings drops a tab value that another page wrote to the address, since both pages own that key. Co-Authored-By: Claude Fable 5.2 Signed-off-by: Mohammad Lareb Zafar --- docs/features/dashboard.md | 27 +- docs/features/memory/writing.md | 14 +- docs/guides/without-the-dashboard.md | 1 + docs/reference/operations.md | 2 +- docs/reference/operations/memory.md | 3 +- frontend/e2e/list-tables.spec.ts | 18 + frontend/src/api/review.test.ts | 41 +- frontend/src/api/review.ts | 23 +- frontend/src/lib/state.namespace.test.ts | 6 + frontend/src/lib/state.test.ts | 6 + frontend/src/lib/state.ts | 17 +- frontend/src/views/Setup.title.test.tsx | 8 + frontend/src/views/Setup.tsx | 6 +- frontend/src/views/admin/Proposals.test.tsx | 425 ++- frontend/src/views/admin/Proposals.tsx | 312 +- frontend/src/views/admin/ReviewQueue.test.tsx | 128 + frontend/src/views/admin/ReviewQueue.tsx | 89 +- sdk/go/wire/models.gen.go | 18 +- sdk/python/loom/ops.py | 3 + sdk/ruby/lib/clickhouse/loom/generated/ops.rb | 2 +- sdk/rust/src/wire_models.rs | 3132 +++++++++-------- sdk/typescript/src/generated/ops.ts | 2 + server/memory/api/models_proposals.py | 12 +- server/memory/app/proposals_ops.py | 24 +- server/transport/mcp_descriptions.py | 9 +- tests/analyzer/cases/planes.py | 8 +- tests/analyzer/shapes.txt | 6 +- tests/integration/test_proposal_triage.py | 86 + tests/unit/test_proposal_triage.py | 157 + 29 files changed, 2793 insertions(+), 1792 deletions(-) create mode 100644 tests/integration/test_proposal_triage.py create mode 100644 tests/unit/test_proposal_triage.py diff --git a/docs/features/dashboard.md b/docs/features/dashboard.md index b3465e2c7e8..0d7821098c1 100644 --- a/docs/features/dashboard.md +++ b/docs/features/dashboard.md @@ -444,17 +444,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), and duplicate memories and documents with the namespace-wide repairs. 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), and duplicate memories and documents with the namespace-wide repairs. 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 @@ -463,7 +463,10 @@ 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=` 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 b4e1cdd54db..b21f2a169c7 100644 --- a/docs/features/memory/writing.md +++ b/docs/features/memory/writing.md @@ -342,6 +342,13 @@ 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 +from the token (`human:` or `process:`), beside `agent`, the label the +writing client sent. `memory_keys` (at most 500 keys) 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 +357,12 @@ 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 opens the pending proposal +under that key. The review shows 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 d950ac1fe25..4869e479e2f 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(...)` | | 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(...)` | | Runs | `run.list`, `run.get` | `agent.run.*` | diff --git a/docs/reference/operations.md b/docs/reference/operations.md index 5e390acc2fd..4ff5538b02f 100644 --- a/docs/reference/operations.md +++ b/docs/reference/operations.md @@ -534,7 +534,7 @@ Fields for every `memory` op: [operations/memory.md](operations/memory.md). | [`memory.pin`](operations/memory.md#memorypin) | WHAT: Save a standing fact and protect it. | writer | idempotent | yes | | | [`memory.promote`](operations/memory.md#memorypromote) | Promote a single source memory to the namespace's shared layer. | admin | write | no | yes | | [`memory.proposal_decide`](operations/memory.md#memoryproposal_decide) | Accept (→ active, served by default) or reject a list of proposals. | admin | idempotent | no | yes | -| [`memory.proposals`](operations/memory.md#memoryproposals) | 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). | viewer | read | no | | +| [`memory.proposals`](operations/memory.md#memoryproposals) | List facts on trial (written with memory.set proposed=true) with who proposed each (`actor`), the graded runs that relied on it — passes, fails — and what the namespace's proposal policy says… | viewer | read | no | | | [`memory.provenance`](operations/memory.md#memoryprovenance) | Resolve a memory's origin for user-facing provenance. | viewer | read | yes | | | [`memory.recall`](operations/memory.md#memoryrecall) | Search the raw conversation turns behind this namespace's memories — the messages `memory.set_from_messages` extracted from — by text and by time. | viewer | read | yes | | | [`memory.record.conflicts`](operations/memory.md#memoryrecordconflicts) | Field-level disagreements recorded when a typed record superseded the active record for its logical key: which field, both values, both record ids and both citing memories. | viewer | read | no | | diff --git a/docs/reference/operations/memory.md b/docs/reference/operations/memory.md index df4d232941a..9fb3e85a831 100644 --- a/docs/reference/operations/memory.md +++ b/docs/reference/operations/memory.md @@ -1555,7 +1555,7 @@ Accept (→ active, served by default) or reject a list of proposals. ## `memory.proposals` -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). +List facts on trial (written with memory.set proposed=true) with who proposed each (`actor`), the graded runs that relied on it — passes, fails — and what the namespace's proposal policy says… `POST /v1/memory.proposals` · MCP `loom_memory_proposals` · role `viewer` · read · not listed under the MCP `all` toolset @@ -1565,6 +1565,7 @@ 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; 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. | diff --git a/frontend/e2e/list-tables.spec.ts b/frontend/e2e/list-tables.spec.ts index e019a216efe..1da9ae431fc 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 cf9438b7625..73579dc2ea1 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 274bc73fb7b..a7a73405498 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:`); 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 13ae7bb7660..677b7419730 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 6d60f6207af..ae51402b589 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 1b26ce00b80..18c25747a9d 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 79c8db9e0f9..fb9e4252891 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 5fdf3bb627f..07d4f61c089 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 the key 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 45de85f24b2..a26121b4f72 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,95 @@ 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.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(); +} + +/** 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,17 +129,14 @@ 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" }, - ["deploy_window"], - "accept", - { deploy_window: P.content_sha256 }, - ), + expect(api.decideProposals).toHaveBeenCalledWith(SCOPE, ["deploy_window"], "accept", { + deploy_window: P.content_sha256, + }), ); expect(await screen.findByText("No proposals")).toBeInTheDocument(); }); @@ -94,55 +146,51 @@ 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", { + 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 +199,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 +214,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 +235,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 +245,246 @@ 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, "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 () => { + 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(api.decideProposals).toHaveBeenCalledTimes(1)); + expect(vi.mocked(api.decideProposals).mock.calls[0]).toEqual([ + SCOPE, + ["deploy_window"], + "accept", + { deploy_window: P.content_sha256 }, + ]); + }); + + 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"); + 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); + }); + + 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(); + }); + + 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 5f1cc71a09f..d3a3833bf03 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,11 @@ 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); + 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 +70,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, linked = false) => { + focusPanel.current = linked; + setNotice(null); + setReason(""); setReview({ proposal }); + setViewParam("key", proposal.memory_key); try { const row = await getMemoryById(identity.org, proposal.memory_id); setReview((current) => @@ -77,6 +105,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,26 +128,70 @@ 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; + } + // One read beside the list's: the proposal may wait past the rows the list shows. + listProposals(scope, { keys: [key], signal }) + .then((r) => { + if (!live()) return; + // Matched by key here: a server a release behind answers its whole list. + const held = r.proposals.filter((p) => p.memory_key === key); + if (held.length === 1) return void openReview(held[0], true); + setReview(null); + setNotice( + held.length > 1 + ? `${held.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) => live() && 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 binds either decision to it. + const read = { [key]: review.row.content_sha256 }; setBusy(true); try { - const r = await decideProposals(scope, [key], decision, { - [key]: approvedHash, - }); + const r = + decision === "accept" + ? await decideProposals(scope, [key], decision, read) + : 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); } 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); @@ -127,17 +203,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 +237,49 @@ 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); + }} + /> + )} {error ? ( setReload((n) => n + 1)} /> ) : rows?.length === 0 ? ( @@ -173,83 +290,100 @@ 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: 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 ( + + {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 8b5aceba500..74a9647b371 100644 --- a/frontend/src/views/admin/ReviewQueue.test.tsx +++ b/frontend/src/views/admin/ReviewQueue.test.tsx @@ -78,6 +78,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}`, @@ -176,10 +179,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(); @@ -224,6 +231,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); @@ -262,6 +271,122 @@ 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("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"); @@ -273,6 +398,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(); @@ -285,6 +412,7 @@ describe("ReviewQueue", () => { expect(listMemoryDuplicates).not.toHaveBeenCalled(); expect(listDocumentDuplicates).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 784ab173863..cfe0fd1d10d 100644 --- a/frontend/src/views/admin/ReviewQueue.tsx +++ b/frontend/src/views/admin/ReviewQueue.tsx @@ -33,7 +33,7 @@ import { } from "../../api"; 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"; @@ -78,6 +78,18 @@ const QUEUE_TABS: Record = { duplicates: "Duplicates", }; +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 @@ -122,18 +134,35 @@ export function ReviewQueue() { // Shown to every role; one that cannot read them sees what it needs, and nothing is read. // No probe: the tab reads when it opens, so the page costs no read for them. const proposalsReason = callReason("memory.proposals", 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 the key 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, @@ -142,10 +171,31 @@ export function ReviewQueue() { proposals: true, duplicates: 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, + }; 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. @@ -156,10 +206,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 || []); @@ -198,7 +252,7 @@ export function ReviewQueue() { @@ -207,11 +261,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 38d05865ed4..0870354bd3a 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: f4fd37652fc51b8879bc050db7126963f79ff24c111e098d3f769f722ea1daa1 +// Registry model schema SHA-256: be6aa7850547c0d389553ca0940ff8326d48aa4537bc2a51341df477c74adb80 // Package wire contains the Go requests and responses for Loom operations. package wire @@ -7955,6 +7955,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"` @@ -7999,13 +8000,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 2875444b2f6..1ded05554e6 100644 --- a/sdk/python/loom/ops.py +++ b/sdk/python/loom/ops.py @@ -15688,6 +15688,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] @@ -15698,6 +15699,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] @@ -15714,6 +15716,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 580401db417..fdf4a02c05f 100644 --- a/sdk/ruby/lib/clickhouse/loom/generated/ops.rb +++ b/sdk/ruby/lib/clickhouse/loom/generated/ops.rb @@ -242,7 +242,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 81cdd32a0b1..a6ef1cd7028 100644 --- a/sdk/rust/src/wire_models.rs +++ b/sdk/rust/src/wire_models.rs @@ -39317,28 +39317,30 @@ pub struct MemoryProposal { #[serde(default = "default_1784")] pub agent: String, #[serde(default = "default_1785")] - pub memory_type: String, + pub actor: String, #[serde(default = "default_1786")] - pub value_preview: String, + pub memory_type: String, #[serde(default = "default_1787")] - pub sensitivity: String, + pub value_preview: String, #[serde(default = "default_1788")] - pub tags: Vec, + pub sensitivity: String, #[serde(default = "default_1789")] - pub created_at: String, + pub tags: Vec, #[serde(default = "default_1790")] - pub graded_passes: Integer, + pub created_at: String, #[serde(default = "default_1791")] - pub graded_fails: Integer, + pub graded_passes: Integer, #[serde(default = "default_1792")] - pub last_graded_at: String, + pub graded_fails: Integer, #[serde(default = "default_1793")] - pub used_count: Integer, + pub last_graded_at: String, #[serde(default = "default_1794")] - pub harm_count: Integer, + pub used_count: Integer, #[serde(default = "default_1795")] - pub ready: MemoryProposalReady, + pub harm_count: Integer, #[serde(default = "default_1796")] + pub ready: MemoryProposalReady, + #[serde(default = "default_1797")] pub conflict_with: Vec, } @@ -39354,24 +39356,24 @@ pub enum ProposalPolicyMode { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProposalPolicy { - #[serde(default = "default_1799")] - pub mode: ProposalPolicyMode, #[serde(default = "default_1800")] - pub min_passes: Integer, + pub mode: ProposalPolicyMode, #[serde(default = "default_1801")] - pub max_fails: Integer, + pub min_passes: Integer, #[serde(default = "default_1802")] + pub max_fails: Integer, + #[serde(default = "default_1803")] pub reject_after_fails: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryProposalsOutput { - #[serde(default = "default_1797")] - pub proposals: Vec, #[serde(default = "default_1798")] + pub proposals: Vec, + #[serde(default = "default_1799")] pub total: Integer, - #[serde(default = "default_1803")] + #[serde(default = "default_1804")] pub policy: ProposalPolicy, } @@ -39416,6 +39418,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, @@ -39442,6 +39450,7 @@ impl MemoryProposalsInput { namespace: None, prefix: None, tags: None, + memory_keys: None, only: None, limit: None, count_only: None, @@ -39463,6 +39472,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 @@ -39489,19 +39502,19 @@ impl MemoryProposalsInput { pub struct MemoryProvenanceLink { pub direction: String, pub memory_key: String, - #[serde(default = "default_1817")] - pub relation: String, #[serde(default = "default_1818")] - pub label: String, + pub relation: String, #[serde(default = "default_1819")] - pub explanation: String, + pub label: String, #[serde(default = "default_1820")] - pub evidence: Vec, + pub explanation: String, #[serde(default = "default_1821")] - pub confidence: f64, + pub evidence: Vec, #[serde(default = "default_1822")] - pub author: String, + pub confidence: f64, #[serde(default = "default_1823")] + pub author: String, + #[serde(default = "default_1824")] pub run_id: String, } @@ -39509,33 +39522,33 @@ pub struct MemoryProvenanceLink { #[non_exhaustive] pub struct MemoryProvenanceOutput { pub found: bool, - #[serde(default = "default_1804")] - pub source_trace: String, #[serde(default = "default_1805")] - pub source_kind: String, + pub source_trace: String, #[serde(default = "default_1806")] - pub actor: String, + pub source_kind: String, #[serde(default = "default_1807")] - pub source_class: String, + pub actor: String, #[serde(default = "default_1808")] - pub source_label: String, + pub source_class: String, #[serde(default = "default_1809")] - pub thread_id: String, + pub source_label: String, #[serde(default = "default_1810")] - pub thread_exists: bool, + pub thread_id: String, #[serde(default = "default_1811")] - pub thread_title: String, + pub thread_exists: bool, #[serde(default = "default_1812")] - pub agent: String, + pub thread_title: String, #[serde(default = "default_1813")] - pub session_id: String, + pub agent: String, #[serde(default = "default_1814")] - pub run_id: String, + pub session_id: String, #[serde(default = "default_1815")] - pub written_at: String, + pub run_id: String, #[serde(default = "default_1816")] + pub written_at: String, + #[serde(default = "default_1817")] pub source_resource_id: String, - #[serde(default = "default_1824")] + #[serde(default = "default_1825")] pub links: Vec, } @@ -39630,17 +39643,17 @@ impl MemoryProvenanceInput { pub struct RecallTurn { pub evidence_id: String, pub session_id: String, - #[serde(default = "default_1825")] - pub role: String, #[serde(default = "default_1826")] - pub actor: String, + pub role: String, #[serde(default = "default_1827")] - pub observed_at: String, + pub actor: String, #[serde(default = "default_1828")] - pub content: String, + pub observed_at: String, #[serde(default = "default_1829")] - pub truncated: bool, + pub content: String, #[serde(default = "default_1830")] + pub truncated: bool, + #[serde(default = "default_1831")] pub matched_tokens: Integer, } @@ -39657,21 +39670,21 @@ pub enum MemoryRecallOutputOrder { #[non_exhaustive] pub struct MemoryRecallOutput { pub turns: Vec, - #[serde(default = "default_1831")] - pub total_matched: Integer, #[serde(default = "default_1832")] - pub returned: Integer, + pub total_matched: Integer, #[serde(default = "default_1833")] - pub has_more: bool, + pub returned: Integer, #[serde(default = "default_1834")] - pub next_cursor: String, + pub has_more: bool, #[serde(default = "default_1835")] - pub next_offset: Integer, + pub next_cursor: String, #[serde(default = "default_1836")] - pub order: MemoryRecallOutputOrder, + pub next_offset: Integer, #[serde(default = "default_1837")] - pub query_tokens: Vec, + pub order: MemoryRecallOutputOrder, #[serde(default = "default_1838")] + pub query_tokens: Vec, + #[serde(default = "default_1839")] pub tokens_returned: Integer, } @@ -39953,19 +39966,19 @@ pub struct MemoryRecordConflictRow { pub schema_name: String, pub memory_key: String, pub field_name: String, - #[serde(default = "default_1839")] - pub prior_value: Value, #[serde(default = "default_1840")] + pub prior_value: Value, + #[serde(default = "default_1841")] pub incoming_value: Value, pub prior_record_id: String, pub incoming_record_id: String, - #[serde(default = "default_1841")] - pub prior_memory_id: String, #[serde(default = "default_1842")] - pub incoming_memory_id: String, + pub prior_memory_id: String, #[serde(default = "default_1843")] - pub detected_at: Option, + pub incoming_memory_id: String, #[serde(default = "default_1844")] + pub detected_at: Option, + #[serde(default = "default_1845")] pub resolved_at: Option, } @@ -39973,7 +39986,7 @@ pub struct MemoryRecordConflictRow { #[non_exhaustive] pub struct MemoryRecordConflictsOutput { pub rows: Vec, - #[serde(default = "default_1845")] + #[serde(default = "default_1846")] pub truncated: bool, } @@ -40083,19 +40096,19 @@ pub enum MemoryRecordRowStatus { #[non_exhaustive] pub struct MemoryRecordRow { pub record_id: String, - #[serde(default = "default_1846")] - pub memory_key: String, #[serde(default = "default_1847")] - pub memory_id: String, + pub memory_key: String, #[serde(default = "default_1848")] - pub record: std::collections::HashMap, + pub memory_id: String, #[serde(default = "default_1849")] - pub field_states: std::collections::HashMap, + pub record: std::collections::HashMap, #[serde(default = "default_1850")] - pub status: MemoryRecordRowStatus, + pub field_states: std::collections::HashMap, #[serde(default = "default_1851")] - pub valid_at: Option, + pub status: MemoryRecordRowStatus, #[serde(default = "default_1852")] + pub valid_at: Option, + #[serde(default = "default_1853")] pub valid_to: Option, } @@ -40162,7 +40175,7 @@ impl MemoryRecordHistoryInput { #[non_exhaustive] pub struct MemoryRecordQueryOutput { pub rows: Vec, - #[serde(default = "default_1853")] + #[serde(default = "default_1854")] pub truncated: bool, } @@ -40386,15 +40399,15 @@ pub enum MemoryRecordWriteOutputKeySource { pub struct MemoryRecordWriteOutput { pub record_id: String, pub field_count: Integer, - #[serde(default = "default_1854")] - pub memory_key: String, #[serde(default = "default_1855")] - pub key_source: MemoryRecordWriteOutputKeySource, + pub memory_key: String, #[serde(default = "default_1856")] - pub fold: std::collections::HashMap, + pub key_source: MemoryRecordWriteOutputKeySource, #[serde(default = "default_1857")] - pub superseded_record_id: String, + pub fold: std::collections::HashMap, #[serde(default = "default_1858")] + pub superseded_record_id: String, + #[serde(default = "default_1859")] pub conflicts: Integer, } @@ -40637,13 +40650,13 @@ impl MemoryRecordWriteInput { #[non_exhaustive] pub struct MemoryRedactOutput { pub redacted: bool, - #[serde(default = "default_1859")] - pub refused_head: bool, #[serde(default = "default_1860")] - pub redacted_at: Option, + pub refused_head: bool, #[serde(default = "default_1861")] - pub cache_rows_deleted: Integer, + pub redacted_at: Option, #[serde(default = "default_1862")] + pub cache_rows_deleted: Integer, + #[serde(default = "default_1863")] pub precedent_rows_deleted: Integer, } @@ -40803,7 +40816,7 @@ impl MemoryReindexInput { #[non_exhaustive] pub struct MemoryRejectOutput { pub rejected: bool, - #[serde(default = "default_1863")] + #[serde(default = "default_1864")] pub rejected_at: Option, } @@ -40919,7 +40932,7 @@ pub struct MemoryRelatedHit { pub struct MemoryRelatedOutput { pub results: Vec, pub source_entities: Vec, - #[serde(default = "default_1864")] + #[serde(default = "default_1865")] pub reason: String, } @@ -41034,13 +41047,13 @@ impl MemoryRelatedInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryResolveOrphanDuplicatesOutput { - #[serde(default = "default_1865")] - pub candidates: Integer, #[serde(default = "default_1866")] - pub reactivated: Integer, + pub candidates: Integer, #[serde(default = "default_1867")] - pub dry_run: bool, + pub reactivated: Integer, #[serde(default = "default_1868")] + pub dry_run: bool, + #[serde(default = "default_1869")] pub memory_ids: Vec, } @@ -41117,15 +41130,15 @@ impl MemoryResolveOrphanDuplicatesInput { #[non_exhaustive] pub struct MemoryRestoreOutput { pub restored: bool, - #[serde(default = "default_1869")] - pub memory_id: Option, #[serde(default = "default_1870")] - pub version: Option, + pub memory_id: Option, #[serde(default = "default_1871")] - pub expired: bool, + pub version: Option, #[serde(default = "default_1872")] - pub redacted: bool, + pub expired: bool, #[serde(default = "default_1873")] + pub redacted: bool, + #[serde(default = "default_1874")] pub from_status: String, } @@ -41245,13 +41258,13 @@ pub struct SearchTraceHit { pub content_excerpt: String, pub distance: f64, pub similarity: f64, - #[serde(default = "default_1874")] + #[serde(default = "default_1875")] pub entity_boost: f64, pub rank_score: f64, pub rank: Integer, - #[serde(default = "default_1875")] - pub source: String, #[serde(default = "default_1876")] + pub source: String, + #[serde(default = "default_1877")] pub parent_memory_key: String, } @@ -41261,11 +41274,11 @@ pub struct MemorySearchTraceOutput { pub results: Vec, pub embedding_model: String, pub entity_filter: Vec, - #[serde(default = "default_1877")] - pub query_spellings: std::collections::HashMap, #[serde(default = "default_1878")] - pub query_spellings_skipped: bool, + pub query_spellings: std::collections::HashMap, #[serde(default = "default_1879")] + pub query_spellings_skipped: bool, + #[serde(default = "default_1880")] pub stale_dropped: Integer, } @@ -42468,7 +42481,7 @@ pub struct SearchTraceLogRow { pub embedding_model: String, pub latency_ms: Integer, pub run_id: String, - #[serde(default = "default_1880")] + #[serde(default = "default_1881")] pub operation: String, } @@ -42577,71 +42590,71 @@ pub struct RefusedFact { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemorySetFromMessagesOutput { - #[serde(default = "default_1881")] - pub written: Vec, #[serde(default = "default_1882")] - pub refused: Vec, + pub written: Vec, #[serde(default = "default_1883")] - pub tokens_in: Integer, + pub refused: Vec, #[serde(default = "default_1884")] - pub tokens_out: Integer, + pub tokens_in: Integer, #[serde(default = "default_1885")] - pub llm_provider: String, + pub tokens_out: Integer, #[serde(default = "default_1886")] - pub llm_model: String, + pub llm_provider: String, #[serde(default = "default_1887")] - pub segments: Integer, + pub llm_model: String, #[serde(default = "default_1888")] - pub foresight: Integer, + pub segments: Integer, #[serde(default = "default_1889")] - pub forgotten: Integer, + pub foresight: Integer, #[serde(default = "default_1890")] - pub forgotten_keys: Vec, + pub forgotten: Integer, #[serde(default = "default_1891")] - pub forget_requests: Integer, + pub forgotten_keys: Vec, #[serde(default = "default_1892")] - pub about_other: Integer, + pub forget_requests: Integer, #[serde(default = "default_1893")] - pub premise_facts: Integer, + pub about_other: Integer, #[serde(default = "default_1894")] - pub learning_candidates: Integer, + pub premise_facts: Integer, #[serde(default = "default_1895")] - pub ignored_args: Vec, + pub learning_candidates: Integer, #[serde(default = "default_1896")] - pub segmenter: String, + pub ignored_args: Vec, #[serde(default = "default_1897")] - pub cached_tokens_in: Integer, + pub segmenter: String, #[serde(default = "default_1898")] - pub ontology_warnings: Vec, + pub cached_tokens_in: Integer, #[serde(default = "default_1899")] - pub evidence_ids: Vec, + pub ontology_warnings: Vec, #[serde(default = "default_1900")] - pub belief_source_links: Integer, + pub evidence_ids: Vec, #[serde(default = "default_1901")] - pub pipeline_errors: Vec, + pub belief_source_links: Integer, #[serde(default = "default_1902")] - pub value_updates_linked: Integer, + pub pipeline_errors: Vec, #[serde(default = "default_1903")] - pub stubbed_fields: Vec, + pub value_updates_linked: Integer, #[serde(default = "default_1904")] - pub degraded: Vec, + pub stubbed_fields: Vec, #[serde(default = "default_1905")] - pub deferred: bool, + pub degraded: Vec, #[serde(default = "default_1906")] - pub queue_id: String, + pub deferred: bool, #[serde(default = "default_1907")] - pub deferred_by: String, + pub queue_id: String, #[serde(default = "default_1908")] - pub stage_ms: std::collections::HashMap, + pub deferred_by: String, #[serde(default = "default_1909")] - pub observation_date_source: String, + pub stage_ms: std::collections::HashMap, #[serde(default = "default_1910")] - pub under_operator_policy: bool, + pub observation_date_source: String, #[serde(default = "default_1911")] - pub extract_prompt_keys: Vec, + pub under_operator_policy: bool, #[serde(default = "default_1912")] - pub llm_cache_hits: Integer, + pub extract_prompt_keys: Vec, #[serde(default = "default_1913")] + pub llm_cache_hits: Integer, + #[serde(default = "default_1914")] pub llm_cache_misses: Integer, } @@ -43096,22 +43109,22 @@ pub enum StackEntrySection { #[non_exhaustive] pub struct StackEntry { pub section: StackEntrySection, - #[serde(default = "default_1914")] - pub memory_key: String, #[serde(default = "default_1915")] - pub memory_type: String, + pub memory_key: String, #[serde(default = "default_1916")] + pub memory_type: String, + #[serde(default = "default_1917")] pub value: String, pub tokens: Integer, - #[serde(default = "default_1917")] - pub pinned: bool, #[serde(default = "default_1918")] - pub recall_count: Integer, + pub pinned: bool, #[serde(default = "default_1919")] - pub last_recalled_at: Option, + pub recall_count: Integer, #[serde(default = "default_1920")] - pub actor: String, + pub last_recalled_at: Option, #[serde(default = "default_1921")] + pub actor: String, + #[serde(default = "default_1922")] pub namespace: String, } @@ -43296,14 +43309,14 @@ impl MemoryStackInput { pub struct MemoryStatus { pub memory_id: String, pub status: String, - #[serde(default = "default_1922")] + #[serde(default = "default_1923")] pub superseded_by: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryStatusesOutput { - #[serde(default = "default_1923")] + #[serde(default = "default_1924")] pub rows: Vec, } @@ -43352,23 +43365,23 @@ impl MemoryStatusesInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemorySweepExpiredOutput { - #[serde(default = "default_1924")] - pub scanned: Integer, #[serde(default = "default_1925")] - pub tombstoned: Integer, + pub scanned: Integer, #[serde(default = "default_1926")] - pub demoted: Integer, + pub tombstoned: Integer, #[serde(default = "default_1927")] - pub anonymized: Integer, + pub demoted: Integer, #[serde(default = "default_1928")] - pub locked_skipped: Integer, + pub anonymized: Integer, #[serde(default = "default_1929")] - pub moved_skipped: Integer, + pub locked_skipped: Integer, #[serde(default = "default_1930")] - pub dry_run: bool, + pub moved_skipped: Integer, #[serde(default = "default_1931")] - pub sample: Vec>, + pub dry_run: bool, #[serde(default = "default_1932")] + pub sample: Vec>, + #[serde(default = "default_1933")] pub failures: Vec, } @@ -43445,10 +43458,10 @@ pub struct MemoryTimelineEntry { pub memory_key: String, pub memory_type: String, pub content_excerpt: String, - #[serde(default = "default_1933")] + #[serde(default = "default_1934")] pub valid_at: Option, pub created_at: String, - #[serde(default = "default_1934")] + #[serde(default = "default_1935")] pub namespace: String, } @@ -43456,7 +43469,7 @@ pub struct MemoryTimelineEntry { #[non_exhaustive] pub struct MemoryTimelineOutput { pub events: Vec, - #[serde(default = "default_1935")] + #[serde(default = "default_1936")] pub total_matching: Integer, } @@ -43648,9 +43661,9 @@ impl MemoryTimelineInput { pub struct MemoryTouchResult { pub memory_key: String, pub touched: bool, - #[serde(default = "default_1938")] - pub version: Option, #[serde(default = "default_1939")] + pub version: Option, + #[serde(default = "default_1940")] pub expires_at: Option, } @@ -43658,13 +43671,13 @@ pub struct MemoryTouchResult { #[non_exhaustive] pub struct MemoryTouchOutput { pub touched: bool, - #[serde(default = "default_1936")] - pub version: Option, #[serde(default = "default_1937")] + pub version: Option, + #[serde(default = "default_1938")] pub expires_at: Option, - #[serde(default = "default_1940")] - pub results: Vec, #[serde(default = "default_1941")] + pub results: Vec, + #[serde(default = "default_1942")] pub touched_count: Integer, } @@ -43844,15 +43857,15 @@ impl MemoryTouchInput { #[non_exhaustive] pub struct MemoryUnlockOutput { pub unlocked: bool, - #[serde(default = "default_1942")] - pub reason: String, #[serde(default = "default_1943")] - pub memory_id: String, + pub reason: String, #[serde(default = "default_1944")] - pub version: Option, + pub memory_id: String, #[serde(default = "default_1945")] - pub previous_mode: String, + pub version: Option, #[serde(default = "default_1946")] + pub previous_mode: String, + #[serde(default = "default_1947")] pub unlocked_by: String, } @@ -43957,11 +43970,11 @@ impl MemoryUnlockInput { #[non_exhaustive] pub struct MemoryUnpinOutput { pub unpinned: bool, - #[serde(default = "default_1947")] - pub reason: String, #[serde(default = "default_1948")] - pub memory_id: String, + pub reason: String, #[serde(default = "default_1949")] + pub memory_id: String, + #[serde(default = "default_1950")] pub version: Option, } @@ -44055,15 +44068,15 @@ impl MemoryUnpinInput { #[non_exhaustive] pub struct MemoryUpdateCandidate { pub memory_id: String, - #[serde(default = "default_1955")] - pub agent: String, #[serde(default = "default_1956")] - pub user_id: String, + pub agent: String, #[serde(default = "default_1957")] - pub session_id: String, + pub user_id: String, #[serde(default = "default_1958")] - pub version: Integer, + pub session_id: String, #[serde(default = "default_1959")] + pub version: Integer, + #[serde(default = "default_1960")] pub status: String, } @@ -44071,23 +44084,23 @@ pub struct MemoryUpdateCandidate { #[non_exhaustive] pub struct MemoryUpdateOutput { pub updated: bool, - #[serde(default = "default_1950")] - pub memory_id: String, #[serde(default = "default_1951")] - pub memory_key: String, + pub memory_id: String, #[serde(default = "default_1952")] - pub new_version: Integer, + pub memory_key: String, #[serde(default = "default_1953")] - pub content_sha256: String, + pub new_version: Integer, #[serde(default = "default_1954")] + pub content_sha256: String, + #[serde(default = "default_1955")] pub reason: String, - #[serde(default = "default_1960")] - pub candidates: Vec, #[serde(default = "default_1961")] - pub conflict_verdict: String, + pub candidates: Vec, #[serde(default = "default_1962")] - pub conflict_peers: Integer, + pub conflict_verdict: String, #[serde(default = "default_1963")] + pub conflict_peers: Integer, + #[serde(default = "default_1964")] pub duplicate_of: String, } @@ -44296,15 +44309,15 @@ impl MemoryUpdateInput { #[non_exhaustive] pub struct MemoryUpdateByIdOutput { pub updated: bool, - #[serde(default = "default_1964")] - pub new_version: Integer, #[serde(default = "default_1965")] - pub content_sha256: String, + pub new_version: Integer, #[serde(default = "default_1966")] - pub conflict_verdict: String, + pub content_sha256: String, #[serde(default = "default_1967")] - pub conflict_peers: Integer, + pub conflict_verdict: String, #[serde(default = "default_1968")] + pub conflict_peers: Integer, + #[serde(default = "default_1969")] pub duplicate_of: String, } @@ -44432,23 +44445,23 @@ impl MemoryUpdateByIdInput { #[non_exhaustive] pub struct MemoryVerifyOutput { pub found: bool, - #[serde(default = "default_1969")] - pub changed: bool, #[serde(default = "default_1970")] - pub memory_id: String, + pub changed: bool, #[serde(default = "default_1971")] - pub memory_key: String, + pub memory_id: String, #[serde(default = "default_1972")] - pub namespace: String, + pub memory_key: String, #[serde(default = "default_1973")] - pub verified_by: String, + pub namespace: String, #[serde(default = "default_1974")] - pub verified_at: Option, + pub verified_by: String, #[serde(default = "default_1975")] - pub verification: String, + pub verified_at: Option, #[serde(default = "default_1976")] - pub version: Integer, + pub verification: String, #[serde(default = "default_1977")] + pub version: Integer, + #[serde(default = "default_1978")] pub content_sha256: String, } @@ -44653,13 +44666,13 @@ pub struct SchemaFieldOutput { #[serde(rename = "type")] pub r#type: String, pub required: bool, - #[serde(default = "default_1980")] - pub identity: bool, #[serde(default = "default_1981")] - pub enum_values: Vec, + pub identity: bool, #[serde(default = "default_1982")] - pub constraints: std::collections::HashMap, + pub enum_values: Vec, #[serde(default = "default_1983")] + pub constraints: std::collections::HashMap, + #[serde(default = "default_1984")] pub description: String, } @@ -44668,11 +44681,11 @@ pub struct SchemaFieldOutput { pub struct MemorySchemaSummary { pub schema_id: String, pub name: String, - #[serde(default = "default_1978")] - pub description: String, #[serde(default = "default_1979")] + pub description: String, + #[serde(default = "default_1980")] pub status: String, - #[serde(default = "default_1984")] + #[serde(default = "default_1985")] pub fields: Vec, } @@ -45087,13 +45100,13 @@ impl MemorySchemaRegisterInput { #[non_exhaustive] pub struct MentorPlane { pub plane: String, - #[serde(default = "default_1986")] - pub calls: Integer, #[serde(default = "default_1987")] - pub available: Option, + pub calls: Integer, #[serde(default = "default_1988")] - pub when: String, + pub available: Option, #[serde(default = "default_1989")] + pub when: String, + #[serde(default = "default_1990")] pub mentored: bool, } @@ -45103,11 +45116,11 @@ pub struct MentorHint { pub code: String, pub severity: String, pub text: String, - #[serde(default = "default_1991")] - pub ops: Vec, #[serde(default = "default_1992")] - pub evidence: std::collections::HashMap, + pub ops: Vec, #[serde(default = "default_1993")] + pub evidence: std::collections::HashMap, + #[serde(default = "default_1994")] pub plane: Option, } @@ -45115,9 +45128,9 @@ pub struct MentorHint { #[non_exhaustive] pub struct MentorAdoption { pub code: String, - #[serde(default = "default_1995")] - pub shown_sessions: Integer, #[serde(default = "default_1996")] + pub shown_sessions: Integer, + #[serde(default = "default_1997")] pub followed_sessions: Integer, } @@ -45153,7 +45166,7 @@ pub enum UsageRungSource { #[non_exhaustive] pub struct UsageRung { pub rung: UsageRungRung, - #[serde(default = "default_1998")] + #[serde(default = "default_1999")] pub count: Option, pub source: UsageRungSource, pub meaning: String, @@ -45168,27 +45181,27 @@ pub struct MentorBriefOutput { pub window_seconds: Integer, pub computed_at: String, pub sessions: Integer, - #[serde(default = "default_1985")] + #[serde(default = "default_1986")] pub usage: std::collections::HashMap, - #[serde(default = "default_1990")] + #[serde(default = "default_1991")] pub planes: Vec, - #[serde(default = "default_1994")] + #[serde(default = "default_1995")] pub hints: Vec, - #[serde(default = "default_1997")] + #[serde(default = "default_1998")] pub adoption: Vec, - #[serde(default = "default_1999")] - pub usage_evidence: Vec, #[serde(default = "default_2000")] - pub ledger_from: Option, + pub usage_evidence: Vec, #[serde(default = "default_2001")] - pub ledger_retention_days: Option, + pub ledger_from: Option, #[serde(default = "default_2002")] - pub agents: Vec, + pub ledger_retention_days: Option, #[serde(default = "default_2003")] - pub agent_defaulted: bool, + pub agents: Vec, #[serde(default = "default_2004")] - pub skipped: Vec, + pub agent_defaulted: bool, #[serde(default = "default_2005")] + pub skipped: Vec, + #[serde(default = "default_2006")] pub healthy: bool, } @@ -45337,33 +45350,33 @@ impl MentorGuideInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct NamespaceAuditSummary { - #[serde(default = "default_2006")] - pub live_rows: Integer, #[serde(default = "default_2007")] - pub live_bytes: Integer, + pub live_rows: Integer, #[serde(default = "default_2008")] - pub excerpt_bytes: Integer, + pub live_bytes: Integer, #[serde(default = "default_2009")] - pub version_rows: Integer, + pub excerpt_bytes: Integer, #[serde(default = "default_2010")] - pub version_bytes: Integer, + pub version_rows: Integer, #[serde(default = "default_2011")] - pub unembedded_rows: Integer, + pub version_bytes: Integer, #[serde(default = "default_2012")] - pub gets: Integer, + pub unembedded_rows: Integer, #[serde(default = "default_2013")] - pub searches: Integer, + pub gets: Integer, #[serde(default = "default_2014")] - pub sets: Integer, + pub searches: Integer, #[serde(default = "default_2015")] - pub get_search_ratio: f64, + pub sets: Integer, #[serde(default = "default_2016")] - pub inspector_calls: Integer, + pub get_search_ratio: f64, #[serde(default = "default_2017")] - pub typed_gets: Integer, + pub inspector_calls: Integer, #[serde(default = "default_2018")] - pub written_in_window: Integer, + pub typed_gets: Integer, #[serde(default = "default_2019")] + pub written_in_window: Integer, + #[serde(default = "default_2020")] pub ledger_calls: Integer, } @@ -45395,25 +45408,25 @@ pub struct NamespaceAuditFinding { pub kind: NamespaceAuditFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_2020")] - pub window_seconds: Option, #[serde(default = "default_2021")] + pub window_seconds: Option, + #[serde(default = "default_2022")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_2022")] - pub evidence: Vec, #[serde(default = "default_2023")] - pub exceptions: String, + pub evidence: Vec, #[serde(default = "default_2024")] + pub exceptions: String, + #[serde(default = "default_2025")] pub uncertainty: String, pub code: String, pub severity: NamespaceAuditFindingSeverity, pub count: Integer, pub share: f64, - #[serde(default = "default_2025")] - pub bytes: Integer, #[serde(default = "default_2026")] + pub bytes: Integer, + #[serde(default = "default_2027")] pub samples: Vec>, pub detail: String, pub remedy: String, @@ -45428,7 +45441,7 @@ pub struct NamespaceAuditOutput { pub window_seconds: Integer, pub summary: NamespaceAuditSummary, pub findings: Vec, - #[serde(default = "default_2027")] + #[serde(default = "default_2028")] pub skipped: Vec, pub coverage: ReportCoverage, pub healthy: bool, @@ -45519,29 +45532,29 @@ pub enum BrowseEntryMyStatus { #[non_exhaustive] pub struct BrowseEntry { pub namespace: String, - #[serde(default = "default_2028")] + #[serde(default = "default_2029")] pub kind: String, pub description: String, pub owner_email: String, pub member_count: Integer, - #[serde(default = "default_2029")] + #[serde(default = "default_2030")] pub requires_approval: bool, pub created_at: String, - #[serde(default = "default_2030")] - pub join_policy: String, #[serde(default = "default_2031")] - pub visibility: String, + pub join_policy: String, #[serde(default = "default_2032")] - pub my_status: BrowseEntryMyStatus, + pub visibility: String, #[serde(default = "default_2033")] - pub my_role: String, + pub my_status: BrowseEntryMyStatus, #[serde(default = "default_2034")] - pub repo: String, + pub my_role: String, #[serde(default = "default_2035")] - pub branch: String, + pub repo: String, #[serde(default = "default_2036")] - pub guide_revision: Integer, + pub branch: String, #[serde(default = "default_2037")] + pub guide_revision: Integer, + #[serde(default = "default_2038")] pub guide_summary: String, } @@ -45645,9 +45658,9 @@ pub enum NamespaceCancelRequestOutputClearedRole { pub struct NamespaceCancelRequestOutput { pub cancelled: bool, pub namespace: String, - #[serde(default = "default_2038")] - pub cleared_role: Option, #[serde(default = "default_2039")] + pub cleared_role: Option, + #[serde(default = "default_2040")] pub cancelled_at: Option, } @@ -45719,7 +45732,7 @@ pub struct NamespaceDeleteOutput { pub deleted: bool, pub namespace: String, pub updated_at: String, - #[serde(default = "default_2040")] + #[serde(default = "default_2041")] pub sources_retired: Vec, } @@ -45788,67 +45801,67 @@ pub enum NamespaceGetOutputClassification { pub struct NamespaceGetOutput { pub found: bool, pub namespace: String, - #[serde(default = "default_2041")] - pub kind: Option, #[serde(default = "default_2042")] - pub owner_email: Option, + pub kind: Option, #[serde(default = "default_2043")] - pub description: Option, + pub owner_email: Option, #[serde(default = "default_2044")] - pub tags: Option>, + pub description: Option, #[serde(default = "default_2045")] - pub active: Option, + pub tags: Option>, #[serde(default = "default_2046")] - pub conversation_logging_enabled: Option, + pub active: Option, #[serde(default = "default_2047")] - pub capture_generation_io: Option, + pub conversation_logging_enabled: Option, #[serde(default = "default_2048")] - pub coverage_sweep: Option, + pub capture_generation_io: Option, #[serde(default = "default_2049")] - pub consolidation_enabled: Option, + pub coverage_sweep: Option, #[serde(default = "default_2050")] - pub daily_cost_cap_usd: Option, + pub consolidation_enabled: Option, #[serde(default = "default_2051")] - pub daily_user_cost_cap_usd: Option, + pub daily_cost_cap_usd: Option, #[serde(default = "default_2052")] - pub budget_alert_inbox: Option, + pub daily_user_cost_cap_usd: Option, #[serde(default = "default_2053")] - pub conflict_threshold: Option, + pub budget_alert_inbox: Option, #[serde(default = "default_2054")] - pub retention_days: Option, + pub conflict_threshold: Option, #[serde(default = "default_2055")] - pub warm_days: Option, + pub retention_days: Option, #[serde(default = "default_2056")] - pub visibility: Option, + pub warm_days: Option, #[serde(default = "default_2057")] - pub requires_approval: Option, + pub visibility: Option, #[serde(default = "default_2058")] - pub join_policy: Option, + pub requires_approval: Option, #[serde(default = "default_2059")] - pub effective_join_policy: Option, + pub join_policy: Option, #[serde(default = "default_2060")] - pub retrieval_defaults: Option>, + pub effective_join_policy: Option, #[serde(default = "default_2061")] - pub rerank_endpoint: Option, + pub retrieval_defaults: Option>, #[serde(default = "default_2062")] - pub classify_endpoint: Option, + pub rerank_endpoint: Option, #[serde(default = "default_2063")] - pub default_conflict_policy: Option, + pub classify_endpoint: Option, #[serde(default = "default_2064")] - pub proposal_policy: Option, + pub default_conflict_policy: Option, #[serde(default = "default_2065")] - pub code_change_policy: Option, + pub proposal_policy: Option, #[serde(default = "default_2066")] - pub tag_registry: Option>>, + pub code_change_policy: Option, #[serde(default = "default_2067")] - pub classification: Option, + pub tag_registry: Option>>, #[serde(default = "default_2068")] - pub guide_revision: Option, + pub classification: Option, #[serde(default = "default_2069")] - pub guide_summary: Option, + pub guide_revision: Option, #[serde(default = "default_2070")] - pub created_at: Option, + pub guide_summary: Option, #[serde(default = "default_2071")] + pub created_at: Option, + #[serde(default = "default_2072")] pub updated_at: Option, } @@ -45901,17 +45914,17 @@ impl NamespaceGetInput { #[non_exhaustive] pub struct NamespaceGuideGetOutput { pub found: bool, - #[serde(default = "default_2072")] - pub revision: Integer, #[serde(default = "default_2073")] - pub content: String, + pub revision: Integer, #[serde(default = "default_2074")] - pub summary: String, + pub content: String, #[serde(default = "default_2075")] - pub note: String, + pub summary: String, #[serde(default = "default_2076")] - pub updated_by: String, + pub note: String, #[serde(default = "default_2077")] + pub updated_by: String, + #[serde(default = "default_2078")] pub updated_at: Option, } @@ -46048,17 +46061,17 @@ impl NamespaceGuideHistoryInput { #[non_exhaustive] pub struct NamespaceGuideSetOutputNamespaceGuideGetOutput { pub found: bool, - #[serde(default = "default_2079")] - pub revision: Integer, #[serde(default = "default_2080")] - pub content: String, + pub revision: Integer, #[serde(default = "default_2081")] - pub summary: String, + pub content: String, #[serde(default = "default_2082")] - pub note: String, + pub summary: String, #[serde(default = "default_2083")] - pub updated_by: String, + pub note: String, #[serde(default = "default_2084")] + pub updated_by: String, + #[serde(default = "default_2085")] pub updated_at: Option, } @@ -46066,10 +46079,10 @@ pub struct NamespaceGuideSetOutputNamespaceGuideGetOutput { #[non_exhaustive] pub struct NamespaceGuideSetOutput { pub written: bool, - #[serde(default = "default_2078")] + #[serde(default = "default_2079")] pub conflict: bool, pub revision: Integer, - #[serde(default = "default_2085")] + #[serde(default = "default_2086")] pub current: Option, } @@ -46190,7 +46203,7 @@ pub struct InventorySection { #[serde(deserialize_with = "required_nullable")] pub latest_at: Option, pub complete: bool, - #[serde(default = "default_2086")] + #[serde(default = "default_2087")] pub reason: String, } @@ -46220,10 +46233,10 @@ pub struct InventoryPopulation { pub population: InventoryPopulationPopulation, #[serde(deserialize_with = "required_nullable")] pub total: Option, - #[serde(default = "default_2087")] + #[serde(default = "default_2088")] pub top: Vec, pub complete: bool, - #[serde(default = "default_2088")] + #[serde(default = "default_2089")] pub reason: String, } @@ -46389,11 +46402,11 @@ pub struct NamespaceJoinOutput { pub joined: bool, pub namespace: String, pub role: NamespaceJoinOutputRole, - #[serde(default = "default_2089")] - pub status: String, #[serde(default = "default_2090")] - pub requested_role: Option, + pub status: String, #[serde(default = "default_2091")] + pub requested_role: Option, + #[serde(default = "default_2092")] pub pending_admins: Vec, pub joined_at: String, } @@ -46485,7 +46498,7 @@ impl NamespaceJoinInput { pub struct NamespaceLeaveOutput { pub left: bool, pub namespace: String, - #[serde(default = "default_2092")] + #[serde(default = "default_2093")] pub left_at: Option, } @@ -46562,27 +46575,27 @@ pub enum NamespaceEntryVisibility { #[non_exhaustive] pub struct NamespaceEntry { pub namespace: String, - #[serde(default = "default_2093")] + #[serde(default = "default_2094")] pub kind: String, pub owner_email: String, pub description: String, pub tags: Vec, pub active: bool, - #[serde(default = "default_2094")] - pub consolidation_enabled: bool, #[serde(default = "default_2095")] - pub daily_cost_cap_usd: f64, + pub consolidation_enabled: bool, #[serde(default = "default_2096")] - pub daily_user_cost_cap_usd: f64, + pub daily_cost_cap_usd: f64, #[serde(default = "default_2097")] - pub budget_alert_inbox: String, + pub daily_user_cost_cap_usd: f64, #[serde(default = "default_2098")] - pub conflict_threshold: Option, + pub budget_alert_inbox: String, #[serde(default = "default_2099")] - pub retention_days: Integer, + pub conflict_threshold: Option, #[serde(default = "default_2100")] - pub warm_days: Integer, + pub retention_days: Integer, #[serde(default = "default_2101")] + pub warm_days: Integer, + #[serde(default = "default_2102")] pub visibility: NamespaceEntryVisibility, pub created_at: String, pub updated_at: String, @@ -46737,27 +46750,27 @@ pub enum MineEntryVisibility { pub struct MineEntry { pub namespace: String, pub role: String, - #[serde(default = "default_2102")] - pub status: String, #[serde(default = "default_2103")] - pub pending_role: Option, + pub status: String, #[serde(default = "default_2104")] - pub pending_since: Option, + pub pending_role: Option, #[serde(default = "default_2105")] - pub pending_admins: Vec, + pub pending_since: Option, #[serde(default = "default_2106")] - pub visibility: MineEntryVisibility, + pub pending_admins: Vec, #[serde(default = "default_2107")] - pub kind: String, + pub visibility: MineEntryVisibility, #[serde(default = "default_2108")] - pub title: String, + pub kind: String, #[serde(default = "default_2109")] - pub description: String, + pub title: String, #[serde(default = "default_2110")] - pub joined_at: Option, + pub description: String, #[serde(default = "default_2111")] - pub is_new: bool, + pub joined_at: Option, #[serde(default = "default_2112")] + pub is_new: bool, + #[serde(default = "default_2113")] pub inherited: bool, } @@ -46823,7 +46836,7 @@ pub struct OntologyEntry { pub name: String, pub status: String, pub description: String, - #[serde(default = "default_2113")] + #[serde(default = "default_2114")] pub cardinality: String, pub created_by: String, pub updated_at: String, @@ -47016,7 +47029,7 @@ pub struct NamespaceRegisterOutput { pub registered: bool, pub namespace: String, pub updated_at: String, - #[serde(default = "default_2114")] + #[serde(default = "default_2115")] pub visibility: NamespaceRegisterOutputVisibility, } @@ -48096,7 +48109,7 @@ impl NamespaceRegisterOntologyInput { #[non_exhaustive] pub struct NamespaceRestoreOutput { pub restored: bool, - #[serde(default = "default_2115")] + #[serde(default = "default_2116")] pub publication_pending: bool, pub target_namespace: String, pub snapshot_id: String, @@ -48983,15 +48996,15 @@ pub struct NamespaceRollbackOutput { pub version_at: Integer, pub reinstate: Integer, pub remove: Integer, - #[serde(default = "default_2116")] - pub skipped_no_head: Integer, #[serde(default = "default_2117")] - pub skipped_already_gone: Integer, + pub skipped_no_head: Integer, #[serde(default = "default_2118")] - pub truncated: bool, + pub skipped_already_gone: Integer, #[serde(default = "default_2119")] - pub sample: Vec>, + pub truncated: bool, #[serde(default = "default_2120")] + pub sample: Vec>, + #[serde(default = "default_2121")] pub applied_at: Option, } @@ -49170,101 +49183,101 @@ pub struct NamespaceSnapshotOutputSnapshotMemoryRow { pub confidence: f64, pub source_trace: String, pub pinned: bool, - #[serde(default = "default_2121")] - pub expires_at: Option, #[serde(default = "default_2122")] - pub entities: Vec, + pub expires_at: Option, #[serde(default = "default_2123")] - pub version: Integer, + pub entities: Vec, #[serde(default = "default_2124")] - pub content_sha256: String, + pub version: Integer, #[serde(default = "default_2125")] - pub actor: String, + pub content_sha256: String, #[serde(default = "default_2126")] - pub source_class: String, + pub actor: String, #[serde(default = "default_2127")] - pub source_resource_id: String, + pub source_class: String, #[serde(default = "default_2128")] - pub verified_by: String, + pub source_resource_id: String, #[serde(default = "default_2129")] - pub verified_at: Option, + pub verified_by: String, #[serde(default = "default_2130")] - pub verified_sha256: String, + pub verified_at: Option, #[serde(default = "default_2131")] - pub grounding: String, + pub verified_sha256: String, #[serde(default = "default_2132")] - pub evidence: String, + pub grounding: String, #[serde(default = "default_2133")] - pub tags: Vec, + pub evidence: String, #[serde(default = "default_2134")] - pub valid_at: Option, + pub tags: Vec, #[serde(default = "default_2135")] - pub valid_to: Option, + pub valid_at: Option, #[serde(default = "default_2136")] - pub created_at: Option, + pub valid_to: Option, #[serde(default = "default_2137")] - pub updated_at: Option, + pub created_at: Option, #[serde(default = "default_2138")] - pub value_json: String, + pub updated_at: Option, #[serde(default = "default_2139")] - pub status: NamespaceSnapshotOutputSnapshotMemoryRowStatus, + pub value_json: String, #[serde(default = "default_2140")] - pub requires_review: Option, + pub status: NamespaceSnapshotOutputSnapshotMemoryRowStatus, #[serde(default = "default_2141")] - pub conflict_with: Vec, + pub requires_review: Option, #[serde(default = "default_2142")] - pub duplicate_of: String, + pub conflict_with: Vec, #[serde(default = "default_2143")] - pub evidence_count: Integer, + pub duplicate_of: String, #[serde(default = "default_2144")] - pub recall_count: Integer, + pub evidence_count: Integer, #[serde(default = "default_2145")] - pub last_recalled_at: Option, + pub recall_count: Integer, #[serde(default = "default_2146")] - pub cross_promoted_from_memory_id: String, + pub last_recalled_at: Option, #[serde(default = "default_2147")] - pub cross_promoted_from_namespace: String, + pub cross_promoted_from_memory_id: String, #[serde(default = "default_2148")] - pub superseded_by: String, + pub cross_promoted_from_namespace: String, #[serde(default = "default_2149")] - pub rejection_reason: String, + pub superseded_by: String, #[serde(default = "default_2150")] - pub temporal_anchor: Option, + pub rejection_reason: String, #[serde(default = "default_2151")] - pub temporal_confidence: f64, + pub temporal_anchor: Option, #[serde(default = "default_2152")] - pub invalid_at: Option, + pub temporal_confidence: f64, #[serde(default = "default_2153")] - pub char_limit: Option, + pub invalid_at: Option, #[serde(default = "default_2154")] - pub reinforcement_count: Integer, + pub char_limit: Option, #[serde(default = "default_2155")] - pub last_reinforced_at: Option, + pub reinforcement_count: Integer, #[serde(default = "default_2156")] - pub mentioned_at: Option, + pub last_reinforced_at: Option, #[serde(default = "default_2157")] - pub sensitivity: String, + pub mentioned_at: Option, #[serde(default = "default_2158")] - pub redacted_at: Option, + pub sensitivity: String, #[serde(default = "default_2159")] - pub redaction_reason: String, + pub redacted_at: Option, #[serde(default = "default_2160")] - pub lock_mode: String, + pub redaction_reason: String, #[serde(default = "default_2161")] - pub lock_reason: String, + pub lock_mode: String, #[serde(default = "default_2162")] - pub lock_until: Option, + pub lock_reason: String, #[serde(default = "default_2163")] - pub locked_by: String, + pub lock_until: Option, #[serde(default = "default_2164")] - pub locked_at: Option, + pub locked_by: String, #[serde(default = "default_2165")] - pub on_expire: String, + pub locked_at: Option, #[serde(default = "default_2166")] - pub expire_reason: String, + pub on_expire: String, #[serde(default = "default_2167")] - pub files: Vec, + pub expire_reason: String, #[serde(default = "default_2168")] + pub files: Vec, + #[serde(default = "default_2169")] pub concepts: Vec, } @@ -49273,11 +49286,11 @@ pub struct NamespaceSnapshotOutputSnapshotMemoryRow { pub struct NamespaceSnapshotOutputSnapshotTypeRow { pub memory_type: String, pub retention_days: Integer, - #[serde(default = "default_2169")] - pub dedup_threshold: Option, #[serde(default = "default_2170")] - pub hot_quota: Integer, + pub dedup_threshold: Option, #[serde(default = "default_2171")] + pub hot_quota: Integer, + #[serde(default = "default_2172")] pub conflict_policy: String, } @@ -49492,7 +49505,7 @@ pub struct TaxonomyCommunity { pub community_id: Integer, pub label: String, pub size: Integer, - #[serde(default = "default_2172")] + #[serde(default = "default_2173")] pub top_entities: Vec, } @@ -49503,9 +49516,9 @@ pub struct NamespaceTaxonomyOutput { pub entities: Vec, pub memory_count: Integer, pub memory_types: Vec, - #[serde(default = "default_2173")] - pub communities: Vec, #[serde(default = "default_2174")] + pub communities: Vec, + #[serde(default = "default_2175")] pub communities_computed_at: String, } @@ -49605,15 +49618,15 @@ pub enum TuneProposalTarget { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TuneEvidence { - #[serde(default = "default_2176")] - pub finding_codes: Vec, #[serde(default = "default_2177")] - pub supporting_count: Integer, + pub finding_codes: Vec, #[serde(default = "default_2178")] - pub supporting: Vec, + pub supporting_count: Integer, #[serde(default = "default_2179")] - pub counter_count: Option, + pub supporting: Vec, #[serde(default = "default_2180")] + pub counter_count: Option, + #[serde(default = "default_2181")] pub documents: Vec, } @@ -49639,10 +49652,10 @@ pub enum TuneApplyVia { #[non_exhaustive] pub struct TuneApply { pub op: String, - #[serde(default = "default_2184")] + #[serde(default = "default_2185")] pub via: TuneApplyVia, pub args: std::collections::HashMap, - #[serde(default = "default_2185")] + #[serde(default = "default_2186")] pub args_complete: bool, pub required_role: String, pub guard: String, @@ -49661,7 +49674,7 @@ pub struct ChunkStats { pub sections: Integer, pub sections_cut: Integer, pub max_input_tokens: Integer, - #[serde(default = "default_2187")] + #[serde(default = "default_2188")] pub over_input_limit: Option, } @@ -49681,25 +49694,25 @@ pub struct TuneProposal { pub title: String, pub rationale: String, pub current: String, - #[serde(default = "default_2175")] + #[serde(default = "default_2176")] pub current_revision: Option, pub proposed: String, pub evidence: TuneEvidence, - #[serde(default = "default_2181")] - pub affected_agents: Vec, #[serde(default = "default_2182")] - pub affected_agents_total: Option, + pub affected_agents: Vec, #[serde(default = "default_2183")] + pub affected_agents_total: Option, + #[serde(default = "default_2184")] pub effect: TuneProposalEffect, pub historical: String, pub apply: TuneApply, - #[serde(default = "default_2186")] + #[serde(default = "default_2187")] pub apply_also: Vec, - #[serde(default = "default_2188")] - pub preview: Option, #[serde(default = "default_2189")] - pub limits: String, + pub preview: Option, #[serde(default = "default_2190")] + pub limits: String, + #[serde(default = "default_2191")] pub refs: Vec, } @@ -49707,13 +49720,13 @@ pub struct TuneProposal { #[non_exhaustive] pub struct ChunkingSample { pub cap: Integer, - #[serde(default = "default_2196")] + #[serde(default = "default_2197")] pub population: Option, pub documents: Integer, pub unread: Integer, pub load_cap: Integer, pub embedder_model: String, - #[serde(default = "default_2197")] + #[serde(default = "default_2198")] pub input_token_limit: Option, pub current: ChunkStats, } @@ -49724,21 +49737,21 @@ pub struct NamespaceTuneOutput { pub org: String, pub namespace: String, pub computed_at: String, - #[serde(default = "default_2191")] - pub proposals: Vec, #[serde(default = "default_2192")] - pub guide_revision: Option, + pub proposals: Vec, #[serde(default = "default_2193")] - pub categories_registered: Option, + pub guide_revision: Option, #[serde(default = "default_2194")] - pub extraction_policy: Option, + pub categories_registered: Option, #[serde(default = "default_2195")] + pub extraction_policy: Option, + #[serde(default = "default_2196")] pub extraction_policy_unavailable: String, - #[serde(default = "default_2198")] - pub chunking: Option, #[serde(default = "default_2199")] - pub skipped: Vec, + pub chunking: Option, #[serde(default = "default_2200")] + pub skipped: Vec, + #[serde(default = "default_2201")] pub model_used: bool, } @@ -49859,25 +49872,25 @@ pub struct NamespaceValidateFinding { pub kind: NamespaceValidateFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_2201")] - pub window_seconds: Option, #[serde(default = "default_2202")] + pub window_seconds: Option, + #[serde(default = "default_2203")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_2203")] - pub evidence: Vec, #[serde(default = "default_2204")] - pub exceptions: String, + pub evidence: Vec, #[serde(default = "default_2205")] + pub exceptions: String, + #[serde(default = "default_2206")] pub uncertainty: String, pub check: String, pub severity: NamespaceValidateFindingSeverity, pub count: Integer, - #[serde(default = "default_2206")] + #[serde(default = "default_2207")] pub samples: Vec>, pub detail: String, - #[serde(default = "default_2207")] + #[serde(default = "default_2208")] pub totals: std::collections::HashMap, } @@ -49891,9 +49904,9 @@ pub struct NamespaceValidateOutput { pub warnings: Integer, pub infos: Integer, pub findings: Vec, - #[serde(default = "default_2208")] - pub skipped: Vec, #[serde(default = "default_2209")] + pub skipped: Vec, + #[serde(default = "default_2210")] pub keys_scoped: Integer, pub coverage: ReportCoverage, pub checked_at: String, @@ -50013,9 +50026,9 @@ impl NamespaceValidateInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ObserveCrystallizeOutput { - #[serde(default = "default_2210")] - pub enqueued: Integer, #[serde(default = "default_2211")] + pub enqueued: Integer, + #[serde(default = "default_2212")] pub session_id: String, } @@ -50112,23 +50125,23 @@ impl ObserveCrystallizeInput { #[non_exhaustive] pub struct ObserveRecordOutput { pub memory_key: String, - #[serde(default = "default_2212")] - pub memory_id: String, #[serde(default = "default_2213")] - pub kind: String, + pub memory_id: String, #[serde(default = "default_2214")] - pub tags: Vec, + pub kind: String, #[serde(default = "default_2215")] - pub file_paths: Vec, + pub tags: Vec, #[serde(default = "default_2216")] - pub content_sha256: String, + pub file_paths: Vec, #[serde(default = "default_2217")] - pub tool_name: String, + pub content_sha256: String, #[serde(default = "default_2218")] - pub has_error: bool, + pub tool_name: String, #[serde(default = "default_2219")] - pub narrative_chars: Integer, + pub has_error: bool, #[serde(default = "default_2220")] + pub narrative_chars: Integer, + #[serde(default = "default_2221")] pub skipped_reason: String, } @@ -50359,7 +50372,7 @@ pub struct OpsIncident { pub subject: String, pub severity: OpsIncidentSeverity, pub detail: String, - #[serde(default = "default_2221")] + #[serde(default = "default_2222")] pub age_s: Option, } @@ -50378,7 +50391,7 @@ pub enum OpsIncidentsOutputRequests { #[non_exhaustive] pub struct OpsIncidentsOutput { pub status: OpsIncidentsOutputStatus, - #[serde(default = "default_2222")] + #[serde(default = "default_2223")] pub incidents: Vec, pub window_minutes: Integer, pub requests: OpsIncidentsOutputRequests, @@ -50422,26 +50435,26 @@ pub struct ProjectionFailureRow { pub failure_id: String, pub org: String, pub namespace: String, - #[serde(default = "default_2223")] + #[serde(default = "default_2224")] pub agent: String, pub projection: String, - #[serde(default = "default_2224")] - pub source_operation: String, #[serde(default = "default_2225")] - pub source_resource_id: String, + pub source_operation: String, #[serde(default = "default_2226")] - pub memory_keys: Vec, + pub source_resource_id: String, #[serde(default = "default_2227")] - pub error_type: String, + pub memory_keys: Vec, #[serde(default = "default_2228")] - pub error_message: String, + pub error_type: String, #[serde(default = "default_2229")] - pub payload: std::collections::HashMap, + pub error_message: String, #[serde(default = "default_2230")] - pub status: String, + pub payload: std::collections::HashMap, #[serde(default = "default_2231")] - pub created_at: Option, + pub status: String, #[serde(default = "default_2232")] + pub created_at: Option, + #[serde(default = "default_2233")] pub resolved_at: Option, } @@ -50595,22 +50608,22 @@ pub struct ProjectionFailureRetryRow { pub projection: String, pub retried: bool, pub resolved: bool, - #[serde(default = "default_2233")] - pub abandoned: bool, #[serde(default = "default_2234")] - pub reason: String, + pub abandoned: bool, #[serde(default = "default_2235")] + pub reason: String, + #[serde(default = "default_2236")] pub error: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProjectionFailureRetryOutput { - #[serde(default = "default_2236")] + #[serde(default = "default_2237")] pub results: Vec, pub retried: Integer, pub resolved: Integer, - #[serde(default = "default_2237")] + #[serde(default = "default_2238")] pub abandoned: Integer, } @@ -50692,15 +50705,15 @@ impl ProjectionFailureRetryInput { pub struct OrgModelCallsOutput { pub org: String, pub enabled: bool, - #[serde(default = "default_2238")] - pub reason: String, #[serde(default = "default_2239")] - pub updated_by: String, + pub reason: String, #[serde(default = "default_2240")] - pub updated_at: Option, + pub updated_by: String, #[serde(default = "default_2241")] - pub locked: bool, + pub updated_at: Option, #[serde(default = "default_2242")] + pub locked: bool, + #[serde(default = "default_2243")] pub locked_by: String, } @@ -51039,7 +51052,7 @@ impl PolicyDecisionsInput { #[non_exhaustive] pub struct PolicyDeleteOutput { pub removed: bool, - #[serde(default = "default_2243")] + #[serde(default = "default_2244")] pub widening: bool, } @@ -51105,12 +51118,12 @@ pub struct PolicyRuleOut { pub condition: std::collections::HashMap, pub description: String, pub enabled: bool, - #[serde(default = "default_2244")] + #[serde(default = "default_2245")] pub mode: String, pub created_by: String, - #[serde(default = "default_2245")] - pub created_at: Option, #[serde(default = "default_2246")] + pub created_at: Option, + #[serde(default = "default_2247")] pub updated_at: Option, } @@ -51182,9 +51195,9 @@ impl PolicyListInput { pub struct PolicySetOutput { pub rule: PolicyRuleOut, pub leaf_count: Integer, - #[serde(default = "default_2247")] - pub widening: bool, #[serde(default = "default_2248")] + pub widening: bool, + #[serde(default = "default_2249")] pub change: Vec, } @@ -51454,37 +51467,37 @@ pub struct ProcedureEvolveOutput { pub revision: Integer, pub changed: bool, pub template: bool, - #[serde(default = "default_2249")] - pub folded_runs: Integer, #[serde(default = "default_2250")] - pub gate: ProcedureEvolveOutputGate, + pub folded_runs: Integer, #[serde(default = "default_2251")] - pub gate_mode: String, + pub gate: ProcedureEvolveOutputGate, #[serde(default = "default_2252")] - pub gate_llr: f64, + pub gate_mode: String, #[serde(default = "default_2253")] - pub gate_before: std::collections::HashMap, + pub gate_llr: f64, #[serde(default = "default_2254")] - pub gate_after: std::collections::HashMap, + pub gate_before: std::collections::HashMap, #[serde(default = "default_2255")] - pub gate_cost_before: std::collections::HashMap, + pub gate_after: std::collections::HashMap, #[serde(default = "default_2256")] - pub gate_cost_after: std::collections::HashMap, + pub gate_cost_before: std::collections::HashMap, #[serde(default = "default_2257")] - pub gate_reason: String, + pub gate_cost_after: std::collections::HashMap, #[serde(default = "default_2258")] - pub dead_end_steps: Vec, + pub gate_reason: String, #[serde(default = "default_2259")] - pub fail_prone_steps: Vec, + pub dead_end_steps: Vec, #[serde(default = "default_2260")] - pub fail_prone_transitions: Vec, + pub fail_prone_steps: Vec, #[serde(default = "default_2261")] - pub run_stats: std::collections::HashMap, + pub fail_prone_transitions: Vec, #[serde(default = "default_2262")] - pub strikes: Integer, + pub run_stats: std::collections::HashMap, #[serde(default = "default_2263")] - pub quarantined: bool, + pub strikes: Integer, #[serde(default = "default_2264")] + pub quarantined: bool, + #[serde(default = "default_2265")] pub retention: std::collections::HashMap, } @@ -51707,9 +51720,9 @@ pub struct ProcedureForkOutput { pub memory_key: String, pub version: Integer, pub name: String, - #[serde(default = "default_2265")] - pub steps: Vec, #[serde(default = "default_2266")] + pub steps: Vec, + #[serde(default = "default_2267")] pub forked_from: std::collections::HashMap, } @@ -51969,32 +51982,32 @@ pub enum ProcedureLocateOutputStatus { #[non_exhaustive] pub struct ProcedureLocateOutput { pub memory_key: String, - #[serde(default = "default_2267")] - pub name: String, #[serde(default = "default_2268")] + pub name: String, + #[serde(default = "default_2269")] pub status: ProcedureLocateOutputStatus, pub matched: bool, - #[serde(default = "default_2269")] - pub active: Option>, #[serde(default = "default_2270")] - pub hops: Vec>>, + pub active: Option>, #[serde(default = "default_2271")] - pub entry_nodes: Vec, + pub hops: Vec>>, #[serde(default = "default_2272")] - pub dominant_next: Vec, + pub entry_nodes: Vec, #[serde(default = "default_2273")] - pub revisits: std::collections::HashMap, + pub dominant_next: Vec, #[serde(default = "default_2274")] - pub looping: bool, + pub revisits: std::collections::HashMap, #[serde(default = "default_2275")] - pub exits: Vec, + pub looping: bool, #[serde(default = "default_2276")] - pub failure_notes: Vec>, + pub exits: Vec, #[serde(default = "default_2277")] - pub rendered: String, + pub failure_notes: Vec>, #[serde(default = "default_2278")] - pub run_stats: std::collections::HashMap, + pub rendered: String, #[serde(default = "default_2279")] + pub run_stats: std::collections::HashMap, + #[serde(default = "default_2280")] pub for_agent: std::collections::HashMap, } @@ -52149,43 +52162,43 @@ pub struct ProcedureMatch { pub name: String, pub situation: String, pub steps: Vec, - #[serde(default = "default_2280")] - pub tags: Vec, #[serde(default = "default_2281")] + pub tags: Vec, + #[serde(default = "default_2282")] pub metadata: std::collections::HashMap, pub similarity: f64, pub memory_key: String, pub namespace: String, - #[serde(default = "default_2282")] - pub graph: Option>, #[serde(default = "default_2283")] - pub template: bool, + pub graph: Option>, #[serde(default = "default_2284")] - pub run_stats: std::collections::HashMap, + pub template: bool, #[serde(default = "default_2285")] - pub status: ProcedureMatchStatus, + pub run_stats: std::collections::HashMap, #[serde(default = "default_2286")] - pub quarantined: Option>, + pub status: ProcedureMatchStatus, #[serde(default = "default_2287")] - pub fail_prone_steps: Vec, + pub quarantined: Option>, #[serde(default = "default_2288")] - pub revision: Integer, + pub fail_prone_steps: Vec, #[serde(default = "default_2289")] - pub rejected_revisions: Vec>, + pub revision: Integer, #[serde(default = "default_2290")] - pub tool_overlap: f64, + pub rejected_revisions: Vec>, #[serde(default = "default_2291")] - pub score: f64, + pub tool_overlap: f64, #[serde(default = "default_2292")] - pub utility: f64, + pub score: f64, #[serde(default = "default_2293")] - pub goal_similarity: Option, + pub utility: f64, #[serde(default = "default_2294")] - pub for_agent: std::collections::HashMap, + pub goal_similarity: Option, #[serde(default = "default_2295")] + pub for_agent: std::collections::HashMap, + #[serde(default = "default_2296")] pub run_stats_by_agent: std::collections::HashMap>, - #[serde(default = "default_2296")] + #[serde(default = "default_2297")] pub actor: String, } @@ -52193,11 +52206,11 @@ pub struct ProcedureMatch { #[non_exhaustive] pub struct ProcedureMatchOutput { pub matches: Vec, - #[serde(default = "default_2297")] - pub matched: Integer, #[serde(default = "default_2298")] - pub procedure_key: String, + pub matched: Integer, #[serde(default = "default_2299")] + pub procedure_key: String, + #[serde(default = "default_2300")] pub score: f64, } @@ -52589,9 +52602,9 @@ pub struct ProcedureReviseOutput { pub revision: Integer, pub prior_revision: Integer, pub digest: String, - #[serde(default = "default_2300")] - pub steps: Vec, #[serde(default = "default_2301")] + pub steps: Vec, + #[serde(default = "default_2302")] pub outcome: ProcedureReviseOutputOutcome, } @@ -52703,14 +52716,14 @@ pub struct ProfileActivityEntry { pub agent: String, pub last_activated_at: String, pub event_count: Integer, - #[serde(default = "default_2302")] + #[serde(default = "default_2303")] pub operations: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProfileActivityOutput { - #[serde(default = "default_2303")] + #[serde(default = "default_2304")] pub entries: Vec, } @@ -52818,17 +52831,17 @@ impl ProfileActivityInput { #[non_exhaustive] pub struct ProfileMutationOutput { pub version: Integer, - #[serde(default = "default_2304")] - pub memory_id: String, #[serde(default = "default_2305")] - pub content_sha256: String, + pub memory_id: String, #[serde(default = "default_2306")] - pub namespace: String, + pub content_sha256: String, #[serde(default = "default_2307")] - pub label: String, + pub namespace: String, #[serde(default = "default_2308")] - pub char_limit: Option, + pub label: String, #[serde(default = "default_2309")] + pub char_limit: Option, + #[serde(default = "default_2310")] pub value_length: Integer, } @@ -52937,7 +52950,7 @@ pub struct ProfileRenderOutput { pub rendered: String, pub section_count: Integer, pub total_chars: Integer, - #[serde(default = "default_2310")] + #[serde(default = "default_2311")] pub labels: Vec, } @@ -53322,17 +53335,17 @@ pub enum ProfileStructuredOutputStatus { #[non_exhaustive] pub struct ProfileStructuredOutput { pub status: ProfileStructuredOutputStatus, - #[serde(default = "default_2311")] - pub profile: std::collections::HashMap, #[serde(default = "default_2312")] - pub built_at: Option, + pub profile: std::collections::HashMap, #[serde(default = "default_2313")] - pub memory_id: String, + pub built_at: Option, #[serde(default = "default_2314")] - pub version: Integer, + pub memory_id: String, #[serde(default = "default_2315")] - pub version_text: String, + pub version: Integer, #[serde(default = "default_2316")] + pub version_text: String, + #[serde(default = "default_2317")] pub schema_sha256: String, } @@ -53449,13 +53462,13 @@ impl ProfileStructuredInput { #[non_exhaustive] pub struct ProfileSchemaOutput { pub found: bool, - #[serde(default = "default_2317")] - pub json_schema: std::collections::HashMap, #[serde(default = "default_2318")] - pub schema_sha256: String, + pub json_schema: std::collections::HashMap, #[serde(default = "default_2319")] - pub updated_by: String, + pub schema_sha256: String, #[serde(default = "default_2320")] + pub updated_by: String, + #[serde(default = "default_2321")] pub updated_at: Option, } @@ -53608,10 +53621,10 @@ pub enum RunBeginOutputStatus { #[non_exhaustive] pub struct RunBeginOutput { pub run_id: String, - #[serde(default = "default_2321")] + #[serde(default = "default_2322")] pub status: RunBeginOutputStatus, pub started_at: String, - #[serde(default = "default_2322")] + #[serde(default = "default_2323")] pub next: String, } @@ -53819,31 +53832,31 @@ pub struct RunCompleteOutput { pub run_id: String, pub status: RunCompleteOutputStatus, pub duration_ms: Integer, - #[serde(default = "default_2323")] - pub used_applied: Integer, #[serde(default = "default_2324")] - pub undelivered: Integer, + pub used_applied: Integer, #[serde(default = "default_2325")] - pub evidence_applied: Integer, + pub undelivered: Integer, #[serde(default = "default_2326")] - pub harm_applied: Integer, + pub evidence_applied: Integer, #[serde(default = "default_2327")] - pub memories_written: Vec, + pub harm_applied: Integer, #[serde(default = "default_2328")] - pub recalled: Integer, + pub memories_written: Vec, #[serde(default = "default_2329")] - pub observations: Integer, + pub recalled: Integer, #[serde(default = "default_2330")] - pub procedure_runs_recorded: Integer, + pub observations: Integer, #[serde(default = "default_2331")] - pub reflection_key: String, + pub procedure_runs_recorded: Integer, #[serde(default = "default_2332")] - pub retain: String, + pub reflection_key: String, #[serde(default = "default_2333")] - pub retained: Integer, + pub retain: String, #[serde(default = "default_2334")] - pub demoted: Integer, + pub retained: Integer, #[serde(default = "default_2335")] + pub demoted: Integer, + #[serde(default = "default_2336")] pub expiring: Integer, } @@ -54384,25 +54397,25 @@ pub enum RunGetOutputOverBudgetItem { #[non_exhaustive] pub struct RunGetOutput { pub found: bool, - #[serde(default = "default_2336")] - pub run: Option, #[serde(default = "default_2337")] - pub recalled: Integer, + pub run: Option, #[serde(default = "default_2338")] - pub recalled_keys: Vec, + pub recalled: Integer, #[serde(default = "default_2339")] - pub memories_written: Vec, + pub recalled_keys: Vec, #[serde(default = "default_2340")] - pub observations: Integer, + pub memories_written: Vec, #[serde(default = "default_2341")] - pub turns: Integer, + pub observations: Integer, #[serde(default = "default_2342")] - pub unpriced_turns: Integer, + pub turns: Integer, #[serde(default = "default_2343")] - pub cost_usd: f64, + pub unpriced_turns: Integer, #[serde(default = "default_2344")] - pub elapsed_seconds: Integer, + pub cost_usd: f64, #[serde(default = "default_2345")] + pub elapsed_seconds: Integer, + #[serde(default = "default_2346")] pub over_budget: Vec, } @@ -54469,17 +54482,17 @@ pub struct RunGradeProposal { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct RunGradeOutput { - #[serde(default = "default_2346")] - pub graded: Integer, #[serde(default = "default_2347")] - pub run_ids: Vec, + pub graded: Integer, #[serde(default = "default_2348")] - pub skipped_active: Integer, + pub run_ids: Vec, #[serde(default = "default_2349")] - pub unchanged: Integer, + pub skipped_active: Integer, #[serde(default = "default_2350")] - pub memories_counted: Integer, + pub unchanged: Integer, #[serde(default = "default_2351")] + pub memories_counted: Integer, + #[serde(default = "default_2352")] pub proposals_decided: Vec, } @@ -54594,7 +54607,7 @@ impl RunGradeInput { #[non_exhaustive] pub struct RunListOutput { pub runs: Vec, - #[serde(default = "default_2352")] + #[serde(default = "default_2353")] pub total: Option, } @@ -54818,19 +54831,19 @@ impl RunListInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct RunRetractCreditOutput { - #[serde(default = "default_2353")] - pub run_id: String, #[serde(default = "default_2354")] - pub used_retracted: Integer, + pub run_id: String, #[serde(default = "default_2355")] - pub evidence_retracted: Integer, + pub used_retracted: Integer, #[serde(default = "default_2356")] - pub harm_retracted: Integer, + pub evidence_retracted: Integer, #[serde(default = "default_2357")] - pub events_written: Integer, + pub harm_retracted: Integer, #[serde(default = "default_2358")] - pub more: bool, + pub events_written: Integer, #[serde(default = "default_2359")] + pub more: bool, + #[serde(default = "default_2360")] pub dry_run: bool, } @@ -54987,39 +55000,39 @@ pub struct LiveSearchHit { pub title: String, pub url: String, pub provider: LiveSearchHitProvider, - #[serde(default = "default_2362")] - pub content: String, #[serde(default = "default_2363")] + pub content: String, + #[serde(default = "default_2364")] pub live: LiveSearchHitLive, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct LiveSearchResults { - #[serde(default = "default_2361")] + #[serde(default = "default_2362")] pub live: LiveSearchResultsLive, - #[serde(default = "default_2364")] + #[serde(default = "default_2365")] pub results: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SearchOutput { - #[serde(default = "default_2360")] + #[serde(default = "default_2361")] pub tracker: Option>, - #[serde(default = "default_2365")] - pub live: Option, #[serde(default = "default_2366")] - pub memory: std::collections::HashMap, + pub live: Option, #[serde(default = "default_2367")] - pub knowledge: std::collections::HashMap, + pub memory: std::collections::HashMap, #[serde(default = "default_2368")] - pub profile: std::collections::HashMap, + pub knowledge: std::collections::HashMap, #[serde(default = "default_2369")] - pub conversations: std::collections::HashMap, + pub profile: std::collections::HashMap, #[serde(default = "default_2370")] - pub withheld: Option>, + pub conversations: std::collections::HashMap, #[serde(default = "default_2371")] + pub withheld: Option>, + #[serde(default = "default_2372")] pub namespaces_skipped: Vec, } @@ -55223,7 +55236,7 @@ impl SearchInput { pub struct SessionBriefDeleteOutput { pub deleted: bool, pub brief_key: String, - #[serde(default = "default_2372")] + #[serde(default = "default_2373")] pub revision: Integer, } @@ -55316,67 +55329,67 @@ impl SessionBriefDeleteInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDecision { - #[serde(default = "default_2381")] - pub what: String, #[serde(default = "default_2382")] + pub what: String, + #[serde(default = "default_2383")] pub why: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDeadEnd { - #[serde(default = "default_2384")] - pub tried: String, #[serde(default = "default_2385")] + pub tried: String, + #[serde(default = "default_2386")] pub why_not: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDone { - #[serde(default = "default_2387")] + #[serde(default = "default_2388")] pub what: String, - #[serde(rename = "ref", default = "default_2388")] + #[serde(rename = "ref", default = "default_2389")] pub r#ref: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefFile { - #[serde(default = "default_2392")] - pub path: String, #[serde(default = "default_2393")] + pub path: String, + #[serde(default = "default_2394")] pub role: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefSections { - #[serde(default = "default_2378")] - pub goal: String, #[serde(default = "default_2379")] - pub status: String, + pub goal: String, #[serde(default = "default_2380")] + pub status: String, + #[serde(default = "default_2381")] pub verification: String, - #[serde(default = "default_2383")] + #[serde(default = "default_2384")] pub decisions: Vec, - #[serde(default = "default_2386")] + #[serde(default = "default_2387")] pub dead_ends: Vec, - #[serde(default = "default_2389")] - pub done: Vec, #[serde(default = "default_2390")] - pub open_questions: Vec, + pub done: Vec, #[serde(default = "default_2391")] + pub open_questions: Vec, + #[serde(default = "default_2392")] pub next_steps: Vec, - #[serde(default = "default_2394")] - pub files: Vec, #[serde(default = "default_2395")] - pub constraints: Vec, + pub files: Vec, #[serde(default = "default_2396")] - pub pointers: Vec, + pub constraints: Vec, #[serde(default = "default_2397")] - pub client_summary: String, + pub pointers: Vec, #[serde(default = "default_2398")] + pub client_summary: String, + #[serde(default = "default_2399")] pub client_summary_at: String, } @@ -55384,45 +55397,45 @@ pub struct BriefSections { #[non_exhaustive] pub struct SessionBriefGetOutput { pub found: bool, - #[serde(default = "default_2373")] - pub brief_key: String, #[serde(default = "default_2374")] - pub revision: Integer, + pub brief_key: String, #[serde(default = "default_2375")] - pub snapshot_id: String, + pub revision: Integer, #[serde(default = "default_2376")] - pub snapshot_key: String, + pub snapshot_id: String, #[serde(default = "default_2377")] + pub snapshot_key: String, + #[serde(default = "default_2378")] pub rendered: String, - #[serde(default = "default_2399")] - pub sections: Option, #[serde(default = "default_2400")] - pub project: String, + pub sections: Option, #[serde(default = "default_2401")] - pub branch: String, + pub project: String, #[serde(default = "default_2402")] - pub head_sha: String, + pub branch: String, #[serde(default = "default_2403")] - pub author: String, + pub head_sha: String, #[serde(default = "default_2404")] - pub trigger: String, + pub author: String, #[serde(default = "default_2405")] - pub actor: String, + pub trigger: String, #[serde(default = "default_2406")] - pub source_sessions: Vec, + pub actor: String, #[serde(default = "default_2407")] - pub updated_at: Option, + pub source_sessions: Vec, #[serde(default = "default_2408")] - pub age_seconds: Integer, + pub updated_at: Option, #[serde(default = "default_2409")] - pub revisions: Integer, + pub age_seconds: Integer, #[serde(default = "default_2410")] - pub events_total: Integer, + pub revisions: Integer, #[serde(default = "default_2411")] - pub source_chars: Integer, + pub events_total: Integer, #[serde(default = "default_2412")] - pub brief_chars: Integer, + pub source_chars: Integer, #[serde(default = "default_2413")] + pub brief_chars: Integer, + #[serde(default = "default_2414")] pub deleted: bool, } @@ -55597,34 +55610,34 @@ impl SessionBriefGetInput { pub struct SessionBriefSummary { pub brief_key: String, pub revision: Integer, - #[serde(default = "default_2414")] - pub project: String, #[serde(default = "default_2415")] - pub branch: String, + pub project: String, #[serde(default = "default_2416")] - pub agent: String, + pub branch: String, #[serde(default = "default_2417")] - pub goal: String, + pub agent: String, #[serde(default = "default_2418")] - pub status: String, + pub goal: String, #[serde(default = "default_2419")] - pub author: String, + pub status: String, #[serde(default = "default_2420")] - pub actor: String, + pub author: String, #[serde(default = "default_2421")] - pub updated_at: Option, + pub actor: String, #[serde(default = "default_2422")] - pub age_seconds: Integer, + pub updated_at: Option, #[serde(default = "default_2423")] + pub age_seconds: Integer, + #[serde(default = "default_2424")] pub brief_chars: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SessionBriefListOutput { - #[serde(default = "default_2424")] - pub briefs: Vec, #[serde(default = "default_2425")] + pub briefs: Vec, + #[serde(default = "default_2426")] pub rendered: String, } @@ -55764,25 +55777,25 @@ impl SessionBriefListInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SessionBriefStats { - #[serde(default = "default_2429")] - pub events_in: Integer, #[serde(default = "default_2430")] - pub windows: Integer, + pub events_in: Integer, #[serde(default = "default_2431")] - pub events_total: Integer, + pub windows: Integer, #[serde(default = "default_2432")] - pub source_chars: Integer, + pub events_total: Integer, #[serde(default = "default_2433")] - pub brief_chars: Integer, + pub source_chars: Integer, #[serde(default = "default_2434")] - pub compression_ratio: f64, + pub brief_chars: Integer, #[serde(default = "default_2435")] - pub dropped_ungrounded: Integer, + pub compression_ratio: f64, #[serde(default = "default_2436")] - pub tokens_in: Integer, + pub dropped_ungrounded: Integer, #[serde(default = "default_2437")] - pub tokens_out: Integer, + pub tokens_in: Integer, #[serde(default = "default_2438")] + pub tokens_out: Integer, + #[serde(default = "default_2439")] pub llm_model: String, } @@ -55792,13 +55805,13 @@ pub struct SessionBriefSaveOutput { pub brief_key: String, pub revision: Integer, pub changed: bool, - #[serde(default = "default_2426")] - pub author: String, #[serde(default = "default_2427")] - pub reason: String, + pub author: String, #[serde(default = "default_2428")] + pub reason: String, + #[serde(default = "default_2429")] pub rendered: String, - #[serde(default = "default_2439")] + #[serde(default = "default_2440")] pub stats: SessionBriefStats, } @@ -56543,39 +56556,39 @@ pub struct TaskPayload { pub priority: Integer, pub disclosure: TaskPayloadDisclosure, pub status: TaskPayloadStatus, - #[serde(default = "default_2440")] - pub reason: String, #[serde(default = "default_2441")] - pub blocked_on: String, + pub reason: String, #[serde(default = "default_2442")] - pub not_before: Option, + pub blocked_on: String, #[serde(default = "default_2443")] - pub resume_at: Option, + pub not_before: Option, #[serde(default = "default_2444")] - pub deadline: Option, + pub resume_at: Option, #[serde(default = "default_2445")] + pub deadline: Option, + #[serde(default = "default_2446")] pub defer_count: Integer, pub title: String, - #[serde(default = "default_2446")] + #[serde(default = "default_2447")] pub brief: std::collections::HashMap, pub from_agent: String, - #[serde(default = "default_2447")] - pub from_subject: String, #[serde(default = "default_2448")] - pub origin: String, + pub from_subject: String, #[serde(default = "default_2449")] - pub parent_task_id: Option, + pub origin: String, #[serde(default = "default_2450")] - pub owner: String, + pub parent_task_id: Option, #[serde(default = "default_2451")] - pub attempt: Integer, + pub owner: String, #[serde(default = "default_2452")] - pub fence: Integer, + pub attempt: Integer, #[serde(default = "default_2453")] - pub lease_until: Option, + pub fence: Integer, #[serde(default = "default_2454")] - pub outcome: std::collections::HashMap, + pub lease_until: Option, #[serde(default = "default_2455")] + pub outcome: std::collections::HashMap, + #[serde(default = "default_2456")] pub last_actor: String, pub created_at: String, pub updated_at: String, @@ -56586,7 +56599,7 @@ pub struct TaskPayload { #[non_exhaustive] pub struct TaskOutput { pub task: TaskPayload, - #[serde(default = "default_2456")] + #[serde(default = "default_2457")] pub seq: Integer, } @@ -56987,10 +57000,10 @@ impl TaskCompleteInput { pub struct InboxCount { pub inbox: String, pub status: String, - #[serde(default = "default_2457")] + #[serde(default = "default_2458")] pub blocked_on: String, pub n: Integer, - #[serde(default = "default_2458")] + #[serde(default = "default_2459")] pub oldest: Option, } @@ -57077,7 +57090,7 @@ pub struct TaskCreateOutput { pub task: TaskPayload, pub created: bool, pub seq: Integer, - #[serde(default = "default_2459")] + #[serde(default = "default_2460")] pub next: String, } @@ -57416,7 +57429,7 @@ impl TaskFailInput { #[non_exhaustive] pub struct TaskGetOutput { pub found: bool, - #[serde(default = "default_2460")] + #[serde(default = "default_2461")] pub task: Option, } @@ -57550,23 +57563,23 @@ pub struct TaskEventPayload { pub task_id: String, pub inbox: String, pub event: String, - #[serde(default = "default_2461")] - pub from_status: String, #[serde(default = "default_2462")] - pub to_status: String, + pub from_status: String, #[serde(default = "default_2463")] - pub actor: String, + pub to_status: String, #[serde(default = "default_2464")] - pub agent: String, + pub actor: String, #[serde(default = "default_2465")] - pub fence: Integer, + pub agent: String, #[serde(default = "default_2466")] - pub version: Integer, + pub fence: Integer, #[serde(default = "default_2467")] - pub reason: String, + pub version: Integer, #[serde(default = "default_2468")] - pub patch: std::collections::HashMap, + pub reason: String, #[serde(default = "default_2469")] + pub patch: std::collections::HashMap, + #[serde(default = "default_2470")] pub note: String, pub ts: String, } @@ -57906,7 +57919,7 @@ pub struct TaskPullOutput { pub tasks: Vec, pub waited_ms: Integer, pub backend: String, - #[serde(default = "default_2470")] + #[serde(default = "default_2471")] pub note: String, } @@ -58302,7 +58315,7 @@ impl TaskUnblockInput { pub struct TaskUpdateOutput { pub task: TaskPayload, pub seq: Integer, - #[serde(default = "default_2471")] + #[serde(default = "default_2472")] pub conflict: bool, } @@ -58665,19 +58678,19 @@ impl TaskReasonInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerAnswerOutput { - #[serde(default = "default_2472")] - pub intent: String, #[serde(default = "default_2473")] - pub anchors: std::collections::HashMap, + pub intent: String, #[serde(default = "default_2474")] - pub sections: Vec>, + pub anchors: std::collections::HashMap, #[serde(default = "default_2475")] - pub searched: Vec, + pub sections: Vec>, #[serde(default = "default_2476")] - pub lines: Vec, + pub searched: Vec, #[serde(default = "default_2477")] - pub restricted: bool, + pub lines: Vec, #[serde(default = "default_2478")] + pub restricted: bool, + #[serde(default = "default_2479")] pub verdict: String, } @@ -58773,17 +58786,17 @@ impl TrackerAnswerInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerBindingOutput { - #[serde(default = "default_2479")] - pub tracker_namespace: String, #[serde(default = "default_2480")] - pub tracker_namespaces: Vec, + pub tracker_namespace: String, #[serde(default = "default_2481")] - pub restricted: bool, + pub tracker_namespaces: Vec, #[serde(default = "default_2482")] - pub kind: String, + pub restricted: bool, #[serde(default = "default_2483")] - pub authorized: bool, + pub kind: String, #[serde(default = "default_2484")] + pub authorized: bool, + #[serde(default = "default_2485")] pub templates: Vec, } @@ -58836,13 +58849,13 @@ impl TrackerBindingInput { #[non_exhaustive] pub struct TrackerComponentOutput { pub component: String, - #[serde(default = "default_2485")] - pub risk: std::collections::HashMap, #[serde(default = "default_2486")] - pub open_issues: Vec>, + pub risk: std::collections::HashMap, #[serde(default = "default_2487")] - pub known: bool, + pub open_issues: Vec>, #[serde(default = "default_2488")] + pub known: bool, + #[serde(default = "default_2489")] pub tracker_unavailable: bool, } @@ -58903,9 +58916,9 @@ impl TrackerComponentInput { #[non_exhaustive] pub struct TrackerContractOutput { pub database: String, - #[serde(default = "default_2489")] - pub tables: Vec>, #[serde(default = "default_2490")] + pub tables: Vec>, + #[serde(default = "default_2491")] pub templates: std::collections::HashMap, } @@ -58958,66 +58971,66 @@ impl TrackerContractInput { #[non_exhaustive] pub struct TrackerLegStatus { pub name: String, - #[serde(default = "default_2501")] - pub status: String, #[serde(default = "default_2502")] - pub reason: String, + pub status: String, #[serde(default = "default_2503")] - pub message: String, + pub reason: String, #[serde(default = "default_2504")] - pub retried: bool, + pub message: String, #[serde(default = "default_2505")] - pub ms: Integer, + pub retried: bool, #[serde(default = "default_2506")] - pub cause: String, + pub ms: Integer, #[serde(default = "default_2507")] + pub cause: String, + #[serde(default = "default_2508")] pub namespace: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerDuplicateCheckOutput { - #[serde(default = "default_2491")] - pub verdict: String, #[serde(default = "default_2492")] - pub items: Vec>, + pub verdict: String, #[serde(default = "default_2493")] - pub undecided: bool, + pub items: Vec>, #[serde(default = "default_2494")] - pub epistemic: String, + pub undecided: bool, #[serde(default = "default_2495")] - pub thresholds: std::collections::HashMap, + pub epistemic: String, #[serde(default = "default_2496")] - pub judge: std::collections::HashMap, + pub thresholds: std::collections::HashMap, #[serde(default = "default_2497")] - pub fit_at: String, + pub judge: std::collections::HashMap, #[serde(default = "default_2498")] - pub fit: std::collections::HashMap, + pub fit_at: String, #[serde(default = "default_2499")] - pub query: std::collections::HashMap, + pub fit: std::collections::HashMap, #[serde(default = "default_2500")] + pub query: std::collections::HashMap, + #[serde(default = "default_2501")] pub legs: std::collections::HashMap, - #[serde(default = "default_2508")] - pub leg_status: Vec, #[serde(default = "default_2509")] - pub tracker_unavailable: bool, + pub leg_status: Vec, #[serde(default = "default_2510")] - pub namespaces: Vec, + pub tracker_unavailable: bool, #[serde(default = "default_2511")] - pub by_namespace: std::collections::HashMap>, + pub namespaces: Vec, #[serde(default = "default_2512")] - pub closest: Vec>, + pub by_namespace: std::collections::HashMap>, #[serde(default = "default_2513")] - pub needs: Vec>, + pub closest: Vec>, #[serde(default = "default_2514")] - pub closest_note: String, + pub needs: Vec>, #[serde(default = "default_2515")] - pub nearest: Vec>, + pub closest_note: String, #[serde(default = "default_2516")] - pub rerank: std::collections::HashMap, + pub nearest: Vec>, #[serde(default = "default_2517")] - pub answer: String, + pub rerank: std::collections::HashMap, #[serde(default = "default_2518")] + pub answer: String, + #[serde(default = "default_2519")] pub related_prs: Vec>, } @@ -59224,17 +59237,17 @@ impl TrackerDuplicateCheckInput { #[non_exhaustive] pub struct TrackerFlakyOutput { pub test_name: String, - #[serde(default = "default_2519")] - pub known_flaky: bool, #[serde(default = "default_2520")] - pub open_issues: Integer, + pub known_flaky: bool, #[serde(default = "default_2521")] - pub issues: Vec>, + pub open_issues: Integer, #[serde(default = "default_2522")] - pub verdict: String, + pub issues: Vec>, #[serde(default = "default_2523")] - pub tracker_unavailable: bool, + pub verdict: String, #[serde(default = "default_2524")] + pub tracker_unavailable: bool, + #[serde(default = "default_2525")] pub signal: Option>, } @@ -59317,9 +59330,9 @@ impl TrackerFlakyInput { #[non_exhaustive] pub struct TrackerItemOutput { pub items: Vec>, - #[serde(default = "default_2525")] - pub unknown: Vec, #[serde(default = "default_2526")] + pub unknown: Vec, + #[serde(default = "default_2527")] pub tracker_unavailable: bool, } @@ -59368,19 +59381,19 @@ impl TrackerItemInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerLinksOutput { - #[serde(default = "default_2527")] - pub subject: std::collections::HashMap, #[serde(default = "default_2528")] - pub verdict: String, + pub subject: std::collections::HashMap, #[serde(default = "default_2529")] - pub items: Vec>, + pub verdict: String, #[serde(default = "default_2530")] - pub epistemic: String, + pub items: Vec>, #[serde(default = "default_2531")] - pub record: std::collections::HashMap, + pub epistemic: String, #[serde(default = "default_2532")] - pub computed_at: String, + pub record: std::collections::HashMap, #[serde(default = "default_2533")] + pub computed_at: String, + #[serde(default = "default_2534")] pub tracker_unavailable: bool, } @@ -59478,11 +59491,11 @@ impl TrackerLinksInput { pub struct TrackerReleaseOutput { pub version: String, pub blockers: Vec>, - #[serde(default = "default_2534")] - pub active_blockers: Integer, #[serde(default = "default_2535")] - pub health: std::collections::HashMap, + pub active_blockers: Integer, #[serde(default = "default_2536")] + pub health: std::collections::HashMap, + #[serde(default = "default_2537")] pub tracker_unavailable: bool, } @@ -59531,17 +59544,17 @@ impl TrackerReleaseInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerSimilarOutput { - #[serde(default = "default_2537")] - pub items: Vec>, #[serde(default = "default_2538")] - pub query: std::collections::HashMap, + pub items: Vec>, #[serde(default = "default_2539")] - pub legs: std::collections::HashMap, + pub query: std::collections::HashMap, #[serde(default = "default_2540")] - pub epistemic: String, + pub legs: std::collections::HashMap, #[serde(default = "default_2541")] - pub tracker_unavailable: bool, + pub epistemic: String, #[serde(default = "default_2542")] + pub tracker_unavailable: bool, + #[serde(default = "default_2543")] pub namespaces: Vec, } @@ -59662,20 +59675,20 @@ pub struct TrackerSourceAddOutput { pub name: String, pub host: String, pub database: String, - #[serde(default = "default_2543")] - pub namespaces: Vec>, #[serde(default = "default_2544")] - pub contract: std::collections::HashMap, + pub namespaces: Vec>, #[serde(default = "default_2545")] - pub roles: Vec, + pub contract: std::collections::HashMap, #[serde(default = "default_2546")] - pub my_role: String, + pub roles: Vec, #[serde(default = "default_2547")] - pub dry_run: bool, + pub my_role: String, #[serde(default = "default_2548")] - pub written: bool, + pub dry_run: bool, #[serde(default = "default_2549")] - pub view_templates: std::collections::HashMap, + pub written: bool, + #[serde(default = "default_2550")] + pub view_templates: std::collections::HashMap, } #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] @@ -59837,13 +59850,13 @@ impl TrackerSourceAddInput { #[non_exhaustive] pub struct TrackerSourceCheckOutput { pub name: String, - #[serde(default = "default_2550")] - pub database: String, #[serde(default = "default_2551")] - pub reachable: bool, + pub database: String, #[serde(default = "default_2552")] - pub contract: std::collections::HashMap, + pub reachable: bool, #[serde(default = "default_2553")] + pub contract: std::collections::HashMap, + #[serde(default = "default_2554")] pub view_templates: std::collections::HashMap, } @@ -59883,11 +59896,11 @@ impl TrackerSourceCheckInput { pub struct TrackerSourceInspectOutput { pub host: String, pub database: String, - #[serde(default = "default_2554")] - pub tables: Vec>, #[serde(default = "default_2555")] - pub roles: Vec, + pub tables: Vec>, #[serde(default = "default_2556")] + pub roles: Vec, + #[serde(default = "default_2557")] pub proposal: std::collections::HashMap, } @@ -60016,9 +60029,9 @@ impl TrackerSourceInspectInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerSourceListOutput { - #[serde(default = "default_2557")] - pub sources: Vec>, #[serde(default = "default_2558")] + pub sources: Vec>, + #[serde(default = "default_2559")] pub self_service: bool, } @@ -60071,9 +60084,9 @@ impl TrackerSourceListInput { #[non_exhaustive] pub struct TrackerSourceRemoveOutput { pub name: String, - #[serde(default = "default_2559")] - pub deactivated: bool, #[serde(default = "default_2560")] + pub deactivated: bool, + #[serde(default = "default_2561")] pub namespaces_retired: Vec, } @@ -60114,9 +60127,9 @@ impl TrackerSourceRemoveInput { #[non_exhaustive] pub struct TrackerSourceRotateOutput { pub name: String, - #[serde(default = "default_2561")] - pub contract: std::collections::HashMap, #[serde(default = "default_2562")] + pub contract: std::collections::HashMap, + #[serde(default = "default_2563")] pub rotated_at: String, } @@ -60163,11 +60176,11 @@ impl TrackerSourceRotateInput { #[non_exhaustive] pub struct TrackerSourceSetMappingOutput { pub name: String, - #[serde(default = "default_2563")] - pub contract: std::collections::HashMap, #[serde(default = "default_2564")] - pub dry_run: bool, + pub contract: std::collections::HashMap, #[serde(default = "default_2565")] + pub dry_run: bool, + #[serde(default = "default_2566")] pub written: bool, } @@ -60234,45 +60247,45 @@ impl TrackerSourceSetMappingInput { #[non_exhaustive] pub struct TrackerTestSignalOutput { pub test_name: String, - #[serde(default = "default_2566")] - pub verdict: String, #[serde(default = "default_2567")] - pub why: Vec, + pub verdict: String, #[serde(default = "default_2568")] - pub lower_bound: f64, + pub why: Vec, #[serde(default = "default_2569")] - pub window_days: Integer, + pub lower_bound: f64, #[serde(default = "default_2570")] - pub since: String, + pub window_days: Integer, #[serde(default = "default_2571")] - pub features: std::collections::HashMap, + pub since: String, #[serde(default = "default_2572")] - pub infra: std::collections::HashMap, + pub features: std::collections::HashMap, #[serde(default = "default_2573")] - pub churn: std::collections::HashMap, + pub infra: std::collections::HashMap, #[serde(default = "default_2574")] - pub thresholds: std::collections::HashMap, + pub churn: std::collections::HashMap, #[serde(default = "default_2575")] - pub source: String, + pub thresholds: std::collections::HashMap, #[serde(default = "default_2576")] - pub timings_ms: std::collections::HashMap, + pub source: String, #[serde(default = "default_2577")] - pub tracker_unavailable: bool, + pub timings_ms: std::collections::HashMap, #[serde(default = "default_2578")] - pub rollup: std::collections::HashMap, + pub tracker_unavailable: bool, #[serde(default = "default_2579")] - pub streak: std::collections::HashMap, + pub rollup: std::collections::HashMap, #[serde(default = "default_2580")] - pub smells: std::collections::HashMap, + pub streak: std::collections::HashMap, #[serde(default = "default_2581")] - pub prior: std::collections::HashMap, + pub smells: std::collections::HashMap, #[serde(default = "default_2582")] - pub unavailable_reason: String, + pub prior: std::collections::HashMap, #[serde(default = "default_2583")] - pub candidates: Vec>, + pub unavailable_reason: String, #[serde(default = "default_2584")] - pub candidate_matches: Integer, + pub candidates: Vec>, #[serde(default = "default_2585")] + pub candidate_matches: Integer, + #[serde(default = "default_2586")] pub resolved_from: String, } @@ -60376,9 +60389,9 @@ impl TrackerTestSignalInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct UiVitalsOutput { - #[serde(default = "default_2586")] - pub recorded: bool, #[serde(default = "default_2587")] + pub recorded: bool, + #[serde(default = "default_2588")] pub route: String, } @@ -60562,7 +60575,7 @@ pub struct WebhookDelivery { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct WebhookDeliveriesOutput { - #[serde(default = "default_2588")] + #[serde(default = "default_2589")] pub deliveries: Vec, } @@ -60684,14 +60697,14 @@ pub struct WebhookInfo { pub secret_ref: String, pub events: Vec, pub created_at: String, - #[serde(default = "default_2589")] + #[serde(default = "default_2590")] pub secret_present: bool, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct WebhookListOutput { - #[serde(default = "default_2590")] + #[serde(default = "default_2591")] pub webhooks: Vec, } @@ -60873,7 +60886,7 @@ pub struct WorkingMemoryMutationOutput { pub version: Integer, pub char_limit: Integer, pub value_length: Integer, - #[serde(default = "default_2591")] + #[serde(default = "default_2592")] pub fill_ratio: f64, } @@ -61097,15 +61110,15 @@ impl WorkingMemoryDeleteInput { pub struct WorkingMemoryGetOutput { pub found: bool, pub block_key: String, - #[serde(default = "default_2592")] - pub content: String, #[serde(default = "default_2593")] - pub char_limit: Integer, + pub content: String, #[serde(default = "default_2594")] - pub version: Integer, + pub char_limit: Integer, #[serde(default = "default_2595")] - pub updated_at: Option, + pub version: Integer, #[serde(default = "default_2596")] + pub updated_at: Option, + #[serde(default = "default_2597")] pub fill_ratio: f64, } @@ -61216,7 +61229,7 @@ pub struct WorkingMemoryBlock { pub content: String, pub char_limit: Integer, pub version: Integer, - #[serde(default = "default_2597")] + #[serde(default = "default_2598")] pub updated_at: Option, } @@ -61224,7 +61237,7 @@ pub struct WorkingMemoryBlock { #[non_exhaustive] pub struct WorkingMemoryRenderOutput { pub rendered: String, - #[serde(default = "default_2598")] + #[serde(default = "default_2599")] pub blocks: Vec, pub block_count: Integer, pub total_chars: Integer, @@ -66968,60 +66981,60 @@ fn default_1786() -> String { fn default_1787() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1788() -> Vec { +fn default_1788() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1789() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1789() -> String { +fn default_1790() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1790() -> Integer { +fn default_1791() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1791() -> Integer { +fn default_1792() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1792() -> String { +fn default_1793() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1793() -> Integer { +fn default_1794() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1794() -> Integer { +fn default_1795() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1795() -> MemoryProposalReady { +fn default_1796() -> MemoryProposalReady { serde_json::from_str("\"\"").expect("schema default") } -fn default_1796() -> Vec { +fn default_1797() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1797() -> Vec { +fn default_1798() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1798() -> Integer { +fn default_1799() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1799() -> ProposalPolicyMode { +fn default_1800() -> ProposalPolicyMode { serde_json::from_str("\"manual\"").expect("schema default") } -fn default_1800() -> Integer { +fn default_1801() -> Integer { serde_json::from_str("2").expect("schema default") } -fn default_1801() -> Integer { +fn default_1802() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1802() -> Integer { +fn default_1803() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1803() -> ProposalPolicy { +fn default_1804() -> ProposalPolicy { serde_json::from_str( "{\"mode\":\"manual\",\"min_passes\":2,\"max_fails\":0,\"reject_after_fails\":0}", ) .expect("schema default") } -fn default_1804() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1805() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67037,12 +67050,12 @@ fn default_1808() -> String { fn default_1809() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1810() -> bool { - serde_json::from_str("false").expect("schema default") -} -fn default_1811() -> String { +fn default_1810() -> String { serde_json::from_str("\"\"").expect("schema default") } +fn default_1811() -> bool { + serde_json::from_str("false").expect("schema default") +} fn default_1812() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67067,24 +67080,24 @@ fn default_1818() -> String { fn default_1819() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1820() -> Vec { +fn default_1820() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1821() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1821() -> f64 { +fn default_1822() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1822() -> String { +fn default_1823() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1823() -> String { +fn default_1824() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1824() -> Vec { +fn default_1825() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1825() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1826() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67094,11 +67107,11 @@ fn default_1827() -> String { fn default_1828() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1829() -> bool { - serde_json::from_str("false").expect("schema default") +fn default_1829() -> String { + serde_json::from_str("\"\"").expect("schema default") } -fn default_1830() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_1830() -> bool { + serde_json::from_str("false").expect("schema default") } fn default_1831() -> Integer { serde_json::from_str("0").expect("schema default") @@ -67106,183 +67119,183 @@ fn default_1831() -> Integer { fn default_1832() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1833() -> bool { +fn default_1833() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_1834() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1834() -> String { +fn default_1835() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1835() -> Integer { +fn default_1836() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_1836() -> MemoryRecallOutputOrder { +fn default_1837() -> MemoryRecallOutputOrder { serde_json::from_str("\"recent\"").expect("schema default") } -fn default_1837() -> Vec { +fn default_1838() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1838() -> Integer { +fn default_1839() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1839() -> Value { +fn default_1840() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1840() -> Value { +fn default_1841() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1841() -> String { +fn default_1842() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1842() -> String { +fn default_1843() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1843() -> Option { +fn default_1844() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1844() -> Option { +fn default_1845() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1845() -> bool { +fn default_1846() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1846() -> String { +fn default_1847() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1847() -> String { +fn default_1848() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1848() -> std::collections::HashMap { +fn default_1849() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1849() -> std::collections::HashMap { +fn default_1850() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1850() -> MemoryRecordRowStatus { +fn default_1851() -> MemoryRecordRowStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1851() -> Option { +fn default_1852() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1852() -> Option { +fn default_1853() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1853() -> bool { +fn default_1854() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1854() -> String { +fn default_1855() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1855() -> MemoryRecordWriteOutputKeySource { +fn default_1856() -> MemoryRecordWriteOutputKeySource { serde_json::from_str("\"anonymous\"").expect("schema default") } -fn default_1856() -> std::collections::HashMap { +fn default_1857() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1857() -> String { +fn default_1858() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1858() -> Integer { +fn default_1859() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1859() -> bool { +fn default_1860() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1860() -> Option { +fn default_1861() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1861() -> Integer { +fn default_1862() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1862() -> Integer { +fn default_1863() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1863() -> Option { +fn default_1864() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1864() -> String { +fn default_1865() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1865() -> Integer { +fn default_1866() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1866() -> Integer { +fn default_1867() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1867() -> bool { +fn default_1868() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1868() -> Vec { +fn default_1869() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1869() -> Option { +fn default_1870() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1870() -> Option { +fn default_1871() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1871() -> bool { +fn default_1872() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1872() -> bool { +fn default_1873() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1873() -> String { +fn default_1874() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1874() -> f64 { +fn default_1875() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1875() -> String { +fn default_1876() -> String { serde_json::from_str("\"fact\"").expect("schema default") } -fn default_1876() -> String { +fn default_1877() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1877() -> std::collections::HashMap { +fn default_1878() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1878() -> bool { +fn default_1879() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1879() -> Integer { +fn default_1880() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1880() -> String { +fn default_1881() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1881() -> Vec { +fn default_1882() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1882() -> Vec { +fn default_1883() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1883() -> Integer { +fn default_1884() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1884() -> Integer { +fn default_1885() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1885() -> String { +fn default_1886() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1886() -> String { +fn default_1887() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1887() -> Integer { +fn default_1888() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_1888() -> Integer { +fn default_1889() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1889() -> Integer { +fn default_1890() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1890() -> Vec { +fn default_1891() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1891() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_1892() -> Integer { serde_json::from_str("0").expect("schema default") } @@ -67292,65 +67305,65 @@ fn default_1893() -> Integer { fn default_1894() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1895() -> Vec { +fn default_1895() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_1896() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1896() -> String { +fn default_1897() -> String { serde_json::from_str("\"whole\"").expect("schema default") } -fn default_1897() -> Integer { +fn default_1898() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1898() -> Vec { +fn default_1899() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1899() -> Vec { +fn default_1900() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1900() -> Integer { +fn default_1901() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1901() -> Vec { +fn default_1902() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1902() -> Integer { +fn default_1903() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1903() -> Vec { +fn default_1904() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1904() -> Vec { +fn default_1905() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1905() -> bool { +fn default_1906() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1906() -> String { +fn default_1907() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1907() -> String { +fn default_1908() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1908() -> std::collections::HashMap { +fn default_1909() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1909() -> String { +fn default_1910() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1910() -> bool { +fn default_1911() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1911() -> Vec { +fn default_1912() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1912() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_1913() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1914() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_1914() -> Integer { + serde_json::from_str("0").expect("schema default") } fn default_1915() -> String { serde_json::from_str("\"\"").expect("schema default") @@ -67358,29 +67371,29 @@ fn default_1915() -> String { fn default_1916() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1917() -> bool { +fn default_1917() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1918() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1918() -> Integer { +fn default_1919() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1919() -> Option { +fn default_1920() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1920() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1921() -> String { serde_json::from_str("\"\"").expect("schema default") } fn default_1922() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1923() -> Vec { - serde_json::from_str("[]").expect("schema default") +fn default_1923() -> String { + serde_json::from_str("\"\"").expect("schema default") } -fn default_1924() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_1924() -> Vec { + serde_json::from_str("[]").expect("schema default") } fn default_1925() -> Integer { serde_json::from_str("0").expect("schema default") @@ -67397,54 +67410,54 @@ fn default_1928() -> Integer { fn default_1929() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1930() -> bool { +fn default_1930() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_1931() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1931() -> Vec> { +fn default_1932() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1932() -> Vec { +fn default_1933() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1933() -> Option { +fn default_1934() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1934() -> String { +fn default_1935() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1935() -> Integer { +fn default_1936() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1936() -> Option { +fn default_1937() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1937() -> Option { +fn default_1938() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1938() -> Option { +fn default_1939() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1939() -> Option { +fn default_1940() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1940() -> Vec { +fn default_1941() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1941() -> Integer { +fn default_1942() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1942() -> String { +fn default_1943() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1943() -> String { +fn default_1944() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1944() -> Option { +fn default_1945() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1945() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1946() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67454,21 +67467,21 @@ fn default_1947() -> String { fn default_1948() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1949() -> Option { +fn default_1949() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1950() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1950() -> String { +fn default_1951() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1951() -> String { +fn default_1952() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1952() -> Integer { +fn default_1953() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1953() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1954() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67481,45 +67494,45 @@ fn default_1956() -> String { fn default_1957() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1958() -> Integer { +fn default_1958() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1959() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1959() -> String { +fn default_1960() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1960() -> Vec { +fn default_1961() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1961() -> String { +fn default_1962() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1962() -> Integer { +fn default_1963() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1963() -> String { +fn default_1964() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1964() -> Integer { +fn default_1965() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1965() -> String { +fn default_1966() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1966() -> String { +fn default_1967() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1967() -> Integer { +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() -> bool { +fn default_1970() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1970() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1971() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67529,105 +67542,105 @@ fn default_1972() -> String { fn default_1973() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1974() -> Option { +fn default_1974() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1975() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1975() -> String { +fn default_1976() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1976() -> Integer { +fn default_1977() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1977() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1978() -> String { serde_json::from_str("\"\"").expect("schema default") } fn default_1979() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1980() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1980() -> bool { +fn default_1981() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1981() -> Vec { +fn default_1982() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1982() -> std::collections::HashMap { +fn default_1983() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1983() -> String { +fn default_1984() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1984() -> Vec { +fn default_1985() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1985() -> std::collections::HashMap { +fn default_1986() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1986() -> Integer { +fn default_1987() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1987() -> Option { +fn default_1988() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1988() -> String { +fn default_1989() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1989() -> bool { +fn default_1990() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1990() -> Vec { +fn default_1991() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1991() -> Vec { +fn default_1992() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1992() -> std::collections::HashMap { +fn default_1993() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1993() -> Option { +fn default_1994() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1994() -> Vec { +fn default_1995() -> Vec { 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() -> Integer { +fn default_1997() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1997() -> Vec { +fn default_1998() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1998() -> Option { +fn default_1999() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1999() -> Vec { +fn default_2000() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2000() -> Option { +fn default_2001() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2001() -> Option { +fn default_2002() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2002() -> Vec { +fn default_2003() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2003() -> bool { +fn default_2004() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2004() -> Vec { +fn default_2005() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2005() -> bool { +fn default_2006() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2006() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2007() -> Integer { serde_json::from_str("0").expect("schema default") } @@ -67652,12 +67665,12 @@ fn default_2013() -> Integer { fn default_2014() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2015() -> f64 { - serde_json::from_str("0.0").expect("schema default") -} -fn default_2016() -> Integer { +fn default_2015() -> Integer { serde_json::from_str("0").expect("schema default") } +fn default_2016() -> f64 { + serde_json::from_str("0.0").expect("schema default") +} fn default_2017() -> Integer { serde_json::from_str("0").expect("schema default") } @@ -67667,82 +67680,82 @@ fn default_2018() -> Integer { fn default_2019() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2020() -> Option { - serde_json::from_str("null").expect("schema default") +fn default_2020() -> Integer { + serde_json::from_str("0").expect("schema default") } fn default_2021() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2022() -> Vec { +fn default_2022() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_2023() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2023() -> String { +fn default_2024() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2024() -> String { +fn default_2025() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2025() -> Integer { +fn default_2026() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2026() -> Vec> { +fn default_2027() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2027() -> Vec { +fn default_2028() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2028() -> String { +fn default_2029() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2029() -> bool { +fn default_2030() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2030() -> String { +fn default_2031() -> String { serde_json::from_str("\"approval\"").expect("schema default") } -fn default_2031() -> String { +fn default_2032() -> String { serde_json::from_str("\"public\"").expect("schema default") } -fn default_2032() -> BrowseEntryMyStatus { +fn default_2033() -> BrowseEntryMyStatus { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2033() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2034() -> String { serde_json::from_str("\"\"").expect("schema default") } fn default_2035() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2036() -> Integer { +fn default_2036() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2037() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2037() -> String { +fn default_2038() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2038() -> Option { +fn default_2039() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2039() -> Option { +fn default_2040() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2040() -> Vec { +fn default_2041() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2041() -> Option { - serde_json::from_str("null").expect("schema default") -} fn default_2042() -> Option { serde_json::from_str("null").expect("schema default") } fn default_2043() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2044() -> Option> { +fn default_2044() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2045() -> Option { +fn default_2045() -> Option> { serde_json::from_str("null").expect("schema default") } fn default_2046() -> Option { @@ -67757,40 +67770,40 @@ fn default_2048() -> Option { fn default_2049() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2050() -> Option { +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 { +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 { serde_json::from_str("null").expect("schema default") } -fn default_2056() -> Option { +fn default_2056() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2057() -> Option { +fn default_2057() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2058() -> Option { +fn default_2058() -> Option { serde_json::from_str("null").expect("schema default") } fn default_2059() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2060() -> Option> { +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 { @@ -67799,22 +67812,22 @@ fn default_2062() -> Option { fn default_2063() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2064() -> Option { +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 { +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 { @@ -67823,11 +67836,11 @@ fn default_2070() -> Option { fn default_2071() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2072() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_2072() -> Option { + serde_json::from_str("null").expect("schema default") } -fn default_2073() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_2073() -> Integer { + serde_json::from_str("0").expect("schema default") } fn default_2074() -> String { serde_json::from_str("\"\"").expect("schema default") @@ -67838,18 +67851,18 @@ fn default_2075() -> String { fn default_2076() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2077() -> Option { +fn default_2077() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2078() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2078() -> bool { +fn default_2079() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2079() -> Integer { +fn default_2080() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2080() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2081() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67859,129 +67872,129 @@ fn default_2082() -> String { fn default_2083() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2084() -> Option { +fn default_2084() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2085() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2085() -> Option { +fn default_2086() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2086() -> String { +fn default_2087() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2087() -> Vec { +fn default_2088() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2088() -> String { +fn default_2089() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2089() -> String { +fn default_2090() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2090() -> Option { +fn default_2091() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2091() -> Vec { +fn default_2092() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2092() -> Option { +fn default_2093() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2093() -> String { +fn default_2094() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2094() -> bool { +fn default_2095() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2095() -> f64 { +fn default_2096() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2096() -> f64 { +fn default_2097() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2097() -> String { +fn default_2098() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2098() -> Option { +fn default_2099() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2099() -> Integer { +fn default_2100() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2100() -> Integer { +fn default_2101() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2101() -> NamespaceEntryVisibility { +fn default_2102() -> NamespaceEntryVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2102() -> String { +fn default_2103() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2103() -> Option { +fn default_2104() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2104() -> Option { +fn default_2105() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2105() -> Vec { +fn default_2106() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2106() -> MineEntryVisibility { +fn default_2107() -> MineEntryVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2107() -> String { +fn default_2108() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2108() -> String { +fn default_2109() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2109() -> String { +fn default_2110() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2110() -> Option { +fn default_2111() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2111() -> bool { +fn default_2112() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2112() -> bool { +fn default_2113() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2113() -> String { +fn default_2114() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2114() -> NamespaceRegisterOutputVisibility { +fn default_2115() -> NamespaceRegisterOutputVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2115() -> bool { +fn default_2116() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2116() -> Integer { +fn default_2117() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2117() -> Integer { +fn default_2118() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2118() -> bool { +fn default_2119() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2119() -> Vec> { +fn default_2120() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2120() -> Option { +fn default_2121() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2121() -> Option { +fn default_2122() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2122() -> Vec { +fn default_2123() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2123() -> Integer { +fn default_2124() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2124() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2125() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -67994,23 +68007,23 @@ fn default_2127() -> String { fn default_2128() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2129() -> Option { - serde_json::from_str("null").expect("schema default") -} -fn default_2130() -> String { +fn default_2129() -> String { serde_json::from_str("\"\"").expect("schema default") } +fn default_2130() -> Option { + serde_json::from_str("null").expect("schema default") +} fn default_2131() -> String { serde_json::from_str("\"\"").expect("schema default") } fn default_2132() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2133() -> Vec { - serde_json::from_str("[]").expect("schema default") +fn default_2133() -> String { + serde_json::from_str("\"\"").expect("schema default") } -fn default_2134() -> Option { - serde_json::from_str("null").expect("schema default") +fn default_2134() -> Vec { + serde_json::from_str("[]").expect("schema default") } fn default_2135() -> Option { serde_json::from_str("null").expect("schema default") @@ -68021,33 +68034,33 @@ fn default_2136() -> Option { fn default_2137() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2138() -> String { +fn default_2138() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_2139() -> String { serde_json::from_str("\"{}\"").expect("schema default") } -fn default_2139() -> NamespaceSnapshotOutputSnapshotMemoryRowStatus { +fn default_2140() -> NamespaceSnapshotOutputSnapshotMemoryRowStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2140() -> Option { +fn default_2141() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2141() -> Vec { +fn default_2142() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2142() -> String { +fn default_2143() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2143() -> Integer { +fn default_2144() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2144() -> Integer { +fn default_2145() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2145() -> Option { +fn default_2146() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2146() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2147() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -68057,191 +68070,191 @@ fn default_2148() -> String { fn default_2149() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2150() -> Option { +fn default_2150() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2151() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2151() -> f64 { +fn default_2152() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2152() -> Option { +fn default_2153() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2153() -> Option { +fn default_2154() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2154() -> Integer { +fn default_2155() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2155() -> Option { +fn default_2156() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2156() -> Option { +fn default_2157() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2157() -> String { +fn default_2158() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2158() -> Option { +fn default_2159() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2159() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2160() -> String { serde_json::from_str("\"\"").expect("schema default") } fn default_2161() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2162() -> Option { +fn default_2162() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2163() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2163() -> String { +fn default_2164() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2164() -> Option { +fn default_2165() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2165() -> String { +fn default_2166() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2166() -> String { +fn default_2167() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2167() -> Vec { +fn default_2168() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2168() -> Vec { +fn default_2169() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2169() -> Option { +fn default_2170() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2170() -> Integer { +fn default_2171() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2171() -> String { +fn default_2172() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2172() -> Vec { +fn default_2173() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2173() -> Vec { +fn default_2174() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2174() -> String { +fn default_2175() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2175() -> Option { +fn default_2176() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2176() -> Vec { +fn default_2177() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2177() -> Integer { +fn default_2178() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2178() -> Vec { +fn default_2179() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2179() -> Option { +fn default_2180() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2180() -> Vec { +fn default_2181() -> Vec { 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() -> Option { +fn default_2183() -> Option { serde_json::from_str("0").expect("schema default") } -fn default_2183() -> TuneProposalEffect { +fn default_2184() -> TuneProposalEffect { serde_json::from_str("\"future\"").expect("schema default") } -fn default_2184() -> TuneApplyVia { +fn default_2185() -> TuneApplyVia { serde_json::from_str("\"op\"").expect("schema default") } -fn default_2185() -> bool { +fn default_2186() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2186() -> Vec { +fn default_2187() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2187() -> Option { +fn default_2188() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2188() -> Option { +fn default_2189() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2189() -> String { +fn default_2190() -> String { 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() -> Vec { +fn default_2192() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2192() -> Option { +fn default_2193() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2193() -> Option { +fn default_2194() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2194() -> Option { +fn default_2195() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2195() -> String { +fn default_2196() -> String { 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() -> Option { +fn default_2199() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2199() -> Vec { +fn default_2200() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2200() -> bool { +fn default_2201() -> bool { serde_json::from_str("false").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() -> Vec { +fn default_2204() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2204() -> String { +fn default_2205() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2205() -> String { +fn default_2206() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2206() -> Vec> { +fn default_2207() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2207() -> std::collections::HashMap { +fn default_2208() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2208() -> Vec { +fn default_2209() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2209() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2210() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2211() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_2211() -> Integer { + serde_json::from_str("0").expect("schema default") } fn default_2212() -> String { serde_json::from_str("\"\"").expect("schema default") @@ -68249,140 +68262,140 @@ fn default_2212() -> String { fn default_2213() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2214() -> Vec { - serde_json::from_str("[]").expect("schema default") +fn default_2214() -> String { + serde_json::from_str("\"\"").expect("schema default") } fn default_2215() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2216() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_2216() -> Vec { + serde_json::from_str("[]").expect("schema default") } fn default_2217() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2218() -> bool { +fn default_2218() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2219() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2219() -> Integer { +fn default_2220() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2220() -> String { +fn default_2221() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2221() -> Option { +fn default_2222() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2222() -> Vec { +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() -> String { serde_json::from_str("\"\"").expect("schema default") } fn default_2225() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2226() -> Vec { +fn default_2226() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2227() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2227() -> String { +fn default_2228() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2228() -> String { +fn default_2229() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2229() -> std::collections::HashMap { +fn default_2230() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2230() -> String { +fn default_2231() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2231() -> Option { +fn default_2232() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2232() -> Option { +fn default_2233() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2233() -> bool { +fn default_2234() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2234() -> String { +fn default_2235() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2235() -> String { +fn default_2236() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2236() -> Vec { +fn default_2237() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2237() -> Integer { +fn default_2238() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2238() -> String { +fn default_2239() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2239() -> String { +fn default_2240() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2240() -> Option { +fn default_2241() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2241() -> bool { +fn default_2242() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2242() -> String { +fn default_2243() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2243() -> bool { +fn default_2244() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2244() -> String { +fn default_2245() -> String { serde_json::from_str("\"inherit\"").expect("schema default") } -fn default_2245() -> Option { +fn default_2246() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2246() -> Option { +fn default_2247() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2247() -> bool { +fn default_2248() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2248() -> Vec { +fn default_2249() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2249() -> Integer { +fn default_2250() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2250() -> ProcedureEvolveOutputGate { +fn default_2251() -> ProcedureEvolveOutputGate { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2251() -> String { +fn default_2252() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2252() -> f64 { +fn default_2253() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2253() -> std::collections::HashMap { - serde_json::from_str("{}").expect("schema default") -} fn default_2254() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2255() -> std::collections::HashMap { +fn default_2255() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } fn default_2256() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2257() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_2257() -> std::collections::HashMap { + serde_json::from_str("{}").expect("schema default") } -fn default_2258() -> Vec { - serde_json::from_str("[]").expect("schema default") +fn default_2258() -> String { + serde_json::from_str("\"\"").expect("schema default") } fn default_2259() -> Vec { serde_json::from_str("[]").expect("schema default") @@ -68390,138 +68403,138 @@ fn default_2259() -> Vec { fn default_2260() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2261() -> std::collections::HashMap { +fn default_2261() -> Vec { + serde_json::from_str("[]").expect("schema default") +} +fn default_2262() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2262() -> Integer { +fn default_2263() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2263() -> bool { +fn default_2264() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2264() -> std::collections::HashMap { +fn default_2265() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2265() -> Vec { +fn default_2266() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2266() -> std::collections::HashMap { +fn default_2267() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2267() -> String { +fn default_2268() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2268() -> ProcedureLocateOutputStatus { +fn default_2269() -> ProcedureLocateOutputStatus { serde_json::from_str("\"authored\"").expect("schema default") } -fn default_2269() -> Option> { +fn default_2270() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2270() -> Vec>> { +fn default_2271() -> Vec>> { serde_json::from_str("[]").expect("schema default") } -fn default_2271() -> Vec { +fn default_2272() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2272() -> Vec { +fn default_2273() -> Vec { serde_json::from_str("[]").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() -> bool { +fn default_2275() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2275() -> Vec { +fn default_2276() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2276() -> Vec> { +fn default_2277() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2277() -> String { +fn default_2278() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2278() -> std::collections::HashMap { +fn default_2279() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2279() -> std::collections::HashMap { +fn default_2280() -> std::collections::HashMap { 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() -> std::collections::HashMap { +fn default_2282() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2282() -> Option> { +fn default_2283() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2283() -> bool { +fn default_2284() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2284() -> std::collections::HashMap { +fn default_2285() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2285() -> ProcedureMatchStatus { +fn default_2286() -> ProcedureMatchStatus { serde_json::from_str("\"authored\"").expect("schema default") } -fn default_2286() -> Option> { +fn default_2287() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2287() -> Vec { +fn default_2288() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2288() -> Integer { +fn default_2289() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2289() -> Vec> { +fn default_2290() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2290() -> f64 { - serde_json::from_str("0.0").expect("schema default") -} fn default_2291() -> f64 { serde_json::from_str("0.0").expect("schema default") } fn default_2292() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2293() -> Option { +fn default_2293() -> f64 { + serde_json::from_str("0.0").expect("schema default") +} +fn default_2294() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2294() -> std::collections::HashMap { +fn default_2295() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2295() -> std::collections::HashMap> { +fn default_2296() -> std::collections::HashMap> { serde_json::from_str("{}").expect("schema default") } -fn default_2296() -> String { +fn default_2297() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2297() -> Integer { +fn default_2298() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2298() -> String { +fn default_2299() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2299() -> f64 { +fn default_2300() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2300() -> Vec { +fn default_2301() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2301() -> ProcedureReviseOutputOutcome { +fn default_2302() -> ProcedureReviseOutputOutcome { serde_json::from_str("\"opened\"").expect("schema default") } -fn default_2302() -> Vec { +fn default_2303() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2303() -> Vec { +fn default_2304() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2304() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2305() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -68531,54 +68544,54 @@ fn default_2306() -> String { fn default_2307() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2308() -> Option { +fn default_2308() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2309() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2309() -> Integer { +fn default_2310() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2310() -> Vec { +fn default_2311() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2311() -> std::collections::HashMap { +fn default_2312() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2312() -> Option { +fn default_2313() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2313() -> String { +fn default_2314() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2314() -> Integer { +fn default_2315() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2315() -> String { +fn default_2316() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2316() -> String { +fn default_2317() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2317() -> std::collections::HashMap { +fn default_2318() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2318() -> String { +fn default_2319() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2319() -> String { +fn default_2320() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2320() -> Option { +fn default_2321() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2321() -> RunBeginOutputStatus { +fn default_2322() -> RunBeginOutputStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2322() -> String { +fn default_2323() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2323() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2324() -> Integer { serde_json::from_str("0").expect("schema default") } @@ -68588,47 +68601,47 @@ fn default_2325() -> Integer { fn default_2326() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2327() -> Vec { +fn default_2327() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_2328() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2328() -> Integer { +fn default_2329() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_2329() -> Integer { +fn default_2330() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2330() -> Integer { +fn default_2331() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2331() -> String { +fn default_2332() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2332() -> String { +fn default_2333() -> String { serde_json::from_str("\"keep\"").expect("schema default") } -fn default_2333() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2334() -> Integer { serde_json::from_str("0").expect("schema default") } fn default_2335() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2336() -> Option { +fn default_2336() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_2337() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2337() -> Integer { +fn default_2338() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_2338() -> Vec { - serde_json::from_str("[]").expect("schema default") -} fn default_2339() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2340() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_2340() -> Vec { + serde_json::from_str("[]").expect("schema default") } fn default_2341() -> Integer { serde_json::from_str("0").expect("schema default") @@ -68636,42 +68649,42 @@ fn default_2341() -> Integer { fn default_2342() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2343() -> f64 { +fn default_2343() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_2344() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2344() -> Integer { +fn default_2345() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2345() -> Vec { +fn default_2346() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2346() -> Integer { +fn default_2347() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2347() -> Vec { +fn default_2348() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2348() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2349() -> Integer { serde_json::from_str("0").expect("schema default") } fn default_2350() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2351() -> Vec { +fn default_2351() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_2352() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2352() -> Option { +fn default_2353() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2353() -> String { +fn default_2354() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2354() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2355() -> Integer { serde_json::from_str("0").expect("schema default") } @@ -68681,33 +68694,33 @@ fn default_2356() -> Integer { fn default_2357() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2358() -> bool { - serde_json::from_str("false").expect("schema default") +fn default_2358() -> Integer { + serde_json::from_str("0").expect("schema default") } fn default_2359() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2360() -> Option> { +fn default_2360() -> bool { + serde_json::from_str("false").expect("schema default") +} +fn default_2361() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2361() -> LiveSearchResultsLive { +fn default_2362() -> LiveSearchResultsLive { serde_json::from_str("true").expect("schema default") } -fn default_2362() -> String { +fn default_2363() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2363() -> LiveSearchHitLive { +fn default_2364() -> LiveSearchHitLive { serde_json::from_str("true").expect("schema default") } -fn default_2364() -> Vec { +fn default_2365() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2365() -> Option { +fn default_2366() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2366() -> std::collections::HashMap { - serde_json::from_str("{}").expect("schema default") -} fn default_2367() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } @@ -68717,24 +68730,24 @@ fn default_2368() -> std::collections::HashMap { fn default_2369() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2370() -> Option> { +fn default_2370() -> std::collections::HashMap { + serde_json::from_str("{}").expect("schema default") +} +fn default_2371() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2371() -> Vec { +fn default_2372() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2372() -> Integer { +fn default_2373() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2373() -> String { +fn default_2374() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2374() -> Integer { +fn default_2375() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2375() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2376() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -68756,60 +68769,60 @@ fn default_2381() -> String { fn default_2382() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2383() -> Vec { +fn default_2383() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2384() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2384() -> String { +fn default_2385() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2385() -> String { +fn default_2386() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2386() -> Vec { +fn default_2387() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2387() -> String { +fn default_2388() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2388() -> String { +fn default_2389() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2389() -> Vec { +fn default_2390() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2390() -> Vec { +fn default_2391() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2391() -> Vec { +fn default_2392() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2392() -> String { +fn default_2393() -> String { 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() -> Vec { +fn default_2395() -> Vec { 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() -> Vec { +fn default_2397() -> Vec { 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() -> String { +fn default_2399() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2399() -> Option { +fn default_2400() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2400() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2401() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -68825,15 +68838,15 @@ fn default_2404() -> String { fn default_2405() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2406() -> Vec { +fn default_2406() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2407() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2407() -> Option { +fn default_2408() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2408() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_2409() -> Integer { serde_json::from_str("0").expect("schema default") } @@ -68846,11 +68859,11 @@ fn default_2411() -> Integer { fn default_2412() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2413() -> bool { - serde_json::from_str("false").expect("schema default") +fn default_2413() -> Integer { + serde_json::from_str("0").expect("schema default") } -fn default_2414() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_2414() -> bool { + serde_json::from_str("false").expect("schema default") } fn default_2415() -> String { serde_json::from_str("\"\"").expect("schema default") @@ -68870,21 +68883,21 @@ fn default_2419() -> String { fn default_2420() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2421() -> Option { +fn default_2421() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2422() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2422() -> Integer { +fn default_2423() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2423() -> Integer { +fn default_2424() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2424() -> Vec { +fn default_2425() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2425() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2426() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -68894,8 +68907,8 @@ fn default_2427() -> String { fn default_2428() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2429() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_2429() -> String { + serde_json::from_str("\"\"").expect("schema default") } fn default_2430() -> Integer { serde_json::from_str("0").expect("schema default") @@ -68909,32 +68922,32 @@ fn default_2432() -> Integer { fn default_2433() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2434() -> f64 { - serde_json::from_str("0.0").expect("schema default") -} -fn default_2435() -> Integer { +fn default_2434() -> Integer { serde_json::from_str("0").expect("schema default") } +fn default_2435() -> f64 { + serde_json::from_str("0.0").expect("schema default") +} fn default_2436() -> Integer { serde_json::from_str("0").expect("schema default") } fn default_2437() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2438() -> String { +fn default_2438() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_2439() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2439() -> SessionBriefStats { +fn default_2440() -> 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_2440() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2441() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2442() -> Option { - serde_json::from_str("null").expect("schema default") +fn default_2442() -> String { + serde_json::from_str("\"\"").expect("schema default") } fn default_2443() -> Option { serde_json::from_str("null").expect("schema default") @@ -68942,57 +68955,57 @@ fn default_2443() -> Option { fn default_2444() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2445() -> Integer { +fn default_2445() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_2446() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2446() -> std::collections::HashMap { +fn default_2447() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2447() -> String { +fn default_2448() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2448() -> String { +fn default_2449() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2449() -> Option { +fn default_2450() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2450() -> String { +fn default_2451() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2451() -> Integer { +fn default_2452() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2452() -> Integer { +fn default_2453() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2453() -> Option { +fn default_2454() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2454() -> std::collections::HashMap { +fn default_2455() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2455() -> String { +fn default_2456() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2456() -> Integer { +fn default_2457() -> Integer { serde_json::from_str("0").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() -> Option { +fn default_2461() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2461() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2462() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -69002,327 +69015,327 @@ fn default_2463() -> String { fn default_2464() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2465() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_2465() -> String { + serde_json::from_str("\"\"").expect("schema default") } fn default_2466() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2467() -> String { +fn default_2467() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_2468() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2468() -> std::collections::HashMap { +fn default_2469() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2469() -> String { +fn default_2470() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2470() -> String { +fn default_2471() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2471() -> bool { +fn default_2472() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2472() -> String { +fn default_2473() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2473() -> std::collections::HashMap { +fn default_2474() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2474() -> Vec> { +fn default_2475() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2475() -> Vec { +fn default_2476() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2476() -> Vec { +fn default_2477() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2477() -> bool { +fn default_2478() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2478() -> String { +fn default_2479() -> String { serde_json::from_str("\"unknown\"").expect("schema default") } -fn default_2479() -> String { +fn default_2480() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2480() -> Vec { +fn default_2481() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2481() -> bool { +fn default_2482() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2482() -> String { +fn default_2483() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2483() -> bool { +fn default_2484() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2484() -> Vec { +fn default_2485() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2485() -> std::collections::HashMap { +fn default_2486() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2486() -> Vec> { +fn default_2487() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2487() -> bool { +fn default_2488() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2488() -> bool { +fn default_2489() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2489() -> Vec> { +fn default_2490() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2490() -> std::collections::HashMap { +fn default_2491() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2491() -> String { +fn default_2492() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2492() -> Vec> { +fn default_2493() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2493() -> bool { +fn default_2494() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2494() -> String { +fn default_2495() -> String { serde_json::from_str("\"calibrated\"").expect("schema default") } -fn default_2495() -> std::collections::HashMap { +fn default_2496() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2496() -> std::collections::HashMap { +fn default_2497() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2497() -> String { +fn default_2498() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2498() -> std::collections::HashMap { +fn default_2499() -> std::collections::HashMap { 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() -> std::collections::HashMap { +fn default_2501() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2501() -> String { +fn default_2502() -> String { serde_json::from_str("\"ok\"").expect("schema default") } -fn default_2502() -> String { +fn default_2503() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2503() -> String { +fn default_2504() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2504() -> bool { +fn default_2505() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2505() -> Integer { +fn default_2506() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2506() -> String { +fn default_2507() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2507() -> String { +fn default_2508() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2508() -> Vec { +fn default_2509() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2509() -> bool { +fn default_2510() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2510() -> Vec { +fn default_2511() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2511() -> std::collections::HashMap> { +fn default_2512() -> std::collections::HashMap> { serde_json::from_str("{}").expect("schema default") } -fn default_2512() -> Vec> { +fn default_2513() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2513() -> Vec> { +fn default_2514() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2514() -> String { +fn default_2515() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2515() -> Vec> { +fn default_2516() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2516() -> std::collections::HashMap { +fn default_2517() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2517() -> String { +fn default_2518() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2518() -> Vec> { +fn default_2519() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2519() -> bool { +fn default_2520() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2520() -> Integer { +fn default_2521() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2521() -> Vec> { +fn default_2522() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2522() -> String { +fn default_2523() -> String { serde_json::from_str("\"no_flaky_signal\"").expect("schema default") } -fn default_2523() -> bool { +fn default_2524() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2524() -> Option> { +fn default_2525() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2525() -> Vec { +fn default_2526() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2526() -> bool { +fn default_2527() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2527() -> std::collections::HashMap { +fn default_2528() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2528() -> String { +fn default_2529() -> String { serde_json::from_str("\"not_computed\"").expect("schema default") } -fn default_2529() -> Vec> { +fn default_2530() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2530() -> String { +fn default_2531() -> String { serde_json::from_str("\"candidate\"").expect("schema default") } -fn default_2531() -> std::collections::HashMap { +fn default_2532() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2532() -> String { +fn default_2533() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2533() -> bool { +fn default_2534() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2534() -> Integer { +fn default_2535() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2535() -> std::collections::HashMap { +fn default_2536() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2536() -> bool { +fn default_2537() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2537() -> Vec> { +fn default_2538() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2538() -> std::collections::HashMap { +fn default_2539() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2539() -> std::collections::HashMap { +fn default_2540() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2540() -> String { +fn default_2541() -> String { serde_json::from_str("\"lower_bound\"").expect("schema default") } -fn default_2541() -> bool { +fn default_2542() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2542() -> Vec { +fn default_2543() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2543() -> Vec> { +fn default_2544() -> Vec> { serde_json::from_str("[]").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() -> Vec { +fn default_2546() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2546() -> String { +fn default_2547() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2547() -> bool { +fn default_2548() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2548() -> bool { +fn default_2549() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2549() -> std::collections::HashMap { +fn default_2550() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2550() -> String { +fn default_2551() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2551() -> bool { +fn default_2552() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2552() -> std::collections::HashMap { +fn default_2553() -> std::collections::HashMap { 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() -> Vec { +fn default_2556() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2556() -> std::collections::HashMap { +fn default_2557() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2557() -> Vec> { +fn default_2558() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2558() -> bool { +fn default_2559() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2559() -> bool { +fn default_2560() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2560() -> Vec { +fn default_2561() -> Vec { serde_json::from_str("[]").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() -> String { +fn default_2563() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2563() -> std::collections::HashMap { +fn default_2564() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2564() -> bool { +fn default_2565() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2565() -> bool { +fn default_2566() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2566() -> String { +fn default_2567() -> String { serde_json::from_str("\"no_signal\"").expect("schema default") } -fn default_2567() -> Vec { +fn default_2568() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2568() -> f64 { +fn default_2569() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2569() -> Integer { +fn default_2570() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2570() -> String { +fn default_2571() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2571() -> std::collections::HashMap { - serde_json::from_str("{}").expect("schema default") -} fn default_2572() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } @@ -69332,18 +69345,18 @@ fn default_2573() -> std::collections::HashMap { fn default_2574() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2575() -> String { +fn default_2575() -> std::collections::HashMap { + serde_json::from_str("{}").expect("schema default") +} +fn default_2576() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2576() -> std::collections::HashMap { +fn default_2577() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2577() -> bool { +fn default_2578() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2578() -> std::collections::HashMap { - serde_json::from_str("{}").expect("schema default") -} fn default_2579() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } @@ -69353,54 +69366,57 @@ fn default_2580() -> std::collections::HashMap { fn default_2581() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2582() -> String { +fn default_2582() -> std::collections::HashMap { + serde_json::from_str("{}").expect("schema default") +} +fn default_2583() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2583() -> Vec> { +fn default_2584() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2584() -> Integer { +fn default_2585() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2585() -> String { +fn default_2586() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2586() -> bool { +fn default_2587() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2587() -> String { +fn default_2588() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2588() -> Vec { +fn default_2589() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2589() -> bool { +fn default_2590() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2590() -> Vec { +fn default_2591() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2591() -> f64 { +fn default_2592() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2592() -> String { +fn default_2593() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2593() -> Integer { +fn default_2594() -> Integer { serde_json::from_str("4096").expect("schema default") } -fn default_2594() -> Integer { +fn default_2595() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2595() -> Option { +fn default_2596() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2596() -> f64 { +fn default_2597() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2597() -> Option { +fn default_2598() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2598() -> Vec { +fn default_2599() -> 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 0bf7befe97b..120c256a581 100644 --- a/sdk/typescript/src/generated/ops.ts +++ b/sdk/typescript/src/generated/ops.ts @@ -7049,6 +7049,7 @@ export interface MemoryProposalsInput { namespace: string; prefix?: string; tags?: string[]; + memory_keys?: string[]; only?: "" | "ready"; limit?: number; count_only?: boolean; @@ -7059,6 +7060,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/memory/api/models_proposals.py b/server/memory/api/models_proposals.py index 6d11d88a1bd..c7149befdc8 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,6 +26,11 @@ 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; empty lists every proposal. `limit` still + # applies and `total` counts the matching rows before it. + 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"] = "" @@ -39,8 +44,13 @@ class MemoryProposalsInput(BaseModel): 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 recorded it from the token: `human:` or + # `process:`. `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 1a1e92e90d7..fe46ad6c5be 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,10 @@ 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. + keys = _asked_keys(input) + if len(ch_params.fitting(keys)) < len(keys): + raise ValidationError("memory_keys is too long for one read; send fewer keys") ch = get_client() if input.count_only: return MemoryProposalsOutput( @@ -74,7 +87,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 +111,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 aa39ac5db50..8d1593744dd 100644 --- a/server/transport/mcp_descriptions.py +++ b/server/transport/mcp_descriptions.py @@ -916,10 +916,11 @@ def revision_policy(update: str) -> str: "the grade; a regrade replaces the verdict." ), "memory.proposals": ( - "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." + "List facts on trial (written with memory.set proposed=true) with who " + "proposed each (`actor`), the graded runs that relied on it — passes, " + "fails — and what the namespace's proposal policy says (`ready`: " + "accept / reject). `memory_keys` lists named keys only; `count_only` " + "answers just how many wait." ), "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 a635475a06b..773a125ac6c 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 e5fe6675a42..26b76f2b986 100644 --- a/tests/analyzer/shapes.txt +++ b/tests/analyzer/shapes.txt @@ -739,7 +739,6 @@ 541a4c06fca2 SELECT agent, user_id, session_id, memory_key, memory_type, content_excerpt, created_at, valid_at, version, status FROM ( SELECT agent, user_id, session_id, memory_key, memory_type, content_excerpt, t 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 = ? 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)} @@ -1016,7 +1015,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, 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)} 72f06cf9707b SELECT count() AS n FROM loom.memory_record_conflicts FINAL WHERE org = {org:String} AND tombstoned_at IS NULL AND namespace = {ns:String} @@ -1425,6 +1423,7 @@ 9e328bb12721 SELECT count() AS n FROM loom.learnings_queue WHERE org = {org:String} AND namespace IN {ns:Array(String)} AND ? 9e49c20a4fc8 SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, e.status AS status, e.version AS version, -- Multi-vector axis: min(value_dist, key_dist). CH?t g 9e7b47b91e9c SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, e.status AS status, e.version AS version, -- Multi-vector axis: min(value_dist, key_dist). CH?t g +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 = ? @@ -1728,6 +1727,7 @@ bc2fa2b83f5e SELECT org, namespace, agent, user_id, session_id, memory_id, memor bc5126e6ac2f SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, e.status AS status, e.version AS version, -- Multi-vector axis: min(value_dist, key_dist). CH?t g bc80814b4c3b SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, e.status AS status, e.version AS version, -- Multi-vector axis: min(value_dist, key_dist). CH?t g 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)} @@ -1845,7 +1845,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}) @@ -2368,6 +2367,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 00000000000..66cd452a360 --- /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_proposal_triage.py b/tests/unit/test_proposal_triage.py new file mode 100644 index 00000000000..326fbdd6027 --- /dev/null +++ b/tests/unit/test_proposal_triage.py @@ -0,0 +1,157 @@ +"""`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 repeated key is asked once: it 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"] + + +@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) + keys = [f"{i:03d}" + "k" * 400 for i in range(500)] + assert len(ch_params.fitting(keys)) < len(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 == [] From 1f653bda55b74f15bb517b4d1e6c7f65ea5b9c29 Mon Sep 17 00:00:00 2001 From: Mohammad Lareb Zafar Date: Fri, 4 Dec 2026 20:13:14 +0000 Subject: [PATCH 2/6] memory.proposals refuses one key too long for a parameter, and the review names its key Server: - `memory.proposals` measures the whole `memory_keys` parameter as the driver renders it (`ch_params.fits`) and refuses with a 422 what does not fit, one key included. The comparison of chunk lengths passed a lone key of any size, since `chunks` yields a value longer than the bound alone, and ClickHouse answered a field over its limit with an error the transport serves as a 500. - The `count_only` comment names `memory_keys`, which the count narrows by. The `actor` comment names a pipeline's own actor, which comes from no token. - The op's description names `actor` in its second sentence. Its first sentence fits the 200 characters of the generated summary, and the whole text fits the 280 of the compact MCP description. Dashboard: - The read of the key in the address changes nothing when the address names another key, or none, by the time it answers. A review opened by a click while that read is out stays open with its own text, and a failure of that read raises no toast. - The review names the key it decides, first among its facts. A review opened from the address has no row on screen behind it to name the key. - The panel passes the typed reason with either decision, and `decideProposals` alone drops it from an acceptance. - `matches` and `fromAddress` replace two names that shadowed `held` and `linked`, and the comments on the shared `tab` parameter say "it", not "the key". Docs: the address takes the key percent-encoded, the review shows the key, and `actor` can be a pipeline's own actor. Tests: a lone key over the bound, alone and named twice, is refused for the list and the count; 500 copies of one key are asked as one; `fits` at its boundary and with escaped quotes; the late read of the address's key answering with a match, with no match and with a failure; the posted body of an acceptance holds no reason. Co-Authored-By: Claude Fable 5.2 Signed-off-by: Mohammad Lareb Zafar --- docs/features/dashboard.md | 3 +- docs/features/memory/writing.md | 23 +++--- docs/reference/operations.md | 2 +- docs/reference/operations/memory.md | 4 +- frontend/src/api/review.ts | 4 +- frontend/src/views/Setup.tsx | 2 +- frontend/src/views/admin/Proposals.test.tsx | 89 ++++++++++++++++++--- frontend/src/views/admin/Proposals.tsx | 33 ++++---- frontend/src/views/admin/ReviewQueue.tsx | 2 +- server/core/ch_params.py | 5 ++ server/memory/api/models_proposals.py | 11 ++- server/memory/app/proposals_ops.py | 5 +- server/transport/mcp_descriptions.py | 10 +-- tests/unit/test_ch_params.py | 15 +++- tests/unit/test_proposal_triage.py | 28 ++++--- 15 files changed, 167 insertions(+), 69 deletions(-) diff --git a/docs/features/dashboard.md b/docs/features/dashboard.md index 0d7821098c1..ccff4a51f59 100644 --- a/docs/features/dashboard.md +++ b/docs/features/dashboard.md @@ -466,7 +466,8 @@ decision that returns after it is not cached. The minute's polls read the cache. 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=` opens the pending proposal under that key. Usage warns when the +`/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 b21f2a169c7..55e25ea5cbd 100644 --- a/docs/features/memory/writing.md +++ b/docs/features/memory/writing.md @@ -343,11 +343,13 @@ proposal ready for review. With `proposal_policy.mode="auto"`, `reject_after_fai 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 -from the token (`human:` or `process:`), beside `agent`, the label the -writing client sent. `memory_keys` (at most 500 keys) 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`. +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) 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. @@ -358,11 +360,12 @@ records the reviewer's identity and content hash. Pending review survives reject 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?tab=proposals` lists each proposal with who proposed it. A -proposal's key opens its review, and `&key=` in the address opens the pending proposal -under that key. The review shows 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. +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/reference/operations.md b/docs/reference/operations.md index 48bcf2bc765..afcfd662669 100644 --- a/docs/reference/operations.md +++ b/docs/reference/operations.md @@ -536,7 +536,7 @@ Fields for every `memory` op: [operations/memory.md](operations/memory.md). | [`memory.pin`](operations/memory.md#memorypin) | WHAT: Save a standing fact and protect it. | writer | idempotent | yes | | | [`memory.promote`](operations/memory.md#memorypromote) | Promote a single source memory to the namespace's shared layer. | admin | write | no | yes | | [`memory.proposal_decide`](operations/memory.md#memoryproposal_decide) | Accept (→ active, served by default) or reject a list of proposals. | admin | idempotent | no | yes | -| [`memory.proposals`](operations/memory.md#memoryproposals) | List facts on trial (written with memory.set proposed=true) with who proposed each (`actor`), the graded runs that relied on it — passes, fails — and what the namespace's proposal policy says… | viewer | read | no | | +| [`memory.proposals`](operations/memory.md#memoryproposals) | 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). | viewer | read | no | | | [`memory.provenance`](operations/memory.md#memoryprovenance) | Resolve a memory's origin for user-facing provenance. | viewer | read | yes | | | [`memory.recall`](operations/memory.md#memoryrecall) | Search the raw conversation turns behind this namespace's memories — the messages `memory.set_from_messages` extracted from — by text and by time. | viewer | read | yes | | | [`memory.record.conflicts`](operations/memory.md#memoryrecordconflicts) | Field-level disagreements recorded when a typed record superseded the active record for its logical key: which field, both values, both record ids and both citing memories. | viewer | read | no | | diff --git a/docs/reference/operations/memory.md b/docs/reference/operations/memory.md index 9fb3e85a831..c1275211836 100644 --- a/docs/reference/operations/memory.md +++ b/docs/reference/operations/memory.md @@ -1555,7 +1555,7 @@ Accept (→ active, served by default) or reject a list of proposals. ## `memory.proposals` -List facts on trial (written with memory.set proposed=true) with who proposed each (`actor`), the graded runs that relied on it — passes, fails — and what the namespace's proposal policy says… +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). `POST /v1/memory.proposals` · MCP `loom_memory_proposals` · role `viewer` · read · not listed under the MCP `all` toolset @@ -1568,7 +1568,7 @@ List facts on trial (written with memory.set proposed=true) with who proposed ea | `memory_keys` | `list[str]` | *(computed)* | Only pending proposals under these keys; 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/src/api/review.ts b/frontend/src/api/review.ts index a7a73405498..1219de58be4 100644 --- a/frontend/src/api/review.ts +++ b/frontend/src/api/review.ts @@ -162,8 +162,8 @@ export interface MemoryProposal { memory_key: string; memory_id: string; agent: string; - /** Who proposed it (`human:`, `process:`); absent from a server a - * release behind. */ + /** 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; diff --git a/frontend/src/views/Setup.tsx b/frontend/src/views/Setup.tsx index 07d4f61c089..9e97f552a4c 100644 --- a/frontend/src/views/Setup.tsx +++ b/frontend/src/views/Setup.tsx @@ -71,7 +71,7 @@ export function Setup() { const navSeq = useStore((s) => s.navSeq); useEffect(() => { const sync = () => { - // The Review queue owns `tab` too, and a navigation carries the key between the two pages. + // 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()); }; diff --git a/frontend/src/views/admin/Proposals.test.tsx b/frontend/src/views/admin/Proposals.test.tsx index a26121b4f72..babbe4af8d5 100644 --- a/frontend/src/views/admin/Proposals.test.tsx +++ b/frontend/src/views/admin/Proposals.test.tsx @@ -56,6 +56,7 @@ beforeEach(() => { }); afterEach(() => { cleanup(); + vi.unstubAllGlobals(); vi.resetAllMocks(); vi.mocked(api.decideProposals).mockImplementation(async () => ({ decided: 1, results: [] })); }); @@ -102,6 +103,28 @@ function showLinked(key: string, rows: MemoryProposal[], keyed: Listed | Error) 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']"); @@ -134,9 +157,13 @@ describe("ProposalsPanel", () => { expect(api.decideProposals).not.toHaveBeenCalled(); await userEvent.click(screen.getByRole("button", { name: "Accept reviewed fact" })); await waitFor(() => - expect(api.decideProposals).toHaveBeenCalledWith(SCOPE, ["deploy_window"], "accept", { - deploy_window: P.content_sha256, - }), + expect(api.decideProposals).toHaveBeenCalledWith( + SCOPE, + ["deploy_window"], + "accept", + { deploy_window: P.content_sha256 }, + "", + ), ); expect(await screen.findByText("No proposals")).toBeInTheDocument(); }); @@ -172,9 +199,13 @@ describe("ProposalsPanel", () => { 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(SCOPE, [P.memory_key], "accept", { - [P.memory_key]: currentHash, - }), + expect(api.decideProposals).toHaveBeenCalledWith( + SCOPE, + [P.memory_key], + "accept", + { [P.memory_key]: currentHash }, + "", + ), ); }); @@ -276,6 +307,7 @@ describe("ProposalsPanel", () => { 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"); @@ -341,18 +373,26 @@ describe("ProposalsPanel", () => { }); 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(api.decideProposals).toHaveBeenCalledTimes(1)); - expect(vi.mocked(api.decideProposals).mock.calls[0]).toEqual([ - SCOPE, - ["deploy_window"], - "accept", - { deploy_window: P.content_sha256 }, - ]); + 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 key two proposals hold opens with neither decision available", async () => { @@ -401,6 +441,8 @@ describe("ProposalsPanel", () => { 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); @@ -467,6 +509,27 @@ describe("ProposalsPanel", () => { expect(screen.queryByRole("dialog")).toBeNull(); }); + // The address names key_a, and its read is still out when a click opens key_b. + 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 the review opened meanwhile", 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("key_b"); + await answer(late); + expect(screen.getByRole("dialog", { name: "Review proposal" })).toBe(dialog); + expect(fact(dialog, "Key")).toHaveTextContent("key_b"); + expect(within(dialog).getByText("The complete proposal text")).toBeInTheDocument(); + expect(address()).toBe(`${HOME}&key=key_b`); + 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]); diff --git a/frontend/src/views/admin/Proposals.tsx b/frontend/src/views/admin/Proposals.tsx index d3a3833bf03..e8a3cf53fdc 100644 --- a/frontend/src/views/admin/Proposals.tsx +++ b/frontend/src/views/admin/Proposals.tsx @@ -74,8 +74,8 @@ export function ProposalsPanel() { // decision, or with no row behind it (the address opened it), the panel takes it. const focusPanel = useRef(false); - const openReview = async (proposal: MemoryProposal, linked = false) => { - focusPanel.current = linked; + const openReview = async (proposal: MemoryProposal, fromAddress = false) => { + focusPanel.current = fromAddress; setNotice(null); setReason(""); setReview({ proposal }); @@ -144,24 +144,27 @@ export function ProposalsPanel() { setReview(null); return; } + // A row opened or closed while this read is out rewrites the address, and the answer + // for a key the address does not name changes nothing. + const named = () => live() && urlParam("key") === 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 (!live()) return; + if (!named()) return; // Matched by key here: a server a release behind answers its whole list. - const held = r.proposals.filter((p) => p.memory_key === key); - if (held.length === 1) return void openReview(held[0], true); + const matches = r.proposals.filter((p) => p.memory_key === key); + if (matches.length === 1) return void openReview(matches[0], true); setReview(null); setNotice( - held.length > 1 - ? `${held.length} pending proposals hold this key, so this link opens none of them.` + 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) => live() && toastError("Couldn't open the proposal", e, { read: true })); + .catch((e) => named() && toastError("Couldn't open the proposal", e, { read: true })); }, [identity.org, identity.namespace, linked], ); @@ -169,14 +172,11 @@ export function ProposalsPanel() { 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 binds either decision to it. + // The hash served with the text on screen goes with either decision. const read = { [key]: review.row.content_sha256 }; setBusy(true); try { - const r = - decision === "accept" - ? await decideProposals(scope, [key], decision, read) - : await decideProposals(scope, [key], decision, read, reason.trim()); + 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 })); @@ -350,8 +350,8 @@ export function ProposalsPanel() { ); } -/** What the reviewer weighs before the text: who proposed it, through which agent, since - * when, and how the graded runs that used its key went. */ +/** 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. @@ -359,6 +359,9 @@ function ProposalFacts({ proposal, reader }: { proposal: MemoryProposal; reader: const graded = proposal.graded_passes + proposal.graded_fails > 0; return ( + + {proposal.memory_key} + {actor && ( diff --git a/frontend/src/views/admin/ReviewQueue.tsx b/frontend/src/views/admin/ReviewQueue.tsx index cfe0fd1d10d..7a861c2c80a 100644 --- a/frontend/src/views/admin/ReviewQueue.tsx +++ b/frontend/src/views/admin/ReviewQueue.tsx @@ -152,7 +152,7 @@ export function ReviewQueue() { const navSeq = useStore((s) => s.navSeq); useEffect(() => { const sync = () => { - // Settings owns `tab` too, and a navigation carries the key between the two pages. + // 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; diff --git a/server/core/ch_params.py b/server/core/ch_params.py index 533c26ead51..05bbb6249af 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 c7149befdc8..b143807d939 100644 --- a/server/memory/api/models_proposals.py +++ b/server/memory/api/models_proposals.py @@ -36,8 +36,9 @@ class MemoryProposalsInput(BaseModel): 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 @@ -48,8 +49,10 @@ class MemoryProposal(BaseModel): # (memory.get_by_id). content_sha256: str = "" agent: str = "" - # Who proposed it, as the server recorded it from the token: `human:` or - # `process:`. `agent` is the label the writing client sent. + # 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). diff --git a/server/memory/app/proposals_ops.py b/server/memory/app/proposals_ops.py index fe46ad6c5be..c40c6f2fd66 100644 --- a/server/memory/app/proposals_ops.py +++ b/server/memory/app/proposals_ops.py @@ -74,9 +74,8 @@ async def handle_memory_proposals(input: MemoryProposalsInput) -> MemoryProposal 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. - keys = _asked_keys(input) - if len(ch_params.fitting(keys)) < len(keys): - raise ValidationError("memory_keys is too long for one read; send fewer keys") + 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( diff --git a/server/transport/mcp_descriptions.py b/server/transport/mcp_descriptions.py index 8d1593744dd..3c46df35904 100644 --- a/server/transport/mcp_descriptions.py +++ b/server/transport/mcp_descriptions.py @@ -916,11 +916,11 @@ def revision_policy(update: str) -> str: "the grade; a regrade replaces the verdict." ), "memory.proposals": ( - "List facts on trial (written with memory.set proposed=true) with who " - "proposed each (`actor`), the graded runs that relied on it — passes, " - "fails — and what the namespace's proposal policy says (`ready`: " - "accept / reject). `memory_keys` lists named keys only; `count_only` " - "answers just how many wait." + "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). " + "`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/unit/test_ch_params.py b/tests/unit/test_ch_params.py index a1e40c25b79..2b41b86b680 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 index 326fbdd6027..28a56af39cc 100644 --- a/tests/unit/test_proposal_triage.py +++ b/tests/unit/test_proposal_triage.py @@ -95,11 +95,16 @@ async def test_memory_keys_lists_only_those_pending_keys(listing: Any) -> None: _row(_B, "asked_and_decided", status="active"), _row(_C, "not_asked"), ] - # A repeated key is asked once: it lists its row once. + # 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"] + 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 @@ -139,14 +144,17 @@ def no_client() -> Any: raise AssertionError("the refusal reads nothing") monkeypatch.setattr(proposals_ops, "get_client", no_client) - keys = [f"{i:03d}" + "k" * 400 for i in range(500)] - assert len(ch_params.fitting(keys)) < len(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) + 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: From b90747f95f1dca20fa38a005026b37af7d7a683f Mon Sep 17 00:00:00 2001 From: Mohammad Lareb Zafar Date: Fri, 4 Dec 2026 21:12:10 +0000 Subject: [PATCH 3/6] Dismissing the Proposals notice focuses the panel, and a late read of an open review's key changes nothing Dashboard: - Dismissing the notice above the Proposals table focuses the panel, the wrapper a decision hands the focus to. The notice unmounts with the button that dismissed it, which left the focus on the page body. - The read of the key in the address changes nothing when a review of that key is open by the time it answers. The check of the address passed that answer, since the address still names the key: a match opened the review again, which cleared a typed reason and read the text a second time (a second `memory.sensitive_read` audit row for a `high` proposal), no match or several closed it under a notice, and a failure raised a toast. The panel keeps the key under review in a ref for that check. Docs: the Proposals section names both bounds of `memory_keys`, 500 keys and one 64 KiB parameter, and the 422 a list over either answers. Tests: the dismissed notice leaves the focus on the panel; the late read of the address's key, answering with a match, with no match and with a failure, also runs with the review of that same key opened by a click, and every case keeps the typed reason. Co-Authored-By: Claude Fable 5.2 Signed-off-by: Mohammad Lareb Zafar --- docs/features/memory/writing.md | 11 ++--- frontend/src/views/admin/Proposals.test.tsx | 45 ++++++++++++--------- frontend/src/views/admin/Proposals.tsx | 15 ++++--- 3 files changed, 42 insertions(+), 29 deletions(-) diff --git a/docs/features/memory/writing.md b/docs/features/memory/writing.md index 55e25ea5cbd..340299544f4 100644 --- a/docs/features/memory/writing.md +++ b/docs/features/memory/writing.md @@ -345,11 +345,12 @@ 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) 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`. +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. diff --git a/frontend/src/views/admin/Proposals.test.tsx b/frontend/src/views/admin/Proposals.test.tsx index babbe4af8d5..f4c2ee1d3e9 100644 --- a/frontend/src/views/admin/Proposals.test.tsx +++ b/frontend/src/views/admin/Proposals.test.tsx @@ -474,6 +474,8 @@ describe("ProposalsPanel", () => { 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 () => { @@ -509,25 +511,30 @@ describe("ProposalsPanel", () => { expect(screen.queryByRole("dialog")).toBeNull(); }); - // The address names key_a, and its read is still out when a click opens key_b. - 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 the review opened meanwhile", 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("key_b"); - await answer(late); - expect(screen.getByRole("dialog", { name: "Review proposal" })).toBe(dialog); - expect(fact(dialog, "Key")).toHaveTextContent("key_b"); - expect(within(dialog).getByText("The complete proposal text")).toBeInTheDocument(); - expect(address()).toBe(`${HOME}&key=key_b`); - expect(api.getMemoryById).toHaveBeenCalledTimes(1); - expect(screen.queryByText("No pending proposal has this key.")).toBeNull(); - expect(toastError).not.toHaveBeenCalled(); + // 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 () => { diff --git a/frontend/src/views/admin/Proposals.tsx b/frontend/src/views/admin/Proposals.tsx index e8a3cf53fdc..172982f7814 100644 --- a/frontend/src/views/admin/Proposals.tsx +++ b/frontend/src/views/admin/Proposals.tsx @@ -55,6 +55,9 @@ export function ProposalsPanel() { const [reload, setReload] = useState(0); const [busy, setBusy] = useState(false); 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); @@ -144,13 +147,13 @@ export function ProposalsPanel() { setReview(null); return; } - // A row opened or closed while this read is out rewrites the address, and the answer - // for a key the address does not name changes nothing. - const named = () => live() && urlParam("key") === key; + // 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 (!named()) return; + 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); @@ -164,7 +167,7 @@ export function ProposalsPanel() { ); }) // The address keeps the key, so a reload asks again. - .catch((e) => named() && toastError("Couldn't open the proposal", e, { read: true })); + .catch((e) => wanted() && toastError("Couldn't open the proposal", e, { read: true })); }, [identity.org, identity.namespace, linked], ); @@ -277,6 +280,8 @@ export function ProposalsPanel() { onDismiss={() => { setNotice(null); setViewParam("key", null); + // The button pressed leaves with the notice. + panel.current?.focus(); }} /> )} From 1a604bb95c3792ba1e2cc86d45469ff026dd9079 Mon Sep 17 00:00:00 2001 From: Mohammad Lareb Zafar Date: Fri, 4 Dec 2026 22:24:52 +0000 Subject: [PATCH 4/6] A proposal decision that fails keeps the review open with the typed reason Dashboard: the Proposals review closes, hands the focus to the panel and reads the list again only after `memory.proposal_decide` answers. A call that throws (a timeout, or a 503 the caller retries) raises the "Decision failed" toast and leaves the dialog as it is: the complete text, the typed reason and the key in the address stay, and both decisions are offered again. The close ran in `finally`, so a failed rejection discarded its reason while the proposal was still pending. Tests: a rejected `decideProposals` leaves the dialog open with its text, the typed reason and the address, reads the list no second time, and the second try sends the same reason. Signed-off-by: Mohammad Lareb Zafar Co-Authored-By: Claude Fable 5.2 --- frontend/src/views/admin/Proposals.test.tsx | 29 +++++++++++++++++++++ frontend/src/views/admin/Proposals.tsx | 7 +++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/admin/Proposals.test.tsx b/frontend/src/views/admin/Proposals.test.tsx index f4c2ee1d3e9..73933ba12b5 100644 --- a/frontend/src/views/admin/Proposals.test.tsx +++ b/frontend/src/views/admin/Proposals.test.tsx @@ -395,6 +395,35 @@ describe("ProposalsPanel", () => { }); }); + 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" }; diff --git a/frontend/src/views/admin/Proposals.tsx b/frontend/src/views/admin/Proposals.tsx index 172982f7814..8d4afa66130 100644 --- a/frontend/src/views/admin/Proposals.tsx +++ b/frontend/src/views/admin/Proposals.tsx @@ -191,11 +191,14 @@ export function ProposalsPanel() { 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); - focusPanel.current = true; - closeReview(); } + focusPanel.current = true; + closeReview(); // The decided row unmounts; focus goes to the panel, and the list is read again. setReading(true); panel.current?.focus(); From e6d3c6c8212e152ed5fa3f44c0920a080b06f8f0 Mon Sep 17 00:00:00 2001 From: Mohammad Lareb Zafar Date: Fri, 4 Dec 2026 22:25:00 +0000 Subject: [PATCH 5/6] The reference says `limit` cuts a memory.proposals read by key The comment on `memory_keys` is one sentence: "Only pending proposals under these keys, cut by `limit` like any listing; empty lists every proposal." The generated reference keeps a field's first sentence, and the second one, which said `limit` still applies, was left out of `docs/reference/operations/memory.md`. The field takes 500 keys and `limit` defaults to 50, so a caller who names 200 keys gets 50 rows. `total` and `count_only` say what they count in their own descriptions. `docs/reference/operations/memory.md` is regenerated; every other generator's check reports its file current. Signed-off-by: Mohammad Lareb Zafar Co-Authored-By: Claude Fable 5.2 --- docs/reference/operations/memory.md | 2 +- server/memory/api/models_proposals.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/reference/operations/memory.md b/docs/reference/operations/memory.md index c1275211836..60c0ecbf478 100644 --- a/docs/reference/operations/memory.md +++ b/docs/reference/operations/memory.md @@ -1565,7 +1565,7 @@ 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; empty lists every proposal. | +| `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, tags and memory_keys, and the namespace's `policy`, with no proposal or graded count read; default off. | diff --git a/server/memory/api/models_proposals.py b/server/memory/api/models_proposals.py index b143807d939..d181f93de20 100644 --- a/server/memory/api/models_proposals.py +++ b/server/memory/api/models_proposals.py @@ -26,8 +26,8 @@ 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; empty lists every proposal. `limit` still - # applies and `total` counts the matching rows before it. + # 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 ) From a09b4054071d8ff07543e6367f345f4d86bfb804 Mon Sep 17 00:00:00 2001 From: Mohammad Lareb Zafar Date: Fri, 4 Dec 2026 22:25:08 +0000 Subject: [PATCH 6/6] A test covers Back to a Review queue address that names no tab The Review queue leaves its open tab as it is when Back or Forward lands on an address with no `tab`. The one case that dispatched `popstate` did so at an address that names `tab=duplicates`, so a page that reset the tab to Conflicts on such an entry passed every case. The new case lets the first count move the page to Proposals, which writes no tab, dispatches `popstate` at the same address and expects Proposals still selected. It fails against a `sync` that resets the tab. Signed-off-by: Mohammad Lareb Zafar Co-Authored-By: Claude Fable 5.2 --- frontend/src/views/admin/ReviewQueue.test.tsx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/frontend/src/views/admin/ReviewQueue.test.tsx b/frontend/src/views/admin/ReviewQueue.test.tsx index e91d73e0046..f99199db03b 100644 --- a/frontend/src/views/admin/ReviewQueue.test.tsx +++ b/frontend/src/views/admin/ReviewQueue.test.tsx @@ -298,6 +298,23 @@ describe("ReviewQueue", () => { 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 });