From e7c541a7f769ab483cbd5819a5adbf498bd13705 Mon Sep 17 00:00:00 2001 From: Project Manager Date: Fri, 4 Dec 2026 21:35:03 +0545 Subject: [PATCH 01/11] Add captured conflict backlog management Signed-off-by: Project Manager --- .../memory/captured-conflict-simulation.md | 35 + docs/features/memory/conflicts-and-refusal.md | 18 + docs/reference/operations.md | 3 +- docs/reference/operations/conflicts.md | 21 + docs/reference/operations/mentor.md | 1 + docs/reference/operations/namespace.md | 4 + docs/reference/status.md | 4 +- frontend/src/api.ts | 24 +- frontend/src/api/admin.ts | 12 + frontend/src/api/audit.ts | 1 + frontend/src/api/conflicts.ts | 32 + .../src/flows/NamespaceSettingsDialog.tsx | 65 + frontend/src/views/Tokens.tsx | 51 +- frontend/src/views/admin/ReviewQueue.test.tsx | 146 + frontend/src/views/admin/ReviewQueue.tsx | 256 +- .../.claude-plugin/plugin.json | 2 +- .../claude-code-plugin/hooks/hooks.json | 5 + .../hooks/loom-review-notice.mjs | 45 + .../claude-code-plugin/lib/review-notice.mjs | 31 + .../tests/review-notice.test.mjs | 110 + .../codex-plugin/.codex-plugin/plugin.json | 2 +- .../codex-plugin/hooks/loom-review-notice.mjs | 45 + .../codex-plugin/lib/review-notice.mjs | 31 + .../120_captured_conflict_provenance.sql | 25 + schemas/schema.sql | 12 +- scripts/ops/simulate_captured_conflicts.py | 274 + sdk/go/client.gen.go | 29 + sdk/go/wire/models.gen.go | 148 +- sdk/python/loom/client.py | 9 + sdk/python/loom/ops.py | 77 + sdk/ruby/lib/clickhouse/loom/generated/ops.rb | 11 +- sdk/rust/src/blocking_operations.rs | 17 + sdk/rust/src/operations.rs | 18 + sdk/rust/src/wire_models.rs | 7043 +++++++++-------- sdk/rust/tests/registry_contracts.rs | 33 + sdk/typescript/src/generated/ops.ts | 56 +- server/auth/delegation.py | 2 + server/auth/jwt.py | 64 +- server/identity/api/models.py | 6 + server/identity/app/me_service_accounts.py | 42 +- server/identity/app/namespace.py | 16 + server/insights/api/models_mentor.py | 3 + server/insights/app/mentor.py | 1 + server/insights/app/mentor_brief.py | 1 + server/insights/app/mentor_rules.py | 11 - server/insights/store/mentor.py | 55 + server/memory/api/models_conflicts.py | 53 + server/memory/api/models_crud.py | 4 + server/memory/api/ops_conflicts.py | 15 + server/memory/app/auto_resolution.py | 3 + server/memory/app/conflict_resolver.py | 99 +- server/memory/app/conflicts_ops.py | 224 +- server/memory/app/provenance.py | 9 + server/memory/domain/conflict_resolution.py | 35 + server/memory/store/conflicts.py | 105 +- server/memory/store/rows.py | 9 + server/memory/workers/conflict_resolver.py | 32 +- server/operations/reach_manifest.py | 5 + server/operations/toolsets.py | 2 + server/settings/catalog.py | 2 + .../integration/test_conflict_resolver_ch.py | 104 + tests/unit/test_badge_reads.py | 39 + .../unit/test_captured_conflict_simulation.py | 20 + tests/unit/test_conflict_resolver.py | 56 +- tests/unit/test_conflicts_bulk_accept.py | 230 + tests/unit/test_conflicts_repo.py | 58 + tests/unit/test_mentor.py | 45 +- tests/unit/test_provenance.py | 117 + tests/unit/test_read_scope_admission.py | 11 +- tests/unit/test_schema_baseline.py | 1 + 70 files changed, 6640 insertions(+), 3535 deletions(-) create mode 100644 docs/features/memory/captured-conflict-simulation.md create mode 100644 frontend/src/api/conflicts.ts create mode 100644 integrations/claude-code-plugin/hooks/loom-review-notice.mjs create mode 100644 integrations/claude-code-plugin/lib/review-notice.mjs create mode 100644 integrations/claude-code-plugin/tests/review-notice.test.mjs create mode 100644 integrations/codex-plugin/hooks/loom-review-notice.mjs create mode 100644 integrations/codex-plugin/lib/review-notice.mjs create mode 100644 schemas/migrations/120_captured_conflict_provenance.sql create mode 100644 scripts/ops/simulate_captured_conflicts.py create mode 100644 tests/unit/test_captured_conflict_simulation.py create mode 100644 tests/unit/test_conflicts_bulk_accept.py diff --git a/docs/features/memory/captured-conflict-simulation.md b/docs/features/memory/captured-conflict-simulation.md new file mode 100644 index 00000000000..17a50f3eca8 --- /dev/null +++ b/docs/features/memory/captured-conflict-simulation.md @@ -0,0 +1,35 @@ +# Captured conflict simulation + +The seven-day model compares the resolver's default policy with an owner opt-in for settling +high-confidence updates between authenticated captured rows. It uses the production decision +helpers and fixed verdicts; it does not call an LLM or ClickHouse. + +Run it from the repository root: + +```bash +uv run --locked python scripts/ops/simulate_captured_conflicts.py +``` + +## Results + +| Scenario | Captured rows | Human-reviewable pairs, default | Human-reviewable pairs, opt-in | All automatic settlements, default | All automatic settlements, opt-in | Captured-policy settlements, opt-in | +| --- | ---: | ---: | ---: | ---: | ---: | ---: | +| Light | 700 | 372 | 141 | 176 | 407 | 231 | +| Steady | 1,750 | 975 | 328 | 413 | 1,060 | 647 | +| Surge | 3,500 | 1,965 | 645 | 829 | 2,149 | 1,320 | + +In all six runs, backlog growth, false automatic settlements, and settled genuine +contradictions were zero. Each scenario used a review capacity of 2,000 pairs per sitting. +The model produced no failed resolver jobs and left no resolver work pending. + +## Model inputs and limits + +- Seven days of seeded synthetic cases use fixed resolver verdicts and confidence scores. +- Resolver batches contain 40 rows, concurrency is 8, bursts last at most 300 seconds, and a + row gets at most three attempts. +- A daily resolver call cap stands in for the namespace cost-share limit; it is not a provider + price estimate. +- Review capacity is an input, not a measured operator rate. The generated workload contains + no Undo events. +- Synthetic case mixes and fixed verdicts do not represent production distributions. The model + excludes database races, provider latency distributions, and real restore writes. diff --git a/docs/features/memory/conflicts-and-refusal.md b/docs/features/memory/conflicts-and-refusal.md index ccec73b7be9..dc3ad3aca61 100644 --- a/docs/features/memory/conflicts-and-refusal.md +++ b/docs/features/memory/conflicts-and-refusal.md @@ -186,6 +186,17 @@ one call to `LOOM_CONFLICT_RESOLVER_MODEL` (`gpt-6.1-sol`). Per pair: The judge sees when each note's statement holds and which session it comes from. +Captured writes carry a server-stamped `capture_origin` from a verified service-account token; +request fields cannot set it. The supported origins are `claude-code` and `codex`. The +namespace's `captured_conflict_policy` defaults to `manual_review`, and its +`captured_conflict_confidence` defaults to 0.98. With `manual_review`, a captured update stays +flagged even when the general namespace policy would retire it. Setting the captured policy to +`resolver_update` lets the resolver retire a same-entity, same-attribute update only when both +rows have trusted capture origins, the same agent and user, and the verdict meets the configured +confidence. An anonymous user's cross-session update still waits for review. Rows without a +trusted origin cannot use this policy. The [captured-conflict simulation](./captured-conflict-simulation.md) +reports a deterministic workload model and its limits. + It also re-checks pairs flagged before it judged them, so a false flag is cleared once (a definition's flags excepted: it is never judged, only its dead flags released). A pinned row is never touched, a row that changed since it was judged is left to its @@ -202,6 +213,13 @@ applies `conflicts.resolve`. Three more tabs appear when they have content: **Le ([learnings](./procedures-and-learnings.md#learnings-review-queue)), **Auto-resolved** (below) and **Exceptions** (the allowlist). See [the dashboard](../dashboard.md). +The queue summary and `mentor.brief` report **conflicted rows**, grouped by whether a resolver +judgement is owed, the resolver judged but left the conflict open, or only cosine similarity +flagged the row. A row count is not a count of distinct pairs: a conflict can be linked in both +directions or belong to a larger cluster. The summary separates authenticated plugin captures, +caller-written rows, and rows with unknown provenance. The plugin's SessionStart notice uses the +scoped `conflicts.list` count and links to that namespace's queue. + ### Automatic retirements When Loom retires memories on its own, each path that retired rows records them as diff --git a/docs/reference/operations.md b/docs/reference/operations.md index 3d724eb59e9..ab6eed096ff 100644 --- a/docs/reference/operations.md +++ b/docs/reference/operations.md @@ -123,7 +123,7 @@ python scripts/codegen/docs_reference.py --check # exit 1 when a region is stal -379 operations in 43 groups. Every op is served at `POST /v1/` and as the MCP tool `loom_` (dots become underscores). +380 operations in 43 groups. Every op is served at `POST /v1/` and as the MCP tool `loom_` (dots become underscores). Columns: **Role** is the minimum role (`viewer` < `writer` < `admin` < `org_admin` < `platform_admin`); **Kind** is `read` (idempotent, viewer, unaudited, writes nothing — MCP `readOnlyHint`), `idempotent` (safe to retry) or `write`; **Listed under `all`** says whether an MCP connection on the `all` toolset lists the op in `tools/list` (`code.*` ops only with `LOOM_MCP_CODE_TOOLS=true`); an op marked `no` is still callable by name or through `loom_op`, unless it is hidden from MCP; **Audit** marks ops that leave an `audit_log` row. @@ -261,6 +261,7 @@ Fields for every `conflicts` op: [operations/conflicts.md](operations/conflicts. | --- | --- | --- | --- | --- | --- | | [`conflicts.allowlist_list`](operations/conflicts.md#conflictsallowlist_list) | List (memory_key, memory_key) pairs marked as known-non-conflicting so the conflicts worker stops flagging them. | viewer | read | no | | | [`conflicts.allowlist_remove`](operations/conflicts.md#conflictsallowlist_remove) | Revoke an allow decision; the pair will re-flag on future writes. | admin | idempotent | no | yes | +| [`conflicts.bulk_accept`](operations/conflicts.md#conflictsbulk_accept) | Accept current hash-only resolver update suggestions independently. | admin | idempotent | no | yes | | [`conflicts.list`](operations/conflicts.md#conflictslist) | List unresolved conflicts where two memories contradict each other. | viewer | read | no | | | [`conflicts.propose_revision`](operations/conflicts.md#conflictspropose_revision) | Return non-destructive revise/contract/allow suggestions. | viewer | read | no | | | [`conflicts.resolve`](operations/conflicts.md#conflictsresolve) | Pick the winner of a conflict (keep A, keep B, keep both, merge). | admin | idempotent | no | yes | diff --git a/docs/reference/operations/conflicts.md b/docs/reference/operations/conflicts.md index 90a5610443b..ab738e5e580 100644 --- a/docs/reference/operations/conflicts.md +++ b/docs/reference/operations/conflicts.md @@ -43,6 +43,26 @@ Revoke an allow decision; the pair will re-flag on future writes. | --- | --- | --- | | `removed` | `bool` | False when no live allowed pair matched. | +## `conflicts.bulk_accept` + +Accept current hash-only resolver update suggestions independently. + +`POST /v1/conflicts.bulk_accept` · MCP `loom_conflicts_bulk_accept` · role `admin` · idempotent · audited · not listed under the MCP `all` toolset + +| Input field | Type | Default | Meaning | +| --- | --- | --- | --- | +| `org` | `str` | required | The tenant (first element of the identity tuple). | +| `namespace` | `str` | required | The namespace the op reads or writes. | +| `items` | `list[ConflictsResolverAcceptItem]` | required | Bounded so a request cannot monopolize the resolver or audit store. | + +| Output field | Type | Meaning | +| --- | --- | --- | +| `results` | `list[_ConflictBulkResult]` | | +| `requested` | `int` | | +| `resolved` | `int` | | +| `stale` | `int` | | +| `failed` | `int` | | + ## `conflicts.list` List unresolved conflicts where two memories contradict each other. @@ -66,6 +86,7 @@ List unresolved conflicts where two memories contradict each other. | `next_before_version` | `int \| None` | Pass as `before_version` for the next page; null on the last page. | | `total` | `int \| None` | The live conflicted count for the namespace; set on a count_only call. | | `proposals` | `int \| None` | The pending proposals in the same scope, from the same read; set on a count_only call. | +| `backlog` | `ConflictBacklog \| None` | Row-based backlog split, present on `count_only`; reciprocal links are not pairs. | | `keys` | `list[str] \| None` | The conflicted memory keys of the namespace; set on a keys_only call. | ## `conflicts.propose_revision` diff --git a/docs/reference/operations/mentor.md b/docs/reference/operations/mentor.md index 7893c77086a..3fa949096c7 100644 --- a/docs/reference/operations/mentor.md +++ b/docs/reference/operations/mentor.md @@ -31,6 +31,7 @@ One agent's usage profile and the store's hints. | `sessions` | `int` | Distinct client-named sessions of this agent in the window (`-` and `*` not counted). | | `usage` | `dict[str, int]` | Calls per operation by this agent in the window. | | `planes` | `list[MentorPlane]` | Every plane the mentor knows, with this agent's calls to it and whether it is available. | +| `conflict_backlog` | `dict[str, dict[str, int]]` | Conflicted memory rows in this namespace, grouped by resolver state and trustworthy provenance. | | `hints` | `list[MentorHint]` | The rules that fired for this agent, each with the counts that fired it; empty when none. | | `adoption` | `list[MentorAdoption]` | Per hint code, sessions it was shown in and followed in, most shown first; empty when no hint reached the agent or the read failed. | | `usage_evidence` | `list[UsageRung]` | The agent's use of Loom in the window, one rung each, weakest claim first: from a call made to a graded run. | diff --git a/docs/reference/operations/namespace.md b/docs/reference/operations/namespace.md index 76f5813b933..cc077d58520 100644 --- a/docs/reference/operations/namespace.md +++ b/docs/reference/operations/namespace.md @@ -129,6 +129,8 @@ Fetch one namespace's metadata + settings (owner, visibility, feature flags, ret | `rerank_endpoint` | `str \| None` | The reranker `memory.search` uses (a builtin or a configured endpoint's name); empty when none. | | `classify_endpoint` | `str \| None` | URL `memory.set(classify=true)` calls to classify a write; empty when none. | | `default_conflict_policy` | `str \| None` | How close writes are settled: `auto_reinforce` (the default when unset), `manual_review`, `newest_wins` or `append_only`. | +| `captured_conflict_policy` | `str` | | +| `captured_conflict_confidence` | `float` | | | `proposal_policy` | `ProposalPolicy \| None` | How proposals (`memory.set proposed=true`) are decided; the manual default when unset. | | `code_change_policy` | `Literal['retire_removed', 'flag', 'revise'] \| None` | How reads treat the namespace's code-linked memories when their code changes: `retire_removed` (the default), `flag` or `revise`. | | `tag_registry` | `list[dict[str, Any]] \| None` | Per-tag configuration rows (retention, dedup threshold, hot quota, conflict policy); empty when none are registered. | @@ -381,6 +383,8 @@ Create a shared memory workspace within an org; caller becomes admin. | `classify_prompt_template` | `str \| None` | `None` | Text forwarded as `prompt_template` in every call to `classify_endpoint`. | | `tag_registry` | `list[NamespaceTypeConfig]` | *(computed)* | Per-tag TTL + dedup_threshold registry, matched on tags at memory.set time. | | `default_conflict_policy` | `Literal['auto_reinforce', 'manual_review', 'newest_wins', 'append_only'] \| None` | `None` | fresh: auto_reinforce | +| `captured_conflict_policy` | `Literal['manual_review', 'resolver_update'] \| None` | `None` | Captured integration conflicts stay human-reviewable unless the owner opts in. | +| `captured_conflict_confidence` | `float \| None` | `None` | Minimum resolver confidence for an opted-in captured-to-captured update. | | `proposal_policy` | `ProposalPolicy \| None` | `None` | How proposals (facts written with memory.set proposed=true) are decided. | | `code_change_policy` | `Literal['retire_removed', 'flag', 'revise'] \| None` | `None` | How reads treat this namespace's code-linked memories when their code changes: `retire_removed` (the default: search leaves out a memory whose code is all gone, and serves it again when the code returns), `flag` (only the links are marked)… | diff --git a/docs/reference/status.md b/docs/reference/status.md index dc62a3feb7e..2b7436e2415 100644 --- a/docs/reference/status.md +++ b/docs/reference/status.md @@ -25,7 +25,7 @@ serves is in the [MCP reference](./mcp.md#toolsets). -379 operations, 265 of them experimental. +380 operations, 266 of them experimental. | Group | Stable | Experimental | | --- | --- | --- | @@ -37,7 +37,7 @@ serves is in the [MCP reference](./mcp.md#toolsets). | `calibration` | 0 | [`calibration.get`](operations/calibration.md#calibrationget) | | `code` | 28 | [`code.backport_gap`](operations/code.md#codebackport_gap), [`code.backport_gaps`](operations/code.md#codebackport_gaps), [`code.bisect_candidates`](operations/code.md#codebisect_candidates), [`code.blame_range`](operations/code.md#codeblame_range), [`code.callees`](operations/code.md#codecallees), [`code.conventions`](operations/code.md#codeconventions), [`code.coverage_claim`](operations/code.md#codecoverage_claim), [`code.edit_context`](operations/code.md#codeedit_context), [`code.examples`](operations/code.md#codeexamples), [`code.files`](operations/code.md#codefiles), [`code.first_build`](operations/code.md#codefirst_build), [`code.map`](operations/code.md#codemap), [`code.outline`](operations/code.md#codeoutline), [`code.path_guards`](operations/code.md#codepath_guards), [`code.pr_check`](operations/code.md#codepr_check), [`code.read`](operations/code.md#coderead), [`code.reindex`](operations/code.md#codereindex), [`code.repo.set_access`](operations/code.md#codereposet_access), [`code.repo.set_source`](operations/code.md#codereposet_source), [`code.review_brief`](operations/code.md#codereview_brief), [`code.setting_facts`](operations/code.md#codesetting_facts), [`code.symbol_history`](operations/code.md#codesymbol_history), [`code.test_gate`](operations/code.md#codetest_gate), [`code.test_home`](operations/code.md#codetest_home), [`code.tests_for`](operations/code.md#codetests_for), [`code.verify_citations`](operations/code.md#codeverify_citations) | | `collection` | 0 | [`collection.budget_set`](operations/collection.md#collectionbudget_set), [`collection.create`](operations/collection.md#collectioncreate), [`collection.delete`](operations/collection.md#collectiondelete), [`collection.list`](operations/collection.md#collectionlist), [`collection.move`](operations/collection.md#collectionmove) | -| `conflicts` | 2 | [`conflicts.allowlist_list`](operations/conflicts.md#conflictsallowlist_list), [`conflicts.allowlist_remove`](operations/conflicts.md#conflictsallowlist_remove), [`conflicts.propose_revision`](operations/conflicts.md#conflictspropose_revision) | +| `conflicts` | 2 | [`conflicts.allowlist_list`](operations/conflicts.md#conflictsallowlist_list), [`conflicts.allowlist_remove`](operations/conflicts.md#conflictsallowlist_remove), [`conflicts.bulk_accept`](operations/conflicts.md#conflictsbulk_accept), [`conflicts.propose_revision`](operations/conflicts.md#conflictspropose_revision) | | `connection` | 0 | [`connection.disconnect`](operations/connection.md#connectiondisconnect), [`connection.list`](operations/connection.md#connectionlist) | | `consolidations` | 0 | [`consolidations.list`](operations/consolidations.md#consolidationslist) | | `context` | 1 | [`context.fetch`](operations/context.md#contextfetch), [`context.offload`](operations/context.md#contextoffload) | diff --git a/frontend/src/api.ts b/frontend/src/api.ts index 03638b843ec..7dd8f749bd2 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -1022,6 +1022,7 @@ export interface ConflictRow { content_sha256: string; // A high row comes without its value; the inspector reads it by key. sensitivity?: string; + capture_origin?: "claude-code" | "codex" | ""; } export async function listConflicts( @@ -1037,10 +1038,9 @@ export async function listConflicts( return post("/v1/conflicts.list", body, opts.signal); } -/** The namespace's Review queue counts from one read: `total` conflicted and `proposals` - * pending (absent from a server that does not count them). `fresh` counts now instead of - * answering from the replica's minute-long cache (the review queue, and the sidebar's read - * after a decision; its minute polls take the cache). */ +/** The namespace's Review queue counts: `total` conflicted rows, `proposals` pending, and + * an optional provenance/resolver-state breakdown. `fresh` counts now instead of answering + * from the replica's minute-long cache (the review queue; sidebar polls take the cache). */ export function countReview( id: Pick, opts: RequestOpts & { fresh?: boolean } = {}, @@ -1055,6 +1055,19 @@ export function countReview( export interface ReviewCounts { total?: number | null; proposals?: number | null; + backlog?: ConflictBacklog | null; +} + +export interface ConflictSourceCounts { + plugin_captured: number; + caller_written: number; + unknown: number; +} + +export interface ConflictBacklog { + pending_judgement: ConflictSourceCounts; + resolver_judged: ConflictSourceCounts; + cosine_only: ConflictSourceCounts; } /** The conflicted memory keys of a namespace, for the cards' chips @@ -1413,6 +1426,7 @@ export interface TokenCreated { created_at: string; expires_at: string | null; mcp_url: string; + capture_origin?: "claude-code" | "codex" | null; } export async function listTokens(): Promise { @@ -1428,6 +1442,8 @@ export async function createToken(opts: { ttl_days: number | null; /** A list's save target, one of its memory namespaces it writes; not sent with `*`. */ saves_to?: string; + /** Signed server-issued provenance for a single-namespace coding-agent credential. */ + capture_origin?: "claude-code" | "codex"; }): Promise { const r = await post & Pick>( "/v1/me/service_accounts.create", diff --git a/frontend/src/api/admin.ts b/frontend/src/api/admin.ts index df6b542e392..562f78278ae 100644 --- a/frontend/src/api/admin.ts +++ b/frontend/src/api/admin.ts @@ -264,6 +264,8 @@ export interface NamespaceInfo { budget_alert_inbox?: string; consolidation_enabled: boolean; conflict_threshold: number | null; + captured_conflict_policy?: "manual_review" | "resolver_update"; + captured_conflict_confidence?: number; visibility?: "private" | "public"; requires_approval?: boolean; /** The stored join word and the resolved one. */ @@ -313,6 +315,8 @@ export interface NamespaceRegisterFields { budget_alert_inbox?: string; consolidation_enabled?: boolean; conflict_threshold?: number | null; + captured_conflict_policy?: "manual_review" | "resolver_update"; + captured_conflict_confidence?: number; requires_approval?: boolean; /** Omit to keep the stored value. */ join_policy?: "inherit" | "open" | "approval" | "closed"; @@ -348,6 +352,12 @@ export async function registerNamespace( if (opts.conflict_threshold !== undefined) { body["conflict_threshold"] = opts.conflict_threshold; } + if (opts.captured_conflict_policy !== undefined) { + body["captured_conflict_policy"] = opts.captured_conflict_policy; + } + if (opts.captured_conflict_confidence !== undefined) { + body["captured_conflict_confidence"] = opts.captured_conflict_confidence; + } // Sent only when explicitly set. Omitting it means "unchanged" server-side, so // an unrelated settings save cannot silently reset a privacy choice. if (opts.capture_generation_io !== undefined) { @@ -373,6 +383,8 @@ export async function reregisterNamespace( daily_cost_cap_usd: ns.daily_cost_cap_usd ?? 0.0, consolidation_enabled: ns.consolidation_enabled, conflict_threshold: ns.conflict_threshold, + captured_conflict_policy: ns.captured_conflict_policy, + captured_conflict_confidence: ns.captured_conflict_confidence, requires_approval: ns.requires_approval ?? false, capture_generation_io: ns.capture_generation_io, ...patch, diff --git a/frontend/src/api/audit.ts b/frontend/src/api/audit.ts index 49569e08425..2f76850d156 100644 --- a/frontend/src/api/audit.ts +++ b/frontend/src/api/audit.ts @@ -13,6 +13,7 @@ export interface AuditEntry { /** JSON text of the operation's input (`AuditListRow.subject`); parse before reading. */ subject: string; request_id: string; + row_hash?: string; } export async function listAuditLog( diff --git a/frontend/src/api/conflicts.ts b/frontend/src/api/conflicts.ts new file mode 100644 index 00000000000..dcc2024be3c --- /dev/null +++ b/frontend/src/api/conflicts.ts @@ -0,0 +1,32 @@ +import { post } from "../api"; +import type { Identity, RequestOpts } from "../api"; + +export interface ResolverAcceptItem { + memory_id: string; + peer_id: string; + memory_sha256: string; + peer_sha256: string; + suggestion_hash: string; +} + +export interface ResolverAcceptResult { + memory_id: string; + peer_id: string; + status: "resolved" | "stale" | "failed"; + reason?: string; +} + +/** Accept a bounded batch of current resolver update suggestions. */ +export async function acceptResolverSuggestions( + id: Pick, + items: ResolverAcceptItem[], + opts: RequestOpts = {}, +): Promise<{ + results: ResolverAcceptResult[]; + requested: number; + resolved: number; + stale: number; + failed: number; +}> { + return post("/v1/conflicts.bulk_accept", { org: id.org, namespace: id.namespace, items }, opts.signal); +} diff --git a/frontend/src/flows/NamespaceSettingsDialog.tsx b/frontend/src/flows/NamespaceSettingsDialog.tsx index 4fefaaadc84..bd3043abe6f 100644 --- a/frontend/src/flows/NamespaceSettingsDialog.tsx +++ b/frontend/src/flows/NamespaceSettingsDialog.tsx @@ -75,6 +75,8 @@ export function NamespaceSettingsDialog({ open, onOpenChange, org, namespace, la // for; null (or another namespace's draft) shows the stored cap. const [capEdit, setCapEdit] = useState<{ key: string; text: string } | null>(null); const capDraft = capEdit?.key === key ? capEdit.text : null; + const [captureConfidenceEdit, setCaptureConfidenceEdit] = useState<{ key: string; text: string } | null>(null); + const captureConfidenceDraft = captureConfidenceEdit?.key === key ? captureConfidenceEdit.text : null; useAbortableEffect( async (signal, live) => { @@ -87,6 +89,7 @@ export function NamespaceSettingsDialog({ open, onOpenChange, org, namespace, la setLoaded({ key, info }); setDescDraft(info?.description || ""); setDescDirty(false); + setCaptureConfidenceEdit(null); }, [open, org, namespace], ); @@ -143,6 +146,9 @@ export function NamespaceSettingsDialog({ open, onOpenChange, org, namespace, la setDescDraft(next?.description || ""); setDescDirty(false); } + if (patch.captured_conflict_confidence !== undefined) { + setCaptureConfidenceEdit(null); + } } catch (e) { toastError("Save failed", e); } finally { @@ -161,6 +167,21 @@ export function NamespaceSettingsDialog({ open, onOpenChange, org, namespace, la setCapEdit(null); }; + const commitCaptureConfidence = async () => { + if (captureConfidenceDraft === null || !ns) return; + const value = Number(captureConfidenceDraft); + if ( + captureConfidenceDraft.trim() !== "" && + Number.isFinite(value) && + value >= 0.5 && + value <= 1 && + value !== (ns.captured_conflict_confidence ?? 0.98) + ) { + await save({ captured_conflict_confidence: value }); + } + setCaptureConfidenceEdit(null); + }; + const onDelete = async () => { if ( !(await confirmAction({ @@ -249,6 +270,50 @@ export function NamespaceSettingsDialog({ open, onOpenChange, org, namespace, la {!isRepo && ( <> +
+ (null); const mine = useMemo(() => rows?.filter((r) => r.status !== "pending") ?? null, [rows]); const [reach, setReach] = useState("everything"); + const [captureOrigin, setCaptureOrigin] = useState(""); const [name, setName] = useState(""); const [ttlDays, setTtlDays] = useState("90"); const [busy, setBusy] = useState(false); @@ -633,6 +649,7 @@ function TokenForm({ setSelectedNs((prev) => prev.filter((x) => x !== ns)); setNsRole(({ [ns]: _, ...rest }) => rest); } else { + if (captureOrigin && selectedNs.length > 0) return; setSelectedNs((prev) => [...prev, ns]); setNsRole((m) => ({ ...m, [ns]: grantRoleOf(mine, ns) })); } @@ -709,17 +726,29 @@ function TokenForm({ namespaces = [...(everythingHome ? [everythingHome] : []), "*", ...restricted]; } else { if (selectedNs.length === 0) return; + if (captureOrigin && selectedNs.length !== 1) { + toast("Choose exactly one namespace for a capture token", "error"); + return; + } // Ordered = read priority; repositories are read-only. namespaces = selectedNs.map((ns) => ({ namespace: ns, - role: isRepo(ns) ? "viewer" : nsRole[ns], + role: captureOrigin ? "writer" : isRepo(ns) ? "viewer" : nsRole[ns], })); } // A list token's target goes as `saves_to`; with none, the field is left out. const savesTo = reach === "listed" && listSaves ? { saves_to: listSaves } : {}; setBusy(true); try { - onCreated(await createToken({ name: name.trim() || undefined, namespaces, ttl_days: ttl, ...savesTo })); + onCreated( + await createToken({ + name: name.trim() || undefined, + namespaces, + ttl_days: ttl, + ...savesTo, + ...(captureOrigin ? { capture_origin: captureOrigin } : {}), + }), + ); setName(""); } catch (e) { toastError("Failed", e); @@ -757,6 +786,24 @@ function TokenForm({ label="Can read" value={reach} onChange={setReach} options={REACH_OPTIONS} /> + + label="Credential type" + value={captureOrigin} + onChange={(value) => { + setCaptureOrigin(value); + if (value) { + setReach("listed"); + setSelectedNs((current) => current.slice(0, 1)); + } + }} + options={CAPTURE_OPTIONS} + /> + {captureOrigin && ( +

+ A capture token needs sign-in enabled, one namespace and writer access. A namespace admin issues it. +

+ )} + {reach === "everything" ? ( { getMemoryById: vi.fn(), listProposals: vi.fn(async () => ({ proposals: [], total: 0 })), proposeRevision: vi.fn(), + listAuditLog: vi.fn(async () => ({ rows: [] })), listMemoryDuplicates: vi.fn(async () => ({ clusters: [] })), listDocumentDuplicates: vi.fn(async () => ({ doc_clusters: [] })), listMemoryAgents: vi.fn(async () => []), @@ -51,6 +52,9 @@ vi.mock("../../api/audit", async (importOriginal) => ({ ...(await importOriginal()), hasAutoResolved: vi.fn(), })); +vi.mock("../../api/conflicts", () => ({ + acceptResolverSuggestions: vi.fn(async () => ({ results: [], requested: 0, resolved: 0, stale: 0, failed: 0 })), +})); vi.mock("../../components/ConfirmDialog", () => ({ confirmAction: async () => true })); const toast = vi.hoisted(() => vi.fn()); vi.mock("../../components/Toast", async (importOriginal) => ({ @@ -62,6 +66,7 @@ import { countReview, getMemoryById, listAllowlist, + listAuditLog, listAutoResolved, listConflicts, listLearnings, @@ -75,6 +80,7 @@ import { restoreMemory, reviewLearning, } from "../../api"; +import { acceptResolverSuggestions } from "../../api/conflicts"; const ORG = "dev"; const WAIT = { timeout: 5000 }; @@ -177,6 +183,11 @@ const panelReads = () => vi.mocked(listAutoResolved).mock.calls.filter(([, o]) = describe("ReviewQueue", () => { beforeEach(() => { vi.mocked(listConflicts).mockReset(); + vi.mocked(countReview).mockReset(); + vi.mocked(countReview).mockResolvedValue({ total: 0 }); + vi.mocked(listAuditLog).mockReset(); + vi.mocked(listAuditLog).mockResolvedValue({ rows: [] }); + vi.mocked(acceptResolverSuggestions).mockReset(); vi.mocked(listAllowlist).mockReset(); vi.mocked(listLearnings).mockReset(); vi.mocked(listProposals).mockReset(); @@ -205,6 +216,124 @@ describe("ReviewQueue", () => { async (id) => (await listAutoResolved(id, { limit: 5 })).rows.length > 0, ); }); + + it("accepts selected current resolver suggestions and reports partial outcomes", async () => { + const hashA = "a".repeat(64); + const hashB = "b".repeat(64); + const hashC = "d".repeat(64); + const hashD = "e".repeat(64); + vi.mocked(listConflicts).mockResolvedValue({ + rows: [ + { + ...conflict("a"), + memory_id: "a", + conflict_with: ["b"], + content_sha256: hashA, + value: "new", + capture_origin: "codex", + }, + { + ...conflict("b"), + memory_id: "b", + conflict_with: ["a"], + content_sha256: hashB, + value: "old", + capture_origin: "codex", + }, + { + ...conflict("c"), + memory_id: "c", + conflict_with: ["d"], + content_sha256: hashC, + value: "newer", + capture_origin: "claude-code", + }, + { + ...conflict("d"), + memory_id: "d", + conflict_with: ["c"], + content_sha256: hashD, + value: "older", + capture_origin: "claude-code", + }, + ], + next_before_version: null, + }); + vi.mocked(listAuditLog).mockResolvedValue({ + rows: [ + { + ts: "2026-09-20T00:00:00Z", + event_type: "memory.conflict_resolver", + actor: "process:loom", + request_id: "", + row_hash: "c".repeat(64), + subject: JSON.stringify({ + memory_id: "a", + content_sha256: hashA, + pairs: [ + { + peer_id: "b", + peer_sha256: hashB, + memory_sha256: hashA, + action: "flag", + verdict: "update", + confidence: 0.99, + same_entity: true, + same_attribute: true, + }, + ], + }), + }, + { + ts: "2026-09-20T00:00:00Z", + event_type: "memory.conflict_resolver", + actor: "process:loom", + request_id: "", + row_hash: "f".repeat(64), + subject: JSON.stringify({ + memory_id: "c", + content_sha256: hashC, + pairs: [ + { + peer_id: "d", + peer_sha256: hashD, + memory_sha256: hashC, + action: "flag", + verdict: "update", + confidence: 0.98, + same_entity: true, + same_attribute: true, + }, + ], + }), + }, + ], + }); + vi.mocked(acceptResolverSuggestions).mockResolvedValue({ + requested: 2, + resolved: 1, + stale: 1, + failed: 0, + results: [ + { memory_id: "a", peer_id: "b", status: "resolved" }, + { memory_id: "c", peer_id: "d", status: "stale", reason: "Memory revision changed" }, + ], + }); + seed("ns-a", "admin"); + const user = userEvent.setup(); + render(); + await waitFor(() => expect(listConflicts).toHaveBeenCalled(), WAIT); + await waitFor(() => expect(listAuditLog).toHaveBeenCalled(), WAIT); + await screen.findByText("Resolver update suggestions", {}, WAIT); + await user.click(screen.getByRole("button", { name: "Select all eligible" })); + await user.click(screen.getByRole("button", { name: "Accept selected" })); + await waitFor(() => expect(acceptResolverSuggestions).toHaveBeenCalledTimes(1), WAIT); + expect(acceptResolverSuggestions).toHaveBeenCalledWith({ org: ORG, namespace: "ns-a" }, [ + { memory_id: "a", peer_id: "b", memory_sha256: hashA, peer_sha256: hashB, suggestion_hash: "c".repeat(64) }, + { memory_id: "c", peer_id: "d", memory_sha256: hashC, peer_sha256: hashD, suggestion_hash: "f".repeat(64) }, + ]); + expect(await screen.findByText(/stale/)).toBeInTheDocument(); + }, 20000); afterEach(() => { cleanup(); useStore.setState({ whoami: null, myNamespaces: null }); @@ -249,6 +378,23 @@ describe("ReviewQueue", () => { expect(screen.getByRole("tab", { name: /Conflicts/ })).toHaveAttribute("aria-selected", "true"); }); + it("renders the resolver and provenance backlog as row counts", async () => { + vi.mocked(listConflicts).mockResolvedValue({ rows: [], next_before_version: null }); + vi.mocked(countReview).mockResolvedValue({ + total: 3, + backlog: { + pending_judgement: { plugin_captured: 2, caller_written: 1, unknown: 0 }, + resolver_judged: { plugin_captured: 0, caller_written: 0, unknown: 1 }, + cosine_only: { plugin_captured: 0, caller_written: 0, unknown: 0 }, + }, + }); + seed("ns-a", "admin"); + render(); + expect(await screen.findByText("Conflict backlog · conflicted rows", {}, WAIT)).toBeVisible(); + expect(screen.getByText("2 captured · 1 caller-written · 0 unknown")).toBeVisible(); + expect(screen.getByText("These are row counts. A conflict pair may contain more than one row.")).toBeVisible(); + }); + it("stays on Conflicts while a conflict is open, whatever else waits", async () => { vi.mocked(listConflicts).mockResolvedValue({ rows: [conflict("city")], next_before_version: null }); vi.mocked(countReview).mockResolvedValue({ total: 1, proposals: 2 }); diff --git a/frontend/src/views/admin/ReviewQueue.tsx b/frontend/src/views/admin/ReviewQueue.tsx index 784ab173863..fdbad08b52c 100644 --- a/frontend/src/views/admin/ReviewQueue.tsx +++ b/frontend/src/views/admin/ReviewQueue.tsx @@ -24,13 +24,18 @@ import { type AutoResolvedRow, type ConflictRow, type ReviewCounts, + type ConflictBacklog, type AllowlistRow, type ResolveDecision, type LearningEntry, type LearningStatus, proposeRevision, type RevisionSuggestion, + listAuditLog, + parseAuditSubject, + type AuditEntry, } from "../../api"; +import { acceptResolverSuggestions, type ResolverAcceptItem, type ResolverAcceptResult } from "../../api/conflicts"; import { DuplicatesPanel } from "./Duplicates"; import { ProposalsPanel } from "./Proposals"; import { useIdentity, useStore } from "../../lib/state"; @@ -301,6 +306,10 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void // holds in all. const [next, setNext] = useState(null); const [total, setTotal] = useState(null); + const [backlog, setBacklog] = useState(null); + const [resolverEvents, setResolverEvents] = useState([]); + const [bulkSelected, setBulkSelected] = useState>(new Set()); + const [bulkResults, setBulkResults] = useState(null); const [loadingMore, setLoadingMore] = useState(false); const [error, setError] = useState(null); const [index, setIndex] = useState(0); @@ -324,8 +333,10 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void setQueueFor(queueKey); setRows(null); setTotal(null); + setBacklog(null); setNext(null); setError(null); + setBulkResults(null); // A decision or a Load more still out was the old queue's: its controls are free here. setBusy(false); setLoadingMore(false); @@ -363,6 +374,8 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void (signal, live) => { focusAdded.current = null; setError(null); + setResolverEvents([]); + setBulkSelected(new Set()); const goneHere = new Set(); readsOut.current.add(goneHere); listConflicts({ org: identity.org, namespace: identity.namespace }, { limit: CONFLICT_PAGE, signal }) @@ -378,12 +391,28 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void if (live()) setError(e); }) .finally(() => readsOut.current.delete(goneHere)); + listAuditLog( + { org: identity.org, namespace: identity.namespace }, + { + limit: 500, + event_type: "memory.conflict_resolver", + fields: ["ts", "event_type", "actor", "subject", "request_id", "row_hash"], + signal, + }, + ) + .then((r) => { + if (live()) setResolverEvents(r.rows || []); + }) + .catch(() => { + if (live()) setResolverEvents([]); + }); const countHere = { taken: 0, stale: false }; countsOut.current.add(countHere); countReview({ org: identity.org, namespace: identity.namespace }, { fresh: true, signal }) .then((r) => { if (!live()) return; if (!countHere.stale) setTotal(Math.max((r.total ?? 0) - countHere.taken, 0)); + if (!countHere.stale && countHere.taken === 0) setBacklog(r.backlog ?? null); onCount(countHere.stale || countHere.taken > 0 ? null : r); }) .catch(() => { @@ -402,6 +431,12 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void if (rows.length === 0 && next !== null) setReload((n) => n + 1); }, [rows, next]); + const bulkOutcome = bulkResults && ( +
+ {bulkResults.map((r) => `${r.memory_id.slice(0, 8)}: ${r.status}${r.reason ? ` (${r.reason})` : ""}`).join(" · ")} +
+ ); + useEffect(() => { const at = focusAdded.current; if (at === null || loadingMore) return; @@ -441,19 +476,35 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void }; if (error) { - return setReload((n) => n + 1)} />; + return ( + <> + + {bulkOutcome} + setReload((n) => n + 1)} /> + + ); } // Emptied with more past it: the reload is reading them, so the queue is loading, not empty. if (rows === null || (rows.length === 0 && next !== null)) - return {}} loading />; + return ( + <> + + {bulkOutcome} + {}} loading /> + + ); if (rows.length === 0) { return ( - + <> + + {bulkOutcome} + + ); } @@ -461,6 +512,97 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void const at = Math.min(index, rows.length - 1); const current = rows[at]; + const byId = new Map(rows.map((r) => [r.memory_id, r])); + const suggestions: (ResolverAcceptItem & { + key: string; + target: ConflictRow; + peer: ConflictRow; + confidence: number; + })[] = []; + const latestPairSeen = new Set(); + for (const event of resolverEvents) { + if (!event.row_hash) continue; + const subject = parseAuditSubject(event.subject); + const memoryId = String(subject.memory_id || ""); + const judgedSha = String(subject.content_sha256 || ""); + const pairs = Array.isArray(subject.pairs) ? subject.pairs : []; + for (const raw of pairs) { + if (!raw || typeof raw !== "object") continue; + const p = raw as Record; + const peerId = String(p.peer_id || ""); + const pairKey = `${memoryId}/${peerId}`; + if (latestPairSeen.has(pairKey)) continue; + latestPairSeen.add(pairKey); + const target = byId.get(memoryId); + const peer = byId.get(peerId); + const confidence = Number(p.confidence); + if ( + !target || + !peer || + target.pinned || + peer.pinned || + target.sensitivity === "high" || + peer.sensitivity === "high" || + !target.conflict_with.includes(peerId) || + !peer.conflict_with.includes(memoryId) || + p.action !== "flag" || + p.verdict !== "update" || + p.same_entity !== true || + p.same_attribute !== true || + judgedSha !== target.content_sha256 || + p.memory_sha256 !== target.content_sha256 || + p.peer_sha256 !== peer.content_sha256 || + !Number.isFinite(confidence) + ) + continue; + const key = `${memoryId}/${peerId}/${event.row_hash}`; + suggestions.push({ + key, + target, + peer, + confidence, + memory_id: memoryId, + peer_id: peerId, + memory_sha256: target.content_sha256, + peer_sha256: peer.content_sha256, + suggestion_hash: event.row_hash, + }); + } + } + const uniqueSuggestions = [...new Map(suggestions.map((s) => [s.key, s])).values()]; + const selectableSuggestions = uniqueSuggestions.slice(0, 100); + + const acceptSelected = async () => { + if (resolveReason || busy) return; + const items = selectableSuggestions.filter((s) => bulkSelected.has(s.key)); + if (!items.length) return; + const yes = await confirmAction({ + title: `Accept ${items.length} resolver suggestion${items.length === 1 ? "" : "s"}?`, + message: + "Each suggestion is rechecked against the latest resolver audit and both current memory revisions. Changed or protected conflicts will be left for review.", + confirmLabel: "Accept suggestions", + }); + if (!yes) return; + setBusy(true); + try { + const result = await acceptResolverSuggestions( + { org: identity.org, namespace: identity.namespace }, + items.map(({ key: _key, target: _target, peer: _peer, confidence: _confidence, ...item }) => item), + ); + setBulkResults(result.results); + setBulkSelected(new Set()); + toast( + `${result.resolved} accepted · ${result.stale} stale · ${result.failed} failed`, + result.resolved ? "ok" : "error", + ); + if (result.resolved) setReload((n) => n + 1); + } catch (e) { + toastError("Couldn't accept resolver suggestions", e); + } finally { + setBusy(false); + } + }; + const peerId = current.conflict_with?.[0]; // The server's count is cached for a minute; it is never less than the rows on hand. const held = total === null ? null : Math.max(total, rows.length); @@ -484,6 +626,7 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void if (visit.current === myVisit) setReload((n) => n + 1); return; } + setBacklog(null); // refreshed with the next count after this decision toast("Resolved", "ok"); // The decided row and the peers the resolve wrote (affected_memory_ids: tombstoned or // made active) leave every list, on any visit; ids are org-wide, so no other queue @@ -534,6 +677,75 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void
Conflict {at + 1} of {(held ?? rows.length).toLocaleString()} · resolve in order
+ + {selectableSuggestions.length > 0 && ( + + +

+ Only current, flagged update judgements with matching memory revisions are selectable. +

+
+ + + {bulkSelected.size} selected + void acceptSelected()} + > + Accept selected + +
+
    + {selectableSuggestions.map((s) => ( +
  • + +
  • + ))} +
+ {bulkOutcome} +
+ )}
void ); } +function BacklogSummary({ backlog }: { backlog: ConflictBacklog | null }) { + if (!backlog) return null; + const states = [ + ["Awaiting resolver judgement", backlog.pending_judgement], + ["Resolver judged, still conflicted", backlog.resolver_judged], + ["Cosine-only", backlog.cosine_only], + ] as const; + return ( + +

Conflict backlog · conflicted rows

+
+ {states.map(([label, counts]) => ( +
+

{label}

+

+ {counts.plugin_captured.toLocaleString()} captured · {counts.caller_written.toLocaleString()}{" "} + caller-written · {counts.unknown.toLocaleString()} unknown +

+
+ ))} +
+

+ These are row counts. A conflict pair may contain more than one row. +

+
+ ); +} + /** A suggestion in the words of the buttons above it; every suggestion is about A, the * conflict on screen. */ const SUGGESTION_LABEL: Record = { diff --git a/integrations/claude-code-plugin/.claude-plugin/plugin.json b/integrations/claude-code-plugin/.claude-plugin/plugin.json index f882a34cba1..4ded5530d8b 100644 --- a/integrations/claude-code-plugin/.claude-plugin/plugin.json +++ b/integrations/claude-code-plugin/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "loom", "displayName": "ClickHouse Loom", - "version": "1.2.158", + "version": "1.2.159", "description": "Shared long-term memory and code intelligence for Claude Code, self-hosted on ClickHouse. MCP tools to save and recall decisions, preferences and corrections across sessions and teammates; lifecycle hooks that capture each session with no model call; a code index that answers where-is, who-calls and blast-radius questions with line-accurate units instead of whole-file reads.", "author": { "name": "ClickHouse" diff --git a/integrations/claude-code-plugin/hooks/hooks.json b/integrations/claude-code-plugin/hooks/hooks.json index 8097b5ec893..193c21db7c1 100644 --- a/integrations/claude-code-plugin/hooks/hooks.json +++ b/integrations/claude-code-plugin/hooks/hooks.json @@ -7,6 +7,11 @@ "type": "command", "command": "node", "args": ["${CLAUDE_PLUGIN_ROOT}/hooks/loom-session-start.mjs", "SessionStart"] + }, + { + "type": "command", + "command": "node", + "args": ["${CLAUDE_PLUGIN_ROOT}/hooks/loom-review-notice.mjs", "SessionStart"] } ] } diff --git a/integrations/claude-code-plugin/hooks/loom-review-notice.mjs b/integrations/claude-code-plugin/hooks/loom-review-notice.mjs new file mode 100644 index 00000000000..ac3971e303d --- /dev/null +++ b/integrations/claude-code-plugin/hooks/loom-review-notice.mjs @@ -0,0 +1,45 @@ +// A synchronous SessionStart hook for a human-visible notice. The ordinary +// SessionStart hook prints agent context; this hook uses Claude Code's +// user-visible systemMessage field instead. + +import { + postBounded, + readStdinJson, + resolveScope, + resolveServerUrl, + resolveToken, + runHookMain, +} from "../lib/loom-client.mjs"; +import { reviewNotice } from "../lib/review-notice.mjs"; +import { readJsonFile, tmpStatePath, writeJsonFile } from "../lib/tmp-state.mjs"; + +async function main() { + const token = resolveToken(); + if (!token) return; + + const payload = await readStdinJson(); + const scope = resolveScope(payload.cwd); + if (!scope.org || !scope.namespace) return; + + const serverUrl = resolveServerUrl(); + const key = `${serverUrl}|${scope.org}|${scope.namespace}`; + const path = tmpStatePath("review-notice", key); + const previous = readJsonFile(path, null); + const counts = await postBounded( + "conflicts.list", + { org: scope.org, namespace: scope.namespace, count_only: true }, + { token, serverUrl }, + ); + const notice = reviewNotice({ + count: counts?.total, + serverUrl, + namespace: scope.namespace, + previous, + }); + if (!notice) return; + + writeJsonFile(path, notice.state); + process.stdout.write(`${JSON.stringify({ systemMessage: notice.message })}\n`); +} + +runHookMain(main); diff --git a/integrations/claude-code-plugin/lib/review-notice.mjs b/integrations/claude-code-plugin/lib/review-notice.mjs new file mode 100644 index 00000000000..faf140863e6 --- /dev/null +++ b/integrations/claude-code-plugin/lib/review-notice.mjs @@ -0,0 +1,31 @@ +// The human-facing SessionStart notice is separate from the primer injected into +// the agent's context. Keep the workload terminology row-based: conflicts.list +// counts conflicted memory rows, not independent pairs. + +export const REVIEW_NOTICE_INTERVAL_MS = 24 * 60 * 60 * 1000; + +export function reviewNotice({ count, serverUrl, namespace, previous, now = Date.now() }) { + const rows = Number(count); + if (!Number.isSafeInteger(rows) || rows <= 0 || !namespace) return null; + + const priorRows = Number(previous?.count); + const priorAt = Number(previous?.notified_at); + if (priorRows === rows && Number.isFinite(priorAt) && priorAt <= now && now - priorAt < REVIEW_NOTICE_INTERVAL_MS) { + return null; + } + + let reviewUrl; + try { + reviewUrl = new URL("/admin/review_queue", serverUrl); + reviewUrl.searchParams.set("namespace", namespace); + } catch { + return null; + } + + return { + message: + `Loom memory review needed: ${rows.toLocaleString()} conflicted rows need attention. ` + + `Review the namespace queue: ${reviewUrl.toString()}`, + state: { count: rows, notified_at: now }, + }; +} diff --git a/integrations/claude-code-plugin/tests/review-notice.test.mjs b/integrations/claude-code-plugin/tests/review-notice.test.mjs new file mode 100644 index 00000000000..92fd1844619 --- /dev/null +++ b/integrations/claude-code-plugin/tests/review-notice.test.mjs @@ -0,0 +1,110 @@ +import { test } from "node:test"; +import assert from "node:assert/strict"; +import { spawn } from "node:child_process"; +import fs from "node:fs"; +import http from "node:http"; +import os from "node:os"; +import path from "node:path"; +import { fileURLToPath } from "node:url"; +import "./temp-home.mjs"; +import { REVIEW_NOTICE_INTERVAL_MS, reviewNotice } from "../lib/review-notice.mjs"; + +const HOOK = fileURLToPath(new URL("../hooks/loom-review-notice.mjs", import.meta.url)); +const ROOT = fileURLToPath(new URL("../../../", import.meta.url)); + +test("reviewNotice is silent for empty, invalid, or unscoped results", () => { + const base = { serverUrl: "https://loom.example", namespace: "team" }; + assert.equal(reviewNotice({ ...base, count: 0 }), null); + assert.equal(reviewNotice({ ...base, count: "not a count" }), null); + assert.equal(reviewNotice({ serverUrl: base.serverUrl, count: 2 }), null); +}); + +test("reviewNotice links to the namespace queue and calls the number conflicted rows", () => { + const result = reviewNotice({ + count: 8, + serverUrl: "https://loom.example/base/", + namespace: "team space", + now: 10_000, + }); + assert.equal( + result.message, + "Loom memory review needed: 8 conflicted rows need attention. Review the namespace queue: https://loom.example/admin/review_queue?namespace=team+space", + ); + assert.deepEqual(result.state, { count: 8, notified_at: 10_000 }); +}); + +test("reviewNotice throttles an unchanged backlog and reports changed or stale counts", () => { + const base = { + count: 4, + serverUrl: "https://loom.example", + namespace: "team", + previous: { count: 4, notified_at: 50_000 }, + }; + assert.equal(reviewNotice({ ...base, now: 50_001 }), null); + assert.notEqual(reviewNotice({ ...base, count: 5, now: 50_001 }), null); + assert.notEqual(reviewNotice({ ...base, now: 50_000 + REVIEW_NOTICE_INTERVAL_MS }), null); +}); + +test("SessionStart sends a scoped count and emits a throttled user-visible systemMessage", async () => { + const home = fs.mkdtempSync(path.join(os.tmpdir(), "loom-review-notice-")); + let count = 3; + let requests = 0; + const server = http.createServer((req, res) => { + requests += 1; + let body = ""; + req.on("data", (part) => (body += part)); + req.on("end", () => { + assert.equal(req.url, "/v1/conflicts.list"); + assert.equal(req.headers.authorization, `Bearer ${token}`); + assert.deepEqual(JSON.parse(body), { + org: "acme", + namespace: "team", + count_only: true, + }); + res.writeHead(200, { "Content-Type": "application/json" }); + res.end(JSON.stringify({ total: count })); + }); + }); + await new Promise((resolve) => server.listen(0, "127.0.0.1", resolve)); + const baseUrl = `http://127.0.0.1:${server.address().port}`; + const token = `x.${Buffer.from(JSON.stringify({ org: "acme", namespaces: ["team"] })).toString("base64url")}.x`; + const env = { + ...process.env, + HOME: home, + USERPROFILE: home, + TMPDIR: home, + LOOM_API_KEY: token, + LOOM_BASE_URL: baseUrl, + LOOM_ORG: "acme", + LOOM_NAMESPACE: "team", + LOOM_HOOK_TIMEOUT_MS: "1500", + }; + const invoke = () => + new Promise((resolve, reject) => { + const child = spawn(process.execPath, [HOOK, "SessionStart"], { env, stdio: ["pipe", "pipe", "pipe"] }); + let stdout = ""; + let stderr = ""; + child.stdout.setEncoding("utf8").on("data", (part) => (stdout += part)); + child.stderr.setEncoding("utf8").on("data", (part) => (stderr += part)); + child.on("error", reject); + child.on("close", (code) => (code === 0 ? resolve({ stdout, stderr }) : reject(new Error(stderr)))); + child.stdin.end(JSON.stringify({ cwd: ROOT })); + }); + try { + const first = await invoke(); + const output = JSON.parse(first.stdout); + assert.match(output.systemMessage, /3 conflicted rows/); + assert.match(output.systemMessage, /\/admin\/review_queue\?namespace=team/); + assert.equal(output.hookSpecificOutput, undefined); + + const repeated = await invoke(); + assert.equal(repeated.stdout, ""); + count = 4; + const changed = await invoke(); + assert.match(JSON.parse(changed.stdout).systemMessage, /4 conflicted rows/); + assert.equal(requests, 3); + } finally { + await new Promise((resolve) => server.close(resolve)); + fs.rmSync(home, { recursive: true, force: true }); + } +}); diff --git a/integrations/codex-plugin/.codex-plugin/plugin.json b/integrations/codex-plugin/.codex-plugin/plugin.json index 33322e89d60..699ac09fc58 100644 --- a/integrations/codex-plugin/.codex-plugin/plugin.json +++ b/integrations/codex-plugin/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "loom", - "version": "1.2.158", + "version": "1.2.159", "description": "Shared long-term memory and code intelligence for Codex, self-hosted on ClickHouse. MCP tools to save and recall decisions, preferences and corrections across sessions and teammates; lifecycle hooks that capture each session with no model call; a code index that answers where-is, who-calls and blast-radius questions with line-accurate units instead of whole-file reads.", "author": { "name": "ClickHouse" diff --git a/integrations/codex-plugin/hooks/loom-review-notice.mjs b/integrations/codex-plugin/hooks/loom-review-notice.mjs new file mode 100644 index 00000000000..ac3971e303d --- /dev/null +++ b/integrations/codex-plugin/hooks/loom-review-notice.mjs @@ -0,0 +1,45 @@ +// A synchronous SessionStart hook for a human-visible notice. The ordinary +// SessionStart hook prints agent context; this hook uses Claude Code's +// user-visible systemMessage field instead. + +import { + postBounded, + readStdinJson, + resolveScope, + resolveServerUrl, + resolveToken, + runHookMain, +} from "../lib/loom-client.mjs"; +import { reviewNotice } from "../lib/review-notice.mjs"; +import { readJsonFile, tmpStatePath, writeJsonFile } from "../lib/tmp-state.mjs"; + +async function main() { + const token = resolveToken(); + if (!token) return; + + const payload = await readStdinJson(); + const scope = resolveScope(payload.cwd); + if (!scope.org || !scope.namespace) return; + + const serverUrl = resolveServerUrl(); + const key = `${serverUrl}|${scope.org}|${scope.namespace}`; + const path = tmpStatePath("review-notice", key); + const previous = readJsonFile(path, null); + const counts = await postBounded( + "conflicts.list", + { org: scope.org, namespace: scope.namespace, count_only: true }, + { token, serverUrl }, + ); + const notice = reviewNotice({ + count: counts?.total, + serverUrl, + namespace: scope.namespace, + previous, + }); + if (!notice) return; + + writeJsonFile(path, notice.state); + process.stdout.write(`${JSON.stringify({ systemMessage: notice.message })}\n`); +} + +runHookMain(main); diff --git a/integrations/codex-plugin/lib/review-notice.mjs b/integrations/codex-plugin/lib/review-notice.mjs new file mode 100644 index 00000000000..faf140863e6 --- /dev/null +++ b/integrations/codex-plugin/lib/review-notice.mjs @@ -0,0 +1,31 @@ +// The human-facing SessionStart notice is separate from the primer injected into +// the agent's context. Keep the workload terminology row-based: conflicts.list +// counts conflicted memory rows, not independent pairs. + +export const REVIEW_NOTICE_INTERVAL_MS = 24 * 60 * 60 * 1000; + +export function reviewNotice({ count, serverUrl, namespace, previous, now = Date.now() }) { + const rows = Number(count); + if (!Number.isSafeInteger(rows) || rows <= 0 || !namespace) return null; + + const priorRows = Number(previous?.count); + const priorAt = Number(previous?.notified_at); + if (priorRows === rows && Number.isFinite(priorAt) && priorAt <= now && now - priorAt < REVIEW_NOTICE_INTERVAL_MS) { + return null; + } + + let reviewUrl; + try { + reviewUrl = new URL("/admin/review_queue", serverUrl); + reviewUrl.searchParams.set("namespace", namespace); + } catch { + return null; + } + + return { + message: + `Loom memory review needed: ${rows.toLocaleString()} conflicted rows need attention. ` + + `Review the namespace queue: ${reviewUrl.toString()}`, + state: { count: rows, notified_at: now }, + }; +} diff --git a/schemas/migrations/120_captured_conflict_provenance.sql b/schemas/migrations/120_captured_conflict_provenance.sql new file mode 100644 index 00000000000..4aa6b9a67ee --- /dev/null +++ b/schemas/migrations/120_captured_conflict_provenance.sql @@ -0,0 +1,25 @@ +-- A signed integration credential is the only source of captured-memory provenance. +ALTER TABLE loom.memory + ADD COLUMN IF NOT EXISTS capture_origin LowCardinality(String) DEFAULT ''; +ALTER TABLE loom.memory_versions + ADD COLUMN IF NOT EXISTS capture_origin LowCardinality(String) DEFAULT ''; +ALTER TABLE loom.namespaces + ADD COLUMN IF NOT EXISTS captured_conflict_policy LowCardinality(String) DEFAULT 'manual_review'; +ALTER TABLE loom.namespaces + ADD COLUMN IF NOT EXISTS captured_conflict_confidence Float32 DEFAULT 0.98; + +-- Recreate the append-only history mirror so new memory versions preserve provenance. +DROP VIEW IF EXISTS loom.memory_versions_mv; +CREATE MATERIALIZED VIEW loom.memory_versions_mv TO loom.memory_versions +AS SELECT + org, namespace, agent, user_id, session_id, memory_key, memory_type, value, + value_json, confidence, source_trace, version, tombstoned_at, created_at, + expires_at, pinned, run_id, entities, memory_id, redacted_at, redaction_reason, + status, requires_review, conflict_with, duplicate_of, evidence_count, recall_count, last_recalled_at, + cross_promoted_from_memory_id, cross_promoted_from_namespace, tags, files, concepts, + superseded_by, rejection_reason, temporal_anchor, temporal_confidence, updated_at, + valid_at, valid_to, invalid_at, char_limit, reinforcement_count, last_reinforced_at, + mentioned_at, source_resource_id, content_sha256, verified_by, verified_at, + verified_sha256, grounding, evidence, sensitivity, actor, source_class, lock_mode, + lock_reason, lock_until, locked_by, locked_at, on_expire, expire_reason, capture_origin +FROM loom.memory; diff --git a/schemas/schema.sql b/schemas/schema.sql index e0ae676e712..407e4b368e3 100644 --- a/schemas/schema.sql +++ b/schemas/schema.sql @@ -2518,6 +2518,7 @@ CREATE TABLE IF NOT EXISTS loom.memory `sensitivity` LowCardinality(String) DEFAULT '', `value_preview` String MATERIALIZED substring(value, 1, 2048), `value_len` UInt32 MATERIALIZED length(value), + `capture_origin` LowCardinality(String) DEFAULT '', INDEX type_skip memory_type TYPE set(8) GRANULARITY 4, INDEX pinned_skip pinned TYPE set(2) GRANULARITY 4, INDEX entities_skip entities TYPE bloom_filter(0.01) GRANULARITY 4, @@ -3254,6 +3255,7 @@ CREATE TABLE IF NOT EXISTS loom.memory_versions `sensitivity` LowCardinality(String) DEFAULT '', `value_preview` String MATERIALIZED substring(value, 1, 2048), `value_len` UInt32 MATERIALIZED length(value), + `capture_origin` LowCardinality(String) DEFAULT '', INDEX memory_id_skip memory_id TYPE bloom_filter(0.01) GRANULARITY 4, INDEX memory_key_bloom_idx memory_key TYPE bloom_filter(0.01) GRANULARITY 4 ) @@ -3543,7 +3545,9 @@ CREATE TABLE IF NOT EXISTS loom.namespaces `code_change_policy` LowCardinality(String) DEFAULT '', `released_aliases` Array(String) DEFAULT [], `daily_user_cost_cap_usd` Float64 DEFAULT 0, - `budget_alert_inbox` String DEFAULT '' + `budget_alert_inbox` String DEFAULT '', + `captured_conflict_policy` LowCardinality(String) DEFAULT 'manual_review', + `captured_conflict_confidence` Float32 DEFAULT 0.98 ) ENGINE = ReplacingMergeTree(updated_at) PARTITION BY org @@ -6082,7 +6086,8 @@ CREATE MATERIALIZED VIEW IF NOT EXISTS loom.memory_versions_mv TO loom.memory_ve `locked_by` String, `locked_at` Nullable(DateTime), `on_expire` LowCardinality(String), - `expire_reason` String + `expire_reason` String, + `capture_origin` LowCardinality(String) ) AS SELECT org, @@ -6146,7 +6151,8 @@ AS SELECT locked_by, locked_at, on_expire, - expire_reason + expire_reason, + capture_origin FROM loom.memory; -- loom.session_brief_revisions_mv diff --git a/scripts/ops/simulate_captured_conflicts.py b/scripts/ops/simulate_captured_conflicts.py new file mode 100644 index 00000000000..f58eecebbba --- /dev/null +++ b/scripts/ops/simulate_captured_conflicts.py @@ -0,0 +1,274 @@ +"""Deterministic seven-day workload model for captured conflict settlement. + +This uses Loom's production resolver decision helpers with fixed verdicts. It does not +call an LLM or ClickHouse; queue service limits and resolver latency are explicit model +inputs so the report does not imply a production capacity guarantee. +""" + +from __future__ import annotations + +import argparse +import json +import random +from dataclasses import asdict, dataclass + +from server.memory.domain import conflict_resolution as cr + +SEED = 2077 +DAYS = 7 +BATCH = 40 # settings.memory_conflict_resolver_batch default +CONCURRENCY = 8 # settings.memory_conflict_resolver_concurrency default +BURST_SECONDS = 300 # settings.memory_conflict_resolver_burst_seconds default +MAX_ATTEMPTS = 3 # settings.memory_conflict_resolver_max_attempts default + + +@dataclass(frozen=True) +class Case: + kind: str + source: str + verdict: str + confidence: float + same_entity: bool = True + same_attribute: bool = True + origin: str = "" + + +@dataclass +class Metrics: + total_captured_rows: int = 0 + conflicted_rows: int = 0 + resolver_pending: int = 0 + resolver_judged: int = 0 + cosine_only: int = 0 + plugin_captured_rows: int = 0 + caller_written_rows: int = 0 + unknown_provenance_rows: int = 0 + automatically_settled: int = 0 + policy_automatically_settled: int = 0 + human_reviewable_pairs: int = 0 + audit_records_created: int = 0 + successful_undos: int = 0 + failed_resolver_jobs: int = 0 + backlog_growth: int = 0 + processing_latency_seconds: float = 0.0 + false_automatic_settlements: int = 0 + genuine_contradictions_settled: int = 0 + retries: int = 0 + caller_auto_settled: int = 0 + + +@dataclass(frozen=True) +class Scenario: + name: str + candidates_per_day: int + daily_resolver_call_cap: int + review_capacity_per_sitting: int + + +def _cases(seed: int, candidates: int, day: int) -> list[Case]: + rng = random.Random(seed + day * 100_003 + candidates) + kinds = [ + ("plugin_update", 24), + ("plugin_contradiction", 10), + ("plugin_repeat", 16), + ("caller_update", 12), + ("unknown_update", 12), + ("low_confidence_update", 8), + ("extracted_fact_update", 7), + ("session_brief_update", 6), + ("cosine_only", 5), + ] + weights = [weight for _, weight in kinds] + out: list[Case] = [] + for _ in range(candidates): + kind = rng.choices([name for name, _ in kinds], weights=weights, k=1)[0] + if kind == "cosine_only": + out.append(Case(kind, "unknown", "", 0)) + elif kind == "plugin_contradiction": + out.append(Case(kind, "plugin", cr.CONTRADICTION, 0.99, origin="codex")) + elif kind == "plugin_repeat": + out.append(Case(kind, "plugin", cr.RESTATEMENT, 0.96, origin="claude-code")) + elif kind == "caller_update": + out.append(Case(kind, "caller", cr.UPDATE, 0.99)) + elif kind == "unknown_update": + out.append(Case(kind, "unknown", cr.UPDATE, 0.99)) + elif kind == "low_confidence_update": + out.append(Case(kind, "plugin", cr.UPDATE, 0.97, origin="codex")) + elif kind in {"extracted_fact_update", "session_brief_update"}: + origin = "claude-code" if rng.random() < 0.5 else "codex" + out.append(Case(kind, "plugin", cr.UPDATE, 0.99, origin=origin)) + else: + out.append(Case(kind, "plugin", cr.UPDATE, 0.99, origin="codex")) + return out + + +def _scenario( + scenario: Scenario, *, seed: int, captured_policy: bool +) -> dict[str, int | float | str]: + m = Metrics(total_captured_rows=scenario.candidates_per_day * DAYS) + owed_queue: list[tuple[Case, int]] = [] + review_backlog = 0 + for day in range(DAYS): + daily = _cases(seed, scenario.candidates_per_day, day) + m.plugin_captured_rows += sum(c.source == "plugin" for c in daily) + m.caller_written_rows += sum(c.source == "caller" for c in daily) + m.unknown_provenance_rows += sum(c.source == "unknown" for c in daily) + m.cosine_only += sum(c.verdict == "" for c in daily) + owed = [c for c in daily if c.verdict] + m.conflicted_rows += len(owed) * 2 + owed_queue.extend((c, 0) for c in owed) + batch_seconds = (BATCH / CONCURRENCY) * 0.8 + burst_call_cap = BATCH * int(BURST_SECONDS // batch_seconds) + # A rolling daily call cap represents cost-share throttling; it is not a dollar + # estimate. The worker also repeatedly batches within its burst window. + call_budget = min(scenario.daily_resolver_call_cap, burst_call_cap) + judged_today: list[Case] = [] + calls = 0 + rng = random.Random(seed + day * 71 + scenario.candidates_per_day) + while owed_queue and calls < call_budget: + c, attempts = owed_queue.pop(0) + calls += 1 + # Controlled transient response: one retry succeeds; it consumes a call slot. + failed_first = rng.random() < 0.01 + if failed_first: + retries = min(MAX_ATTEMPTS - 1, 1) + if retries and calls < call_budget: + calls += retries + m.retries += retries + else: + owed_queue.append((c, attempts + 1)) + continue + judged_today.append(c) + m.resolver_judged += len(judged_today) + m.processing_latency_seconds += (calls / CONCURRENCY) * 0.8 + for c in judged_today: + if c.kind == "plugin_contradiction": + action = cr.action_for( + cr.PeerVerdict( + "peer", c.verdict, c.confidence, c.same_entity, c.same_attribute, "" + ), + policy="auto_reinforce", + retire_at=0.98, + clear_at=0.90, + flag_at=0.95, + ) + if action == cr.FLAG: + review_backlog += 1 + m.audit_records_created += 1 + continue + if c.kind == "plugin_repeat": + m.audit_records_created += 1 + continue + if c.kind == "cosine_only": + continue + verdict = cr.PeerVerdict( + "peer", c.verdict, c.confidence, c.same_entity, c.same_attribute, "" + ) + action = cr.action_for( + verdict, + policy="auto_reinforce", + retire_at=0.98, + clear_at=0.90, + flag_at=0.95, + ) + trusted = c.source == "plugin" and c.origin in {"claude-code", "codex"} + # Production re-checks both rows under key locks. This model holds identity and + # revision constant, and uses the same domain predicate for the opt-in branch. + allowed = captured_policy and cr.captured_update_eligible( + policy="resolver_update", + verdict=c.verdict, + confidence=c.confidence, + threshold=0.98, + same_entity=c.same_entity, + same_attribute=c.same_attribute, + winner_origin=c.origin, + retired_origin=c.origin if trusted else "", + winner_agent="agent-a", + retired_agent="agent-a", + winner_user_id="user-a", + retired_user_id="user-a", + cross_session=False, + ) + if action == cr.RETIRE and trusted and not allowed: + action = cr.FLAG + if allowed: + action = cr.RETIRE + m.policy_automatically_settled += 1 + if action == cr.RETIRE: + m.automatically_settled += 1 + m.audit_records_created += 2 # resolver verdict plus memory.auto_supersede + if c.source == "caller": + m.caller_auto_settled += 1 + if c.verdict == cr.CONTRADICTION: + m.genuine_contradictions_settled += 1 + elif action == cr.FLAG: + review_backlog += 1 + m.audit_records_created += 1 + m.resolver_pending = len(owed_queue) + m.human_reviewable_pairs = review_backlog + m.backlog_growth = max(0, review_backlog - scenario.review_capacity_per_sitting) + return { + "scenario": scenario.name, + **asdict(m), + "review_capacity_per_sitting": scenario.review_capacity_per_sitting, + } + + +def run(seed: int = SEED, review_capacity_per_sitting: int = 2000) -> dict[str, object]: + scenarios = [ + Scenario("light", 100, 120, review_capacity_per_sitting), + Scenario("steady", 250, 280, review_capacity_per_sitting), + Scenario("surge", 500, 520, review_capacity_per_sitting), + ] + default = [_scenario(s, seed=seed, captured_policy=False) for s in scenarios] + opted_in = [_scenario(s, seed=seed, captured_policy=True) for s in scenarios] + for before, after in zip(default, opted_in, strict=True): + assert after["human_reviewable_pairs"] < before["human_reviewable_pairs"] + assert after["genuine_contradictions_settled"] == 0 + assert after["caller_auto_settled"] == before["caller_auto_settled"] + assert after["unknown_provenance_rows"] > 0 + assert after["policy_automatically_settled"] <= after["audit_records_created"] + assert after["backlog_growth"] == 0 + return { + "seed": seed, + "days": DAYS, + "assumptions": { + "fixed_resolver_verdicts": True, + "external_llm_calls": 0, + "batch_size": BATCH, + "concurrency": CONCURRENCY, + "burst_seconds": BURST_SECONDS, + "max_attempts": MAX_ATTEMPTS, + "daily_call_cap_is_cost_share_proxy": True, + "review_capacity_is_user_configured": review_capacity_per_sitting, + "undo_events_in_generated_workload": 0, + }, + "default_policy": default, + "opt_in_capture_policy": opted_in, + "checks": { + "opt_in_reduces_review_backlog": True, + "genuine_contradictions_remain_reviewable": True, + "plugin_policy_does_not_add_caller_auto_settlement": True, + "unknown_provenance_not_trusted_by_plugin_policy": True, + "policy_retirements_have_audit_records": True, + "review_backlog_fits_configured_capacity": True, + }, + "limitations": [ + "Synthetic case mixes and fixed verdicts do not represent production distributions.", + "The worker batch, concurrency, burst and attempt defaults are modeled; a call cap " + "stands in for cost-share reads.", + "The model excludes database races, provider latency distributions and restore writes.", + ], + } + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--seed", type=int, default=SEED) + parser.add_argument("--review-capacity-per-sitting", type=int, default=2000) + args = parser.parse_args() + print(json.dumps(run(args.seed, args.review_capacity_per_sitting), indent=2, sort_keys=True)) + + +if __name__ == "__main__": + main() diff --git a/sdk/go/client.gen.go b/sdk/go/client.gen.go index bd3ffc90bf9..307387f7009 100644 --- a/sdk/go/client.gen.go +++ b/sdk/go/client.gen.go @@ -626,6 +626,12 @@ type CollectionMoveInput = wire.CollectionMoveInput // CollectionMoveOutput is the response from collection.move. type CollectionMoveOutput = wire.CollectionMoveOutput +// ConflictBacklog is a model used by Loom operations. +type ConflictBacklog = wire.ConflictBacklog + +// ConflictBulkResult is a model used by Loom operations. +type ConflictBulkResult = wire.ConflictBulkResult + // ConflictCandidateMemory is a model used by Loom operations. type ConflictCandidateMemory = wire.ConflictCandidateMemory @@ -635,6 +641,9 @@ type ConflictRevisionSuggestion = wire.ConflictRevisionSuggestion // ConflictRow is a model used by Loom operations. type ConflictRow = wire.ConflictRow +// ConflictSourceCounts is a model used by Loom operations. +type ConflictSourceCounts = wire.ConflictSourceCounts + // ConflictsAllowlistListInput is the request to conflicts.allowlist_list. type ConflictsAllowlistListInput = wire.ConflictsAllowlistListInput @@ -647,6 +656,12 @@ type ConflictsAllowlistRemoveInput = wire.ConflictsAllowlistRemoveInput // ConflictsAllowlistRemoveOutput is the response from conflicts.allowlist_remove. type ConflictsAllowlistRemoveOutput = wire.ConflictsAllowlistRemoveOutput +// ConflictsBulkAcceptInput is the request to conflicts.bulk_accept. +type ConflictsBulkAcceptInput = wire.ConflictsBulkAcceptInput + +// ConflictsBulkAcceptOutput is the response from conflicts.bulk_accept. +type ConflictsBulkAcceptOutput = wire.ConflictsBulkAcceptOutput + // ConflictsListInput is the request to conflicts.list. type ConflictsListInput = wire.ConflictsListInput @@ -665,6 +680,9 @@ type ConflictsResolveInput = wire.ConflictsResolveInput // ConflictsResolveOutput is the response from conflicts.resolve. type ConflictsResolveOutput = wire.ConflictsResolveOutput +// ConflictsResolverAcceptItem is a model used by Loom operations. +type ConflictsResolverAcceptItem = wire.ConflictsResolverAcceptItem + // ConnectedAgent is a model used by Loom operations. type ConnectedAgent = wire.ConnectedAgent @@ -4492,6 +4510,17 @@ func (s ConflictsService) AllowlistRemove(ctx context.Context, in ConflictsAllow return callOperation[ConflictsAllowlistRemoveOutput](s.client, ctx, "conflicts.allowlist_remove", in) } +// BulkAccept calls conflicts.bulk_accept. +func (s ConflictsService) BulkAccept(ctx context.Context, in ConflictsBulkAcceptInput) (*ConflictsBulkAcceptOutput, error) { + if in.Namespace == "" { + in.Namespace = s.client.identity.Namespace + } + if in.Org == "" { + in.Org = s.client.identity.Org + } + return callOperation[ConflictsBulkAcceptOutput](s.client, ctx, "conflicts.bulk_accept", in) +} + // List calls conflicts.list. // Use WithInput to supply additional request fields. func (s ConflictsService) List(ctx context.Context, opts ...Option[ConflictsListInput]) (*ConflictsListOutput, error) { diff --git a/sdk/go/wire/models.gen.go b/sdk/go/wire/models.gen.go index e455dc9c320..1e8e0af993e 100644 --- a/sdk/go/wire/models.gen.go +++ b/sdk/go/wire/models.gen.go @@ -1,5 +1,5 @@ // Code generated by scripts/codegen/sdk_go_gen.py; DO NOT EDIT. -// Registry model schema SHA-256: 1dafd83b6b775ec8e510f2db051c5b37bac6079e81a01ef9771c0236adf12e9d +// Registry model schema SHA-256: ca6a2d74342b152079361410074fb0209c92dc4347e57b728a1fe2fcda240b78 // Package wire contains the Go requests and responses for Loom operations. package wire @@ -2803,6 +2803,21 @@ type CollectionMoveOutput struct { Moved bool `json:"moved"` } +// ConflictBacklog is a model used by Loom operations. +type ConflictBacklog struct { + PendingJudgement *ConflictSourceCounts `json:"pending_judgement,omitempty"` + ResolverJudged *ConflictSourceCounts `json:"resolver_judged,omitempty"` + CosineOnly *ConflictSourceCounts `json:"cosine_only,omitempty"` +} + +// ConflictBulkResult is a model used by Loom operations. +type ConflictBulkResult struct { + MemoryID string `json:"memory_id"` + PeerID string `json:"peer_id"` + Status string `json:"status"` + Reason *string `json:"reason,omitempty"` +} + // ConflictCandidateMemory is a model used by Loom operations. type ConflictCandidateMemory struct { LocalID int64 `json:"local_id"` @@ -2834,6 +2849,14 @@ type ConflictRow struct { ConflictWith *[]string `json:"conflict_with,omitempty"` ContentSHA256 *string `json:"content_sha256,omitempty"` Sensitivity *string `json:"sensitivity,omitempty"` + CaptureOrigin *string `json:"capture_origin,omitempty"` +} + +// ConflictSourceCounts is a model used by Loom operations. +type ConflictSourceCounts struct { + PluginCaptured *int64 `json:"plugin_captured,omitempty"` + CallerWritten *int64 `json:"caller_written,omitempty"` + Unknown *int64 `json:"unknown,omitempty"` } // ConflictsAllowlistListInput is the request to conflicts.allowlist_list. @@ -2869,6 +2892,25 @@ type ConflictsAllowlistRemoveOutput struct { Removed bool `json:"removed"` } +// ConflictsBulkAcceptInput is the request to conflicts.bulk_accept. +type ConflictsBulkAcceptInput struct { + Org string `json:"org"` + Namespace string `json:"namespace"` + Items []ConflictsResolverAcceptItem `json:"items"` +} + +// ConflictsBulkAcceptOutput is the response from conflicts.bulk_accept. +type ConflictsBulkAcceptOutput struct { + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Results []ConflictBulkResult `json:"results"` + Requested int64 `json:"requested"` + Resolved int64 `json:"resolved"` + Stale int64 `json:"stale"` + Failed int64 `json:"failed"` +} + // ConflictsListInput is the request to conflicts.list. type ConflictsListInput struct { Org string `json:"org"` @@ -2883,14 +2925,15 @@ type ConflictsListInput struct { // ConflictsListOutput is the response from conflicts.list. type ConflictsListOutput struct { - IgnoredArgs *[]string `json:"ignored_args,omitempty"` - DidYouMean *map[string]string `json:"did_you_mean,omitempty"` - Mirrored *bool `json:"mirrored,omitempty"` - Rows []ConflictRow `json:"rows"` - NextBeforeVersion Optional[uint64] `json:"next_before_version,omitempty"` - Total Optional[int64] `json:"total,omitempty"` - Proposals Optional[int64] `json:"proposals,omitempty"` - Keys Optional[[]string] `json:"keys,omitempty"` + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Rows []ConflictRow `json:"rows"` + NextBeforeVersion Optional[uint64] `json:"next_before_version,omitempty"` + Total Optional[int64] `json:"total,omitempty"` + Proposals Optional[int64] `json:"proposals,omitempty"` + Backlog Optional[ConflictBacklog] `json:"backlog,omitempty"` + Keys Optional[[]string] `json:"keys,omitempty"` } // ConflictsProposeRevisionInput is the request to conflicts.propose_revision. @@ -2935,6 +2978,15 @@ type ConflictsResolveOutput struct { Total Optional[int64] `json:"total,omitempty"` } +// ConflictsResolverAcceptItem is a model used by Loom operations. +type ConflictsResolverAcceptItem struct { + MemoryID string `json:"memory_id"` + PeerID string `json:"peer_id"` + MemorySHA256 string `json:"memory_sha256"` + PeerSHA256 string `json:"peer_sha256"` + SuggestionHash string `json:"suggestion_hash"` +} + // ConnectedAgent is a model used by Loom operations. type ConnectedAgent struct { Agent string `json:"agent"` @@ -6304,21 +6356,24 @@ type MemoryAssignCategoryOutput struct { // MemoryAutoRetirement is a model used by Loom operations. type MemoryAutoRetirement struct { - Ts string `json:"ts"` - Reason string `json:"reason"` - MemoryID string `json:"memory_id"` - MemoryKey string `json:"memory_key"` - Agent *string `json:"agent,omitempty"` - UserID *string `json:"user_id,omitempty"` - SessionID *string `json:"session_id,omitempty"` - SupersededBy *string `json:"superseded_by,omitempty"` - SupersededByKey *string `json:"superseded_by_key,omitempty"` - Label *string `json:"label,omitempty"` - Unconfirmed *bool `json:"unconfirmed,omitempty"` - JudgeVerdict *string `json:"judge_verdict,omitempty"` - JudgeConfidence Optional[float64] `json:"judge_confidence,omitempty"` - JudgeModel *string `json:"judge_model,omitempty"` - JudgePromptVersion *string `json:"judge_prompt_version,omitempty"` + Ts string `json:"ts"` + Reason string `json:"reason"` + MemoryID string `json:"memory_id"` + MemoryKey string `json:"memory_key"` + Agent *string `json:"agent,omitempty"` + UserID *string `json:"user_id,omitempty"` + SessionID *string `json:"session_id,omitempty"` + SupersededBy *string `json:"superseded_by,omitempty"` + SupersededByKey *string `json:"superseded_by_key,omitempty"` + Label *string `json:"label,omitempty"` + Unconfirmed *bool `json:"unconfirmed,omitempty"` + JudgeVerdict *string `json:"judge_verdict,omitempty"` + JudgeConfidence Optional[float64] `json:"judge_confidence,omitempty"` + JudgeModel *string `json:"judge_model,omitempty"` + JudgePromptVersion *string `json:"judge_prompt_version,omitempty"` + AppliedPolicy *string `json:"applied_policy,omitempty"` + WinnerCaptureOrigin *string `json:"winner_capture_origin,omitempty"` + RetiredCaptureOrigin *string `json:"retired_capture_origin,omitempty"` } // MemoryAutoRetirementsInput is the request to memory.auto_retirements. @@ -8889,26 +8944,27 @@ type MentorBriefInput struct { // MentorBriefOutput is the response from mentor.brief. type MentorBriefOutput struct { - IgnoredArgs *[]string `json:"ignored_args,omitempty"` - DidYouMean *map[string]string `json:"did_you_mean,omitempty"` - Mirrored *bool `json:"mirrored,omitempty"` - Org string `json:"org"` - Namespace string `json:"namespace"` - Agent string `json:"agent"` - WindowSeconds int64 `json:"window_seconds"` - ComputedAt string `json:"computed_at"` - Sessions int64 `json:"sessions"` - Usage *map[string]int64 `json:"usage,omitempty"` - Planes *[]MentorPlane `json:"planes,omitempty"` - Hints *[]MentorHint `json:"hints,omitempty"` - Adoption *[]MentorAdoption `json:"adoption,omitempty"` - UsageEvidence *[]UsageRung `json:"usage_evidence,omitempty"` - LedgerFrom Optional[string] `json:"ledger_from,omitempty"` - LedgerRetentionDays Optional[int64] `json:"ledger_retention_days,omitempty"` - Agents *[]string `json:"agents,omitempty"` - AgentDefaulted *bool `json:"agent_defaulted,omitempty"` - Skipped *[]string `json:"skipped,omitempty"` - Healthy *bool `json:"healthy,omitempty"` + IgnoredArgs *[]string `json:"ignored_args,omitempty"` + DidYouMean *map[string]string `json:"did_you_mean,omitempty"` + Mirrored *bool `json:"mirrored,omitempty"` + Org string `json:"org"` + Namespace string `json:"namespace"` + Agent string `json:"agent"` + WindowSeconds int64 `json:"window_seconds"` + ComputedAt string `json:"computed_at"` + Sessions int64 `json:"sessions"` + Usage *map[string]int64 `json:"usage,omitempty"` + Planes *[]MentorPlane `json:"planes,omitempty"` + ConflictBacklog *map[string]map[string]int64 `json:"conflict_backlog,omitempty"` + Hints *[]MentorHint `json:"hints,omitempty"` + Adoption *[]MentorAdoption `json:"adoption,omitempty"` + UsageEvidence *[]UsageRung `json:"usage_evidence,omitempty"` + LedgerFrom Optional[string] `json:"ledger_from,omitempty"` + LedgerRetentionDays Optional[int64] `json:"ledger_retention_days,omitempty"` + Agents *[]string `json:"agents,omitempty"` + AgentDefaulted *bool `json:"agent_defaulted,omitempty"` + Skipped *[]string `json:"skipped,omitempty"` + Healthy *bool `json:"healthy,omitempty"` } // MentorGuideInput is the request to mentor.guide. @@ -9210,6 +9266,8 @@ type NamespaceGetOutput struct { RerankEndpoint Optional[string] `json:"rerank_endpoint,omitempty"` ClassifyEndpoint Optional[string] `json:"classify_endpoint,omitempty"` DefaultConflictPolicy Optional[string] `json:"default_conflict_policy,omitempty"` + CapturedConflictPolicy *string `json:"captured_conflict_policy,omitempty"` + CapturedConflictConfidence *float64 `json:"captured_conflict_confidence,omitempty"` ProposalPolicy Optional[ProposalPolicy] `json:"proposal_policy,omitempty"` CodeChangePolicy Optional[string] `json:"code_change_policy,omitempty"` TagRegistry Optional[[]map[string]json.RawMessage] `json:"tag_registry,omitempty"` @@ -9471,6 +9529,8 @@ type NamespaceRegisterInput struct { ClassifyPromptTemplate Optional[string] `json:"classify_prompt_template,omitempty"` TagRegistry *[]NamespaceTypeConfig `json:"tag_registry,omitempty"` DefaultConflictPolicy Optional[string] `json:"default_conflict_policy,omitempty"` + CapturedConflictPolicy Optional[string] `json:"captured_conflict_policy,omitempty"` + CapturedConflictConfidence Optional[float64] `json:"captured_conflict_confidence,omitempty"` ProposalPolicy Optional[ProposalPolicy] `json:"proposal_policy,omitempty"` CodeChangePolicy Optional[string] `json:"code_change_policy,omitempty"` } diff --git a/sdk/python/loom/client.py b/sdk/python/loom/client.py index ce08b6daa61..73226e185ef 100644 --- a/sdk/python/loom/client.py +++ b/sdk/python/loom/client.py @@ -673,6 +673,15 @@ async def allowlist_remove( await self._agent.call("conflicts.allowlist_remove", body, **options), ) + async def bulk_accept( + self, body: _ops.ConflictsBulkAcceptBody | None = None, /, **options: Any + ) -> _ops.ConflictsBulkAcceptOutput: + """`conflicts.bulk_accept`.""" + return cast( + "_ops.ConflictsBulkAcceptOutput", + await self._agent.call("conflicts.bulk_accept", body, **options), + ) + async def list( self, body: _ops.ConflictsListBody | None = None, /, **options: Any ) -> _ops.ConflictsListOutput: diff --git a/sdk/python/loom/ops.py b/sdk/python/loom/ops.py index fc1862f0479..ab2cf40598f 100644 --- a/sdk/python/loom/ops.py +++ b/sdk/python/loom/ops.py @@ -109,6 +109,7 @@ class OpSpec: "collection.move", "conflicts.allowlist_list", "conflicts.allowlist_remove", + "conflicts.bulk_accept", "conflicts.list", "conflicts.propose_revision", "conflicts.resolve", @@ -491,6 +492,7 @@ class OpSpec: "collection.move", "conflicts.allowlist_list", "conflicts.allowlist_remove", + "conflicts.bulk_accept", "conflicts.list", "conflicts.propose_revision", "conflicts.resolve", @@ -1643,6 +1645,18 @@ class OpSpec: True, False, ), + "conflicts.bulk_accept": OpSpec( + "conflicts.bulk_accept", + "ConflictsBulkAcceptInput", + "ConflictsBulkAcceptBody", + "ConflictsBulkAcceptOutput", + True, + "admin", + "experimental", + 5000, + True, + False, + ), "conflicts.list": OpSpec( "conflicts.list", "ConflictsListInput", @@ -8562,6 +8576,41 @@ class ConflictsAllowlistRemoveOutput(TypedDict, total=False): removed: Required[bool] +class ConflictsBulkAcceptInput(TypedDict, total=False): + org: Required[str] + namespace: Required[str] + items: Required[list["ConflictsResolverAcceptItem"]] + + +class ConflictsResolverAcceptItem(TypedDict, total=False): + memory_id: Required[str] + peer_id: Required[str] + memory_sha256: Required[str] + peer_sha256: Required[str] + suggestion_hash: Required[str] + + +class ConflictsBulkAcceptBody(TypedDict, total=False): + org: NotRequired[str] + namespace: NotRequired[str] + items: Required[list["ConflictsResolverAcceptItem"]] + + +class ConflictsBulkAcceptOutput(TypedDict, total=False): + results: Required[list["ConflictBulkResult"]] + requested: Required[int] + resolved: Required[int] + stale: Required[int] + failed: Required[int] + + +class ConflictBulkResult(TypedDict, total=False): + memory_id: Required[str] + peer_id: Required[str] + status: Required[Literal["resolved", "stale", "failed"]] + reason: NotRequired[str] + + class ConflictsListInput(TypedDict, total=False): org: Required[str] namespace: Required[str] @@ -8589,6 +8638,7 @@ class ConflictsListOutput(TypedDict, total=False): next_before_version: NotRequired[Optional[int]] total: NotRequired[Optional[int]] proposals: NotRequired[Optional[int]] + backlog: NotRequired[Optional["ConflictBacklog"]] keys: NotRequired[Optional[list[str]]] @@ -8603,6 +8653,23 @@ class ConflictRow(TypedDict, total=False): conflict_with: Required[list[str]] content_sha256: NotRequired[str] sensitivity: NotRequired[str] + capture_origin: NotRequired[str] + + +class ConflictBacklog(TypedDict, total=False): + "Conflicted rows split by resolver state and conservative provenance." + + pending_judgement: NotRequired["ConflictSourceCounts"] + resolver_judged: NotRequired["ConflictSourceCounts"] + cosine_only: NotRequired["ConflictSourceCounts"] + + +class ConflictSourceCounts(TypedDict, total=False): + "Conflicted row counts for one resolver state, not pair counts." + + plugin_captured: NotRequired[int] + caller_written: NotRequired[int] + unknown: NotRequired[int] class ConflictsProposeRevisionInput(TypedDict, total=False): @@ -13252,6 +13319,9 @@ class MemoryAutoRetirement(TypedDict, total=False): judge_confidence: NotRequired[Optional[float]] judge_model: NotRequired[str] judge_prompt_version: NotRequired[str] + applied_policy: NotRequired[str] + winner_capture_origin: NotRequired[str] + retired_capture_origin: NotRequired[str] class MemoryBacklinksInput(TypedDict, total=False): @@ -17088,6 +17158,7 @@ class MentorBriefOutput(TypedDict, total=False): sessions: Required[int] usage: NotRequired[dict[str, int]] planes: NotRequired[list["MentorPlane"]] + conflict_backlog: NotRequired[dict[str, dict[str, int]]] hints: NotRequired[list["MentorHint"]] adoption: NotRequired[list["MentorAdoption"]] usage_evidence: NotRequired[list["UsageRung"]] @@ -17346,6 +17417,8 @@ class NamespaceGetOutput(TypedDict, total=False): rerank_endpoint: NotRequired[Optional[str]] classify_endpoint: NotRequired[Optional[str]] default_conflict_policy: NotRequired[Optional[str]] + captured_conflict_policy: NotRequired[str] + captured_conflict_confidence: NotRequired[float] proposal_policy: NotRequired[Optional["ProposalPolicy"]] code_change_policy: NotRequired[Optional[Literal["retire_removed", "flag", "revise"]]] tag_registry: NotRequired[Optional[list[dict[str, Any]]]] @@ -17704,6 +17777,8 @@ class NamespaceRegisterInput(TypedDict, total=False): default_conflict_policy: NotRequired[ Optional[Literal["auto_reinforce", "manual_review", "newest_wins", "append_only"]] ] + captured_conflict_policy: NotRequired[Optional[Literal["manual_review", "resolver_update"]]] + captured_conflict_confidence: NotRequired[Optional[float]] proposal_policy: NotRequired[Optional["ProposalPolicy"]] code_change_policy: NotRequired[Optional[Literal["retire_removed", "flag", "revise"]]] @@ -17779,6 +17854,8 @@ class NamespaceRegisterBody(TypedDict, total=False): default_conflict_policy: NotRequired[ Optional[Literal["auto_reinforce", "manual_review", "newest_wins", "append_only"]] ] + captured_conflict_policy: NotRequired[Optional[Literal["manual_review", "resolver_update"]]] + captured_conflict_confidence: NotRequired[Optional[float]] proposal_policy: NotRequired[Optional["ProposalPolicy"]] code_change_policy: NotRequired[Optional[Literal["retire_removed", "flag", "revise"]]] diff --git a/sdk/ruby/lib/clickhouse/loom/generated/ops.rb b/sdk/ruby/lib/clickhouse/loom/generated/ops.rb index d413c34c68b..1a77a3dafee 100644 --- a/sdk/ruby/lib/clickhouse/loom/generated/ops.rb +++ b/sdk/ruby/lib/clickhouse/loom/generated/ops.rb @@ -8,7 +8,7 @@ module Loom # Every served operation: its spec in OPS, and one method per op on the class # of its group (`client.memory.set(...)` is `memory.set`). module Generated - OP_COUNT = 379 + OP_COUNT = 380 # The declared spec of every served op, by name; the HTTP path is /v1/. OPS = { @@ -82,6 +82,7 @@ module Generated "collection.move" => OpSpec.new("collection.move", "collection", "move", true, false, "admin", "experimental", %w[org namespace parent].freeze, %w[org namespace].freeze), "conflicts.allowlist_list" => OpSpec.new("conflicts.allowlist_list", "conflicts", "allowlist_list", true, true, "viewer", "experimental", %w[org namespace limit].freeze, %w[org namespace].freeze), "conflicts.allowlist_remove" => OpSpec.new("conflicts.allowlist_remove", "conflicts", "allowlist_remove", true, false, "admin", "experimental", %w[org namespace memory_key_a memory_key_b removed_by reason].freeze, %w[org namespace memory_key_a memory_key_b].freeze), + "conflicts.bulk_accept" => OpSpec.new("conflicts.bulk_accept", "conflicts", "bulk_accept", true, false, "admin", "experimental", %w[org namespace items].freeze, %w[org namespace items].freeze), "conflicts.list" => OpSpec.new("conflicts.list", "conflicts", "list", true, true, "viewer", "stable", %w[org namespace limit before_version count_only fresh keys_only fields].freeze, %w[org namespace].freeze), "conflicts.propose_revision" => OpSpec.new("conflicts.propose_revision", "conflicts", "propose_revision", true, true, "viewer", "experimental", %w[org namespace memory_id peer_id].freeze, %w[org namespace memory_id].freeze), "conflicts.resolve" => OpSpec.new("conflicts.resolve", "conflicts", "resolve", true, false, "admin", "stable", %w[org namespace memory_id decision peer_id reason resolved_by].freeze, %w[org namespace memory_id decision].freeze), @@ -288,7 +289,7 @@ module Generated "namespace.list_mine" => OpSpec.new("namespace.list_mine", "namespace", "list_mine", true, true, "viewer", "stable", %w[org subject].freeze, %w[org].freeze), "namespace.list_ontology" => OpSpec.new("namespace.list_ontology", "namespace", "list_ontology", true, true, "viewer", "experimental", %w[org namespace kind status].freeze, %w[org namespace].freeze), "namespace.mark_seen" => OpSpec.new("namespace.mark_seen", "namespace", "mark_seen", true, false, "viewer", "experimental", %w[org namespace subject].freeze, %w[org namespace].freeze), - "namespace.register" => OpSpec.new("namespace.register", "namespace", "register", true, false, "viewer", "stable", %w[org namespace owner_email description kind tags traffic_class active conversation_logging_enabled capture_generation_io coverage_sweep consolidation_enabled daily_cost_cap_usd daily_user_cost_cap_usd budget_alert_inbox conflict_threshold retention_days warm_days visibility requires_approval join_policy retrieval_defaults rerank_endpoint rerank_prompt_template classify_endpoint classify_prompt_template tag_registry default_conflict_policy proposal_policy code_change_policy].freeze, %w[org namespace owner_email].freeze), + "namespace.register" => OpSpec.new("namespace.register", "namespace", "register", true, false, "viewer", "stable", %w[org namespace owner_email description kind tags traffic_class active conversation_logging_enabled capture_generation_io coverage_sweep consolidation_enabled daily_cost_cap_usd daily_user_cost_cap_usd budget_alert_inbox conflict_threshold retention_days warm_days visibility requires_approval join_policy retrieval_defaults rerank_endpoint rerank_prompt_template classify_endpoint classify_prompt_template tag_registry default_conflict_policy captured_conflict_policy captured_conflict_confidence proposal_policy code_change_policy].freeze, %w[org namespace owner_email].freeze), "namespace.register_category" => OpSpec.new("namespace.register_category", "namespace", "register_category", false, false, "writer", "experimental", %w[org namespace name description summary].freeze, %w[org namespace name].freeze), "namespace.register_ontology" => OpSpec.new("namespace.register_ontology", "namespace", "register_ontology", true, false, "admin", "stable", %w[org namespace kind name description status cardinality].freeze, %w[org namespace kind name].freeze), "namespace.restore" => OpSpec.new("namespace.restore", "namespace", "restore", true, false, "viewer", "experimental", %w[org target_namespace payload rebind_agent].freeze, %w[org target_namespace payload].freeze), @@ -847,6 +848,12 @@ def allowlist_remove(body = nil, request_options: nil, **fields) call_op("conflicts.allowlist_remove", body, fields, request_options) end + # `conflicts.bulk_accept` (admin, writes, Idempotency-Key, experimental). + # Required: org, namespace, items. + def bulk_accept(body = nil, request_options: nil, **fields) + call_op("conflicts.bulk_accept", body, fields, request_options) + end + # `conflicts.list` (viewer, read-only). # Required: org, namespace. def list(body = nil, request_options: nil, **fields) diff --git a/sdk/rust/src/blocking_operations.rs b/sdk/rust/src/blocking_operations.rs index 6b07db86efc..a0cef1176d8 100644 --- a/sdk/rust/src/blocking_operations.rs +++ b/sdk/rust/src/blocking_operations.rs @@ -2792,6 +2792,23 @@ impl crate::blocking::Client { ) -> Result, crate::CallFailure> { self.call("conflicts.resolve", &request, options) } + /// Call `conflicts.bulk_accept`. + pub fn conflicts_bulk_accept( + &self, + request: crate::ConflictsBulkAcceptInput, + ) -> Result { + self.conflicts_bulk_accept_with_options(request, crate::CallOptions::default()) + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `conflicts.bulk_accept` with per-request options and metadata. + pub fn conflicts_bulk_accept_with_options( + &self, + request: crate::ConflictsBulkAcceptInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("conflicts.bulk_accept", &request, options) + } /// Call `conflicts.allowlist_list`. pub fn conflicts_allowlist_list( &self, diff --git a/sdk/rust/src/operations.rs b/sdk/rust/src/operations.rs index 721893a77ab..3492908a55c 100644 --- a/sdk/rust/src/operations.rs +++ b/sdk/rust/src/operations.rs @@ -2991,6 +2991,24 @@ impl crate::Client { ) -> Result, crate::CallFailure> { self.call("conflicts.resolve", &request, options).await } + /// Call `conflicts.bulk_accept`. + pub async fn conflicts_bulk_accept( + &self, + request: crate::ConflictsBulkAcceptInput, + ) -> Result { + self.conflicts_bulk_accept_with_options(request, crate::CallOptions::default()) + .await + .map(|result| result.data) + .map_err(|failure| failure.error) + } + /// Call `conflicts.bulk_accept` with per-request options and metadata. + pub async fn conflicts_bulk_accept_with_options( + &self, + request: crate::ConflictsBulkAcceptInput, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + self.call("conflicts.bulk_accept", &request, options).await + } /// Call `conflicts.allowlist_list`. pub async fn conflicts_allowlist_list( &self, diff --git a/sdk/rust/src/wire_models.rs b/sdk/rust/src/wire_models.rs index 21aa809d1fb..51b65580b00 100644 --- a/sdk/rust/src/wire_models.rs +++ b/sdk/rust/src/wire_models.rs @@ -991,6 +991,13 @@ pub(crate) const OP_POLICIES: &[OperationPolicy] = &[ &[], ), ("conflicts.resolve", true, false, &["namespace", "org"], &[]), + ( + "conflicts.bulk_accept", + true, + false, + &["namespace", "org"], + &[], + ), ( "conflicts.allowlist_list", true, @@ -16967,6 +16974,106 @@ impl ConflictsAllowlistRemoveInput { } } +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum ConflictBulkResultStatus { + #[serde(rename = "resolved")] + Resolved, + #[serde(rename = "stale")] + Stale, + #[serde(rename = "failed")] + Failed, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct ConflictBulkResult { + pub memory_id: String, + pub peer_id: String, + pub status: ConflictBulkResultStatus, + #[serde(default = "default_876")] + pub reason: String, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct ConflictsBulkAcceptOutput { + pub results: Vec, + pub requested: Integer, + pub resolved: Integer, + pub stale: Integer, + pub failed: Integer, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct ConflictsResolverAcceptItem { + pub memory_id: String, + pub peer_id: String, + pub memory_sha256: String, + pub peer_sha256: String, + pub suggestion_hash: String, +} +impl ConflictsResolverAcceptItem { + pub fn new( + memory_id: impl Into, + peer_id: impl Into, + memory_sha256: impl Into, + peer_sha256: impl Into, + suggestion_hash: impl Into, + ) -> Self { + Self { + memory_id: memory_id.into(), + peer_id: peer_id.into(), + memory_sha256: memory_sha256.into(), + peer_sha256: peer_sha256.into(), + suggestion_hash: suggestion_hash.into(), + } + } +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct ConflictsBulkAcceptInput { + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub org: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub namespace: Option, + pub items: Vec, +} +impl ConflictsBulkAcceptInput { + pub fn new(items: Vec) -> Self { + Self { + org: None, + namespace: None, + items, + } + } + pub fn org(mut self, org: impl Into) -> Self { + self.org = Some(org.into()); + self + } + pub fn namespace(mut self, namespace: impl Into) -> Self { + self.namespace = Some(namespace.into()); + self + } + pub async fn send( + self, + client: &crate::Client, + options: crate::CallOptions, + ) -> Result, crate::CallFailure> { + client.call("conflicts.bulk_accept", &self, options).await + } +} + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ConflictRow { @@ -17030,19 +17137,49 @@ pub struct ConflictRow { deserialize_with = "present_value" )] pub sensitivity: Option, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_value" + )] + pub capture_origin: Option, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct ConflictSourceCounts { + #[serde(default = "default_880")] + pub plugin_captured: Integer, + #[serde(default = "default_881")] + pub caller_written: Integer, + #[serde(default = "default_882")] + pub unknown: Integer, +} + +#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[non_exhaustive] +pub struct ConflictBacklog { + #[serde(default = "default_883")] + pub pending_judgement: ConflictSourceCounts, + #[serde(default = "default_884")] + pub resolver_judged: ConflictSourceCounts, + #[serde(default = "default_885")] + pub cosine_only: ConflictSourceCounts, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ConflictsListOutput { pub rows: Vec, - #[serde(default = "default_876")] - pub next_before_version: Option, #[serde(default = "default_877")] - pub total: Option, + pub next_before_version: Option, #[serde(default = "default_878")] - pub proposals: Option, + pub total: Option, #[serde(default = "default_879")] + pub proposals: Option, + #[serde(default = "default_886")] + pub backlog: Option, + #[serde(default = "default_887")] pub keys: Option>, } @@ -17194,7 +17331,7 @@ pub struct ConflictRevisionSuggestion { pub target_local_id: Integer, pub peer_local_ids: Vec, pub rationale: String, - #[serde(default = "default_881")] + #[serde(default = "default_889")] pub apply_operation: String, } @@ -17202,11 +17339,11 @@ pub struct ConflictRevisionSuggestion { #[non_exhaustive] pub struct ConflictsProposeRevisionOutput { pub found: bool, - #[serde(default = "default_880")] + #[serde(default = "default_888")] pub memories: Vec, - #[serde(default = "default_882")] + #[serde(default = "default_890")] pub suggestions: Vec, - #[serde(default = "default_883")] + #[serde(default = "default_891")] pub note: String, } @@ -17286,9 +17423,9 @@ pub struct ConflictsResolveOutput { pub resolved: bool, pub decision: ConflictsResolveOutputDecision, pub affected_memory_ids: Vec, - #[serde(default = "default_884")] + #[serde(default = "default_892")] pub resolved_at: Option, - #[serde(default = "default_885")] + #[serde(default = "default_893")] pub total: Option, } @@ -17445,13 +17582,13 @@ pub enum ConnectionEntryKind { pub struct ConnectionEntry { pub kind: ConnectionEntryKind, pub connected: bool, - #[serde(default = "default_886")] + #[serde(default = "default_894")] pub connect_available: bool, - #[serde(default = "default_887")] + #[serde(default = "default_895")] pub stored: bool, - #[serde(default = "default_888")] + #[serde(default = "default_896")] pub account_email: Option, - #[serde(default = "default_889")] + #[serde(default = "default_897")] pub scopes: Vec, pub connect_url: String, } @@ -17626,23 +17763,23 @@ impl ConsolidationsListInput { pub struct ContextFetchOutput { pub found: bool, pub blob_key: String, - #[serde(default = "default_890")] + #[serde(default = "default_898")] pub content: String, - #[serde(default = "default_891")] + #[serde(default = "default_899")] pub content_type: String, - #[serde(default = "default_892")] + #[serde(default = "default_900")] pub summary: String, - #[serde(default = "default_893")] + #[serde(default = "default_901")] pub total_chars: Integer, - #[serde(default = "default_894")] + #[serde(default = "default_902")] pub total_lines: Integer, - #[serde(default = "default_895")] + #[serde(default = "default_903")] pub offset: Integer, - #[serde(default = "default_896")] + #[serde(default = "default_904")] pub next_offset: Integer, - #[serde(default = "default_897")] + #[serde(default = "default_905")] pub matched_lines: Integer, - #[serde(default = "default_898")] + #[serde(default = "default_906")] pub expires_at: Option, } @@ -17936,9 +18073,9 @@ pub enum ConversationAppendOutputReason { pub struct ConversationAppendOutput { pub msg_id: String, pub ts: String, - #[serde(default = "default_899")] + #[serde(default = "default_907")] pub stored: bool, - #[serde(default = "default_900")] + #[serde(default = "default_908")] pub reason: ConversationAppendOutputReason, } @@ -18087,13 +18224,13 @@ impl ConversationAppendInput { pub struct ConversationCompactOutput { pub compacted: bool, pub messages_summarized: Integer, - #[serde(default = "default_901")] + #[serde(default = "default_909")] pub summary_msg_id: String, - #[serde(default = "default_902")] + #[serde(default = "default_910")] pub tokens_in: Integer, - #[serde(default = "default_903")] + #[serde(default = "default_911")] pub tokens_out: Integer, - #[serde(default = "default_904")] + #[serde(default = "default_912")] pub reason: String, } @@ -18357,7 +18494,7 @@ pub enum ConversationEntryRole { #[non_exhaustive] pub struct ConversationEntry { pub msg_id: String, - #[serde(default = "default_913")] + #[serde(default = "default_921")] pub agent: String, pub role: ConversationEntryRole, pub content: String, @@ -18374,25 +18511,25 @@ pub struct ConversationEntry { pub struct ConversationGetOutput { pub found: bool, pub thread_id: String, - #[serde(default = "default_905")] + #[serde(default = "default_913")] pub title: String, - #[serde(default = "default_906")] + #[serde(default = "default_914")] pub metadata: std::collections::HashMap, - #[serde(default = "default_907")] + #[serde(default = "default_915")] pub run_id: String, - #[serde(default = "default_908")] + #[serde(default = "default_916")] pub user_id: String, - #[serde(default = "default_909")] + #[serde(default = "default_917")] pub agent: String, - #[serde(default = "default_910")] + #[serde(default = "default_918")] pub created_at: Option, - #[serde(default = "default_911")] + #[serde(default = "default_919")] pub updated_at: Option, - #[serde(default = "default_912")] + #[serde(default = "default_920")] pub msg_count: Integer, - #[serde(default = "default_914")] + #[serde(default = "default_922")] pub messages: Vec, - #[serde(default = "default_915")] + #[serde(default = "default_923")] pub next_cursor: Option, } @@ -18506,7 +18643,7 @@ impl ConversationGetInput { #[non_exhaustive] pub struct ConversationListOutput { pub rows: Vec, - #[serde(default = "default_916")] + #[serde(default = "default_924")] pub next_cursor: Option, } @@ -18652,7 +18789,7 @@ pub struct SavedMessageHit { #[non_exhaustive] pub struct ConversationListSavedMessagesOutput { pub rows: Vec, - #[serde(default = "default_917")] + #[serde(default = "default_925")] pub next_cursor: Option, } @@ -18792,7 +18929,7 @@ pub struct ConversationSaveMessageOutput { pub conversation_id: String, pub message_id: String, pub indexed: bool, - #[serde(default = "default_918")] + #[serde(default = "default_926")] pub reason: ConversationSaveMessageOutputReason, pub ts: String, } @@ -18965,7 +19102,7 @@ pub struct ConversationHit { pub role: ConversationHitRole, pub content_excerpt: String, pub ts: String, - #[serde(default = "default_919")] + #[serde(default = "default_927")] pub namespace: String, } @@ -18973,7 +19110,7 @@ pub struct ConversationHit { #[non_exhaustive] pub struct ConversationSearchOutput { pub hits: Vec, - #[serde(default = "default_920")] + #[serde(default = "default_928")] pub namespaces_skipped: Vec, } @@ -19506,7 +19643,7 @@ pub struct ConversationUnsaveMessageOutput { pub conversation_id: String, pub message_id: String, pub found: bool, - #[serde(default = "default_921")] + #[serde(default = "default_929")] pub removed: bool, pub ts: String, } @@ -19579,7 +19716,7 @@ impl ConversationUnsaveMessageInput { pub struct ConversationUpdateOutput { pub updated: bool, pub thread_id: String, - #[serde(default = "default_922")] + #[serde(default = "default_930")] pub updated_at: Option, } @@ -19684,17 +19821,17 @@ impl ConversationUpdateInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct CostAgentSummaryRow { - #[serde(default = "default_923")] + #[serde(default = "default_931")] pub namespace: Option, - #[serde(default = "default_924")] + #[serde(default = "default_932")] pub agent: Option, - #[serde(default = "default_925")] + #[serde(default = "default_933")] pub day: Option, - #[serde(default = "default_926")] + #[serde(default = "default_934")] pub model: Option, - #[serde(default = "default_927")] + #[serde(default = "default_935")] pub consumer: Option, - #[serde(default = "default_928")] + #[serde(default = "default_936")] pub session_id: Option, pub turns: Integer, pub sessions: Integer, @@ -19843,18 +19980,18 @@ pub enum BudgetStatusOutputCapSource { #[non_exhaustive] pub struct BudgetStatusOutput { pub namespace: String, - #[serde(default = "default_929")] + #[serde(default = "default_937")] pub user_id: Option, #[serde(deserialize_with = "required_nullable")] pub spent_24h_usd: Option, pub cap_usd: f64, pub cap_source: BudgetStatusOutputCapSource, pub over_cap: bool, - #[serde(default = "default_930")] + #[serde(default = "default_938")] pub namespace_over_cap: Option, - #[serde(default = "default_931")] + #[serde(default = "default_939")] pub pct_of_cap: Option, - #[serde(default = "default_932")] + #[serde(default = "default_940")] pub namespaces_with_spend: Integer, } @@ -19927,11 +20064,11 @@ impl BudgetStatusInput { pub struct CostRecordTurnsOutput { pub recorded: Integer, pub priced: Integer, - #[serde(default = "default_933")] + #[serde(default = "default_941")] pub unpriced_models: Vec, - #[serde(default = "default_934")] + #[serde(default = "default_942")] pub cost_usd: f64, - #[serde(default = "default_935")] + #[serde(default = "default_943")] pub turns_dated_ahead: Integer, } @@ -20102,25 +20239,25 @@ impl CostRecordTurnsInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct CostSummaryRow { - #[serde(default = "default_936")] + #[serde(default = "default_944")] pub namespace: Option, - #[serde(default = "default_937")] + #[serde(default = "default_945")] pub agent: Option, - #[serde(default = "default_938")] + #[serde(default = "default_946")] pub day: Option, - #[serde(default = "default_939")] + #[serde(default = "default_947")] pub operation: Option, - #[serde(default = "default_940")] + #[serde(default = "default_948")] pub memory_key: Option, - #[serde(default = "default_941")] + #[serde(default = "default_949")] pub user_id: Option, - #[serde(default = "default_942")] + #[serde(default = "default_950")] pub model: Option, - #[serde(default = "default_943")] + #[serde(default = "default_951")] pub traffic_class: Option, - #[serde(default = "default_944")] + #[serde(default = "default_952")] pub instance_label: Option, - #[serde(default = "default_945")] + #[serde(default = "default_953")] pub build_commit: Option, pub ops: Integer, pub errors: Integer, @@ -20130,9 +20267,9 @@ pub struct CostSummaryRow { pub latency_p50_ms: f64, pub latency_p95_ms: f64, pub latency_p99_ms: f64, - #[serde(default = "default_946")] + #[serde(default = "default_954")] pub cache_hits: Integer, - #[serde(default = "default_947")] + #[serde(default = "default_955")] pub cache_saved_usd: f64, } @@ -20143,9 +20280,9 @@ pub struct CostSummaryOutput { pub total_ops: Integer, pub total_errors: Integer, pub total_cost_usd: f64, - #[serde(default = "default_948")] + #[serde(default = "default_956")] pub cache_hits: Integer, - #[serde(default = "default_949")] + #[serde(default = "default_957")] pub cache_saved_usd: f64, } @@ -20332,31 +20469,31 @@ pub enum DecisionRowStage { #[non_exhaustive] pub struct DecisionRow { pub memory_key: String, - #[serde(default = "default_950")] + #[serde(default = "default_958")] pub category: String, - #[serde(default = "default_951")] + #[serde(default = "default_959")] pub scenario: String, - #[serde(default = "default_952")] + #[serde(default = "default_960")] pub reasoning: String, - #[serde(default = "default_953")] + #[serde(default = "default_961")] pub outcome: String, - #[serde(default = "default_954")] + #[serde(default = "default_962")] pub alternatives: Vec, - #[serde(default = "default_955")] + #[serde(default = "default_963")] pub confidence: Option, - #[serde(default = "default_956")] + #[serde(default = "default_964")] pub decision_maker: String, - #[serde(default = "default_957")] + #[serde(default = "default_965")] pub run_id: String, - #[serde(default = "default_958")] + #[serde(default = "default_966")] pub realized_outcome: String, - #[serde(default = "default_959")] + #[serde(default = "default_967")] pub success: Option, - #[serde(default = "default_960")] + #[serde(default = "default_968")] pub made_at: String, - #[serde(default = "default_961")] + #[serde(default = "default_969")] pub stage: DecisionRowStage, - #[serde(default = "default_962")] + #[serde(default = "default_970")] pub similarity: f64, } @@ -20368,7 +20505,7 @@ pub struct ChainNodeRow { pub relation: String, pub direction: String, pub via: String, - #[serde(default = "default_964")] + #[serde(default = "default_972")] pub decision: Option, } @@ -20376,7 +20513,7 @@ pub struct ChainNodeRow { #[non_exhaustive] pub struct DecisionChainOutput { pub seed: String, - #[serde(default = "default_963")] + #[serde(default = "default_971")] pub seed_decision: Option, pub nodes: Vec, } @@ -20461,7 +20598,7 @@ impl DecisionChainInput { pub struct DecisionOutcomeOutput { pub memory_key: String, pub updated: bool, - #[serde(default = "default_965")] + #[serde(default = "default_973")] pub memories_credited: Integer, } @@ -20539,7 +20676,7 @@ impl DecisionOutcomeInput { #[non_exhaustive] pub struct DecisionPrecedentsOutput { pub precedents: Vec, - #[serde(default = "default_966")] + #[serde(default = "default_974")] pub embedding_model: String, } @@ -20634,11 +20771,11 @@ impl DecisionPrecedentsInput { pub struct DecisionRecordOutput { pub memory_key: String, pub record_id: String, - #[serde(default = "default_967")] + #[serde(default = "default_975")] pub superseded_prior: bool, - #[serde(default = "default_968")] + #[serde(default = "default_976")] pub edges_written: Integer, - #[serde(default = "default_969")] + #[serde(default = "default_977")] pub next: String, } @@ -20914,7 +21051,7 @@ pub enum ErasureExportOutputScopeType { pub struct ErasureExportSection { pub rows: Vec>, pub count: Integer, - #[serde(default = "default_970")] + #[serde(default = "default_978")] pub truncated: bool, } @@ -21027,17 +21164,17 @@ pub struct ErasureListRow { pub requester: String, pub status: ErasureListRowStatus, pub requested_at: String, - #[serde(default = "default_971")] + #[serde(default = "default_979")] pub completed_at: Option, - #[serde(default = "default_972")] + #[serde(default = "default_980")] pub failure_reason: String, - #[serde(default = "default_973")] + #[serde(default = "default_981")] pub steps_completed_count: Integer, - #[serde(default = "default_974")] + #[serde(default = "default_982")] pub reversals_count: Integer, - #[serde(default = "default_975")] + #[serde(default = "default_983")] pub residue_count: Integer, - #[serde(default = "default_976")] + #[serde(default = "default_984")] pub verified_at: Option, } @@ -21134,7 +21271,7 @@ pub enum ErasureRequestOutputStatus { pub struct ErasureStepResult { pub step: String, pub rows_affected: Integer, - #[serde(default = "default_977")] + #[serde(default = "default_985")] pub notes: String, } @@ -21145,21 +21282,21 @@ pub struct ErasureRequestOutput { pub status: ErasureRequestOutputStatus, pub steps: Vec, pub requested_at: String, - #[serde(default = "default_978")] + #[serde(default = "default_986")] pub completed_at: Option, - #[serde(default = "default_979")] + #[serde(default = "default_987")] pub residue_count: Integer, - #[serde(default = "default_980")] + #[serde(default = "default_988")] pub residue: std::collections::HashMap, - #[serde(default = "default_981")] + #[serde(default = "default_989")] pub verified_at: Option, - #[serde(default = "default_982")] + #[serde(default = "default_990")] pub census: Option>, - #[serde(default = "default_983")] + #[serde(default = "default_991")] pub purge: bool, - #[serde(default = "default_984")] + #[serde(default = "default_992")] pub failure_reason: String, - #[serde(default = "default_985")] + #[serde(default = "default_993")] pub steps_completed: Vec, } @@ -21271,33 +21408,33 @@ pub enum ErasureStatusOutputStatus { pub struct ErasureStatusOutput { pub found: bool, pub erasure_id: String, - #[serde(default = "default_986")] + #[serde(default = "default_994")] pub org: Option, - #[serde(default = "default_987")] + #[serde(default = "default_995")] pub scope_type: Option, - #[serde(default = "default_988")] + #[serde(default = "default_996")] pub scope_value: Option, - #[serde(default = "default_989")] + #[serde(default = "default_997")] pub requester: Option, - #[serde(default = "default_990")] + #[serde(default = "default_998")] pub status: Option, - #[serde(default = "default_991")] + #[serde(default = "default_999")] pub current_step: Option, - #[serde(default = "default_992")] + #[serde(default = "default_1000")] pub requested_at: Option, - #[serde(default = "default_993")] + #[serde(default = "default_1001")] pub completed_at: Option, - #[serde(default = "default_994")] + #[serde(default = "default_1002")] pub failure_reason: Option, - #[serde(default = "default_995")] + #[serde(default = "default_1003")] pub residue_count: Integer, - #[serde(default = "default_996")] + #[serde(default = "default_1004")] pub residue: std::collections::HashMap, - #[serde(default = "default_997")] + #[serde(default = "default_1005")] pub verified_at: Option, - #[serde(default = "default_998")] + #[serde(default = "default_1006")] pub census: Option>, - #[serde(default = "default_999")] + #[serde(default = "default_1007")] pub purge: bool, } @@ -21334,9 +21471,9 @@ pub enum ExtractionPolicyOutputScope { #[non_exhaustive] pub struct NamespacePolicy { pub namespace: String, - #[serde(default = "default_1005")] + #[serde(default = "default_1013")] pub updated_by: String, - #[serde(default = "default_1006")] + #[serde(default = "default_1014")] pub updated_at: Option, } @@ -21345,17 +21482,17 @@ pub struct NamespacePolicy { pub struct ExtractionPolicyOutput { pub org: String, pub scope: ExtractionPolicyOutputScope, - #[serde(default = "default_1000")] + #[serde(default = "default_1008")] pub namespace: String, - #[serde(default = "default_1001")] + #[serde(default = "default_1009")] pub policy: String, - #[serde(default = "default_1002")] + #[serde(default = "default_1010")] pub updated_by: String, - #[serde(default = "default_1003")] + #[serde(default = "default_1011")] pub updated_at: Option, - #[serde(default = "default_1004")] + #[serde(default = "default_1012")] pub effective: String, - #[serde(default = "default_1007")] + #[serde(default = "default_1015")] pub namespace_policies: Vec, } @@ -21589,13 +21726,13 @@ pub struct FactRow { pub object: String, pub co_occur: Integer, pub last_seen: String, - #[serde(default = "default_1008")] + #[serde(default = "default_1016")] pub provenance: String, - #[serde(default = "default_1009")] + #[serde(default = "default_1017")] pub source_keys: Vec, - #[serde(default = "default_1010")] + #[serde(default = "default_1018")] pub sources: Vec, - #[serde(default = "default_1011")] + #[serde(default = "default_1019")] pub stale: bool, } @@ -21603,7 +21740,7 @@ pub struct FactRow { #[non_exhaustive] pub struct FactsListOutput { pub rows: Vec, - #[serde(default = "default_1012")] + #[serde(default = "default_1020")] pub truncated: bool, } @@ -21822,14 +21959,14 @@ impl FactsListInput { pub struct PathEdge { pub entity_a: String, pub entity_b: String, - #[serde(default = "default_1013")] + #[serde(default = "default_1021")] pub relation: String, - #[serde(default = "default_1014")] + #[serde(default = "default_1022")] pub direction: String, pub co_occur: Integer, - #[serde(default = "default_1015")] + #[serde(default = "default_1023")] pub valid_from: Option, - #[serde(default = "default_1016")] + #[serde(default = "default_1024")] pub valid_to: Option, } @@ -22060,23 +22197,23 @@ pub struct TraversalNode { pub hop: Integer, pub cumulative_weight: f64, pub via_co_occur: Integer, - #[serde(default = "default_1018")] + #[serde(default = "default_1026")] pub hub: bool, - #[serde(default = "default_1019")] + #[serde(default = "default_1027")] pub degree: Integer, - #[serde(default = "default_1020")] + #[serde(default = "default_1028")] pub via_relation: String, - #[serde(default = "default_1021")] + #[serde(default = "default_1029")] pub via_direction: String, - #[serde(default = "default_1022")] + #[serde(default = "default_1030")] pub via_provenance: String, - #[serde(default = "default_1023")] + #[serde(default = "default_1031")] pub valid_from: String, - #[serde(default = "default_1024")] + #[serde(default = "default_1032")] pub valid_to: String, - #[serde(default = "default_1025")] + #[serde(default = "default_1033")] pub community_id: Option, - #[serde(default = "default_1026")] + #[serde(default = "default_1034")] pub path: Vec, } @@ -22084,12 +22221,12 @@ pub struct TraversalNode { #[non_exhaustive] pub struct FactsTraverseOutput { pub seed: String, - #[serde(default = "default_1017")] + #[serde(default = "default_1025")] pub seed_community_id: Option, pub nodes: Vec, - #[serde(default = "default_1027")] + #[serde(default = "default_1035")] pub truncated: bool, - #[serde(default = "default_1028")] + #[serde(default = "default_1036")] pub hubs: Vec, } @@ -22298,7 +22435,7 @@ pub struct GrantsApproveOutput { pub subject: String, pub namespace: String, pub decision: GrantsApproveOutputDecision, - #[serde(default = "default_1029")] + #[serde(default = "default_1037")] pub role: Option, pub decided_at: String, } @@ -22577,9 +22714,9 @@ pub struct GrantEntry { #[non_exhaustive] pub struct GrantsListOutput { pub rows: Vec, - #[serde(default = "default_1030")] + #[serde(default = "default_1038")] pub next_cursor: Option, - #[serde(default = "default_1031")] + #[serde(default = "default_1039")] pub truncated: bool, } @@ -22695,12 +22832,12 @@ pub enum PendingForMeEntryRequestedRole { #[non_exhaustive] pub struct PendingForMeEntry { pub namespace: String, - #[serde(default = "default_1032")] + #[serde(default = "default_1040")] pub kind: String, pub subject: String, pub current_role: PendingForMeEntryCurrentRole, pub requested_role: PendingForMeEntryRequestedRole, - #[serde(default = "default_1033")] + #[serde(default = "default_1041")] pub pending_since: Option, } @@ -22759,7 +22896,7 @@ impl GrantsPendingForMeInput { #[non_exhaustive] pub struct GrantsRevokeOutput { pub revoked: bool, - #[serde(default = "default_1034")] + #[serde(default = "default_1042")] pub revoked_at: Option, } @@ -22889,7 +23026,7 @@ impl GrantsShareAgentInput { #[non_exhaustive] pub struct GrantsUnshareAgentOutput { pub revoked: bool, - #[serde(default = "default_1035")] + #[serde(default = "default_1043")] pub revoked_at: Option, } @@ -22949,7 +23086,7 @@ pub enum HelpGetOutputAudience { pub struct HelpOutlineEntry { pub section: String, pub anchor: String, - #[serde(default = "default_1043")] + #[serde(default = "default_1051")] pub heading: String, } @@ -22959,21 +23096,21 @@ pub struct HelpGetOutput { pub available: bool, pub found: bool, pub path: String, - #[serde(default = "default_1036")] + #[serde(default = "default_1044")] pub title: String, - #[serde(default = "default_1037")] + #[serde(default = "default_1045")] pub section: String, - #[serde(default = "default_1038")] + #[serde(default = "default_1046")] pub anchor: String, - #[serde(default = "default_1039")] + #[serde(default = "default_1047")] pub audience: HelpGetOutputAudience, - #[serde(default = "default_1040")] + #[serde(default = "default_1048")] pub text: String, - #[serde(default = "default_1041")] + #[serde(default = "default_1049")] pub truncated: bool, - #[serde(default = "default_1042")] + #[serde(default = "default_1050")] pub next_offset: Integer, - #[serde(default = "default_1044")] + #[serde(default = "default_1052")] pub sections: Vec, } @@ -23118,21 +23255,21 @@ pub struct InboxPayload { pub inbox: String, pub owner_agent: String, pub owner_namespace: String, - #[serde(default = "default_1045")] + #[serde(default = "default_1053")] pub description: String, - #[serde(default = "default_1046")] + #[serde(default = "default_1054")] pub posters: Vec, - #[serde(default = "default_1047")] + #[serde(default = "default_1055")] pub accept_disclosure: Vec, pub default_lease_seconds: Integer, pub max_attempts: Integer, pub max_defers: Integer, pub triage_escalate_after_seconds: Integer, - #[serde(default = "default_1048")] + #[serde(default = "default_1056")] pub webhook_url: String, - #[serde(default = "default_1049")] + #[serde(default = "default_1057")] pub created_by: String, - #[serde(default = "default_1050")] + #[serde(default = "default_1058")] pub owner_subject: String, pub created_at: String, pub updated_at: String, @@ -23242,9 +23379,9 @@ pub struct PolicyPayload { pub poster: String, pub kind: String, pub mode: PolicyPayloadMode, - #[serde(default = "default_1051")] + #[serde(default = "default_1059")] pub require_evidence: Vec, - #[serde(default = "default_1052")] + #[serde(default = "default_1060")] pub set_by: String, pub set_at: String, pub version: Integer, @@ -23314,7 +23451,7 @@ impl InboxPolicyListInput { pub struct InboxPolicySetOutput { #[serde(deserialize_with = "required_nullable")] pub policy: Option, - #[serde(default = "default_1053")] + #[serde(default = "default_1061")] pub removed: bool, } @@ -23443,15 +23580,15 @@ pub struct Principal { pub subject: String, pub label: String, pub kind: PrincipalKind, - #[serde(default = "default_1054")] + #[serde(default = "default_1062")] pub namespaces: Vec, - #[serde(default = "default_1055")] + #[serde(default = "default_1063")] pub roles: Vec, - #[serde(default = "default_1056")] + #[serde(default = "default_1064")] pub last_seen: Option, - #[serde(default = "default_1057")] + #[serde(default = "default_1065")] pub can_already_post: bool, - #[serde(default = "default_1058")] + #[serde(default = "default_1066")] pub listed: bool, } @@ -23813,15 +23950,15 @@ pub struct AnalysisColumn { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct InsightsQueryOutput { - #[serde(default = "default_1059")] + #[serde(default = "default_1067")] pub columns: Vec, - #[serde(default = "default_1060")] + #[serde(default = "default_1068")] pub rows: Vec>, - #[serde(default = "default_1061")] + #[serde(default = "default_1069")] pub row_count: Integer, - #[serde(default = "default_1062")] + #[serde(default = "default_1070")] pub truncated: bool, - #[serde(default = "default_1063")] + #[serde(default = "default_1071")] pub sql_digest: String, } @@ -24120,32 +24257,32 @@ pub struct DatasetOut { pub dataset_id: String, pub source_uri: String, pub name: String, - #[serde(default = "default_1064")] + #[serde(default = "default_1072")] pub sheet: String, - #[serde(default = "default_1065")] + #[serde(default = "default_1073")] pub row_start: Integer, - #[serde(default = "default_1066")] + #[serde(default = "default_1074")] pub row_end: Integer, pub revision: Integer, pub snapshot_id: String, pub schema_state: String, pub columns: Vec, - #[serde(default = "default_1067")] + #[serde(default = "default_1075")] pub clarifications: Vec, pub row_count: Integer, - #[serde(default = "default_1068")] + #[serde(default = "default_1076")] pub rejected_rows: Integer, - #[serde(default = "default_1069")] + #[serde(default = "default_1077")] pub rejected: Vec, - #[serde(default = "default_1070")] + #[serde(default = "default_1078")] pub complete: bool, - #[serde(default = "default_1071")] + #[serde(default = "default_1079")] pub approved_by: String, - #[serde(default = "default_1072")] + #[serde(default = "default_1080")] pub approved_at: Option, - #[serde(default = "default_1073")] + #[serde(default = "default_1081")] pub created_at: Option, - #[serde(default = "default_1074")] + #[serde(default = "default_1082")] pub rows: Vec>, } @@ -24153,9 +24290,9 @@ pub struct DatasetOut { #[non_exhaustive] pub struct KnowledgeDatasetApproveOutput { pub found: bool, - #[serde(default = "default_1075")] + #[serde(default = "default_1083")] pub dataset: Option, - #[serde(default = "default_1076")] + #[serde(default = "default_1084")] pub retyped: bool, } @@ -24249,9 +24386,9 @@ impl KnowledgeDatasetApproveInput { #[non_exhaustive] pub struct KnowledgeDatasetGetOutput { pub found: bool, - #[serde(default = "default_1077")] + #[serde(default = "default_1085")] pub revision: Integer, - #[serde(default = "default_1078")] + #[serde(default = "default_1086")] pub datasets: Vec, } @@ -24324,7 +24461,7 @@ impl KnowledgeDatasetGetInput { pub struct KnowledgeDocCluster { pub content_sha256: String, pub doc_count: Integer, - #[serde(default = "default_1079")] + #[serde(default = "default_1087")] pub docs: Vec>, } @@ -24334,16 +24471,16 @@ pub struct KnowledgeChunkCluster { pub content_sha256: String, pub chunk_count: Integer, pub uri_count: Integer, - #[serde(default = "default_1081")] + #[serde(default = "default_1089")] pub samples: Vec>, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeDedupListOutput { - #[serde(default = "default_1080")] + #[serde(default = "default_1088")] pub doc_clusters: Vec, - #[serde(default = "default_1082")] + #[serde(default = "default_1090")] pub chunk_clusters: Vec, } @@ -24420,7 +24557,7 @@ pub struct KnowledgeDedupResolveOutput { pub canonical_uri: String, pub duplicate_uri: String, pub decision: String, - #[serde(default = "default_1083")] + #[serde(default = "default_1091")] pub superseded_uri: String, } @@ -24539,24 +24676,24 @@ impl KnowledgeDeleteInput { #[non_exhaustive] pub struct KnowledgeFormat { pub format: String, - #[serde(default = "default_1084")] + #[serde(default = "default_1092")] pub extensions: Vec, - #[serde(default = "default_1085")] + #[serde(default = "default_1093")] pub media_types: Vec, - #[serde(default = "default_1086")] + #[serde(default = "default_1094")] pub available: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeFormatsOutput { - #[serde(default = "default_1087")] + #[serde(default = "default_1095")] pub formats: Vec, - #[serde(default = "default_1088")] + #[serde(default = "default_1096")] pub max_upload_bytes: Integer, - #[serde(default = "default_1089")] + #[serde(default = "default_1097")] pub refused_extensions: Vec, - #[serde(default = "default_1090")] + #[serde(default = "default_1098")] pub default_format: String, } @@ -24658,7 +24795,7 @@ impl KnowledgeGapsDraftInput { pub struct KnowledgeGap { pub gap_id: String, pub head: String, - #[serde(default = "default_1091")] + #[serde(default = "default_1099")] pub samples: Vec, pub askers: Integer, pub asks: Integer, @@ -24668,13 +24805,13 @@ pub struct KnowledgeGap { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeGapsListOutput { - #[serde(default = "default_1092")] + #[serde(default = "default_1100")] pub gaps: Vec, - #[serde(default = "default_1093")] + #[serde(default = "default_1101")] pub built_at: Option, - #[serde(default = "default_1094")] + #[serde(default = "default_1102")] pub capturing: Option, - #[serde(default = "default_1095")] + #[serde(default = "default_1103")] pub enabled: bool, } @@ -24740,7 +24877,7 @@ pub struct KnowledgeIngestOutput { pub ingestion_id: String, pub state: String, pub source_uri: String, - #[serde(default = "default_1096")] + #[serde(default = "default_1104")] pub namespace: String, } @@ -24959,9 +25096,9 @@ impl KnowledgeIngestInput { #[non_exhaustive] pub struct KnowledgeIngestCancelOutput { pub found: bool, - #[serde(default = "default_1097")] + #[serde(default = "default_1105")] pub state: String, - #[serde(default = "default_1098")] + #[serde(default = "default_1106")] pub cancelled: bool, } @@ -25012,39 +25149,39 @@ impl KnowledgeIngestCancelInput { pub struct KnowledgeIngestStatusOutput { pub found: bool, pub ingestion_id: String, - #[serde(default = "default_1099")] + #[serde(default = "default_1107")] pub source_uri: String, - #[serde(default = "default_1100")] + #[serde(default = "default_1108")] pub state: String, - #[serde(default = "default_1101")] + #[serde(default = "default_1109")] pub stage: String, - #[serde(default = "default_1102")] + #[serde(default = "default_1110")] pub attempts: Integer, - #[serde(default = "default_1103")] + #[serde(default = "default_1111")] pub error_code: String, - #[serde(default = "default_1104")] + #[serde(default = "default_1112")] pub error_message: String, - #[serde(default = "default_1105")] + #[serde(default = "default_1113")] pub format: String, - #[serde(default = "default_1106")] + #[serde(default = "default_1114")] pub coverage: Option>, - #[serde(default = "default_1107")] + #[serde(default = "default_1115")] pub warnings: Vec, - #[serde(default = "default_1108")] + #[serde(default = "default_1116")] pub chunks: Integer, - #[serde(default = "default_1109")] + #[serde(default = "default_1117")] pub revision: Integer, - #[serde(default = "default_1110")] + #[serde(default = "default_1118")] pub expected_revision: Option, - #[serde(default = "default_1111")] + #[serde(default = "default_1119")] pub filename: String, - #[serde(default = "default_1112")] + #[serde(default = "default_1120")] pub retrieval: String, - #[serde(default = "default_1113")] + #[serde(default = "default_1121")] pub cancel_requested: bool, - #[serde(default = "default_1114")] + #[serde(default = "default_1122")] pub created_at: Option, - #[serde(default = "default_1115")] + #[serde(default = "default_1123")] pub updated_at: Option, } @@ -25101,21 +25238,21 @@ pub struct DocumentCount { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct DocumentTotals { - #[serde(default = "default_1116")] + #[serde(default = "default_1124")] pub live: Option, - #[serde(default = "default_1117")] + #[serde(default = "default_1125")] pub deleted: Option, - #[serde(default = "default_1118")] + #[serde(default = "default_1126")] pub newest_ingested_at: Option, - #[serde(default = "default_1119")] + #[serde(default = "default_1127")] pub by_format: Vec, - #[serde(default = "default_1120")] + #[serde(default = "default_1128")] pub by_source_scheme: Vec, - #[serde(default = "default_1121")] + #[serde(default = "default_1129")] pub earlier_revisions: Option, - #[serde(default = "default_1122")] + #[serde(default = "default_1130")] pub unnumbered: Option, - #[serde(default = "default_1123")] + #[serde(default = "default_1131")] pub retired_versions: Option, } @@ -25130,15 +25267,15 @@ pub struct ChunkModelCount { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ChunkTotals { - #[serde(default = "default_1124")] + #[serde(default = "default_1132")] pub embedder_model: String, - #[serde(default = "default_1125")] + #[serde(default = "default_1133")] pub live: Option, - #[serde(default = "default_1126")] + #[serde(default = "default_1134")] pub searchable: Option, - #[serde(default = "default_1127")] + #[serde(default = "default_1135")] pub unembedded: Option, - #[serde(default = "default_1128")] + #[serde(default = "default_1136")] pub by_model: Vec, } @@ -25163,9 +25300,9 @@ pub struct DocumentDecisions { #[non_exhaustive] pub struct DecisionTotals { pub definition: String, - #[serde(default = "default_1129")] + #[serde(default = "default_1137")] pub refs: Vec, - #[serde(default = "default_1130")] + #[serde(default = "default_1138")] pub all_documents: Option, } @@ -25180,7 +25317,7 @@ pub struct DocumentChunks { pub min_chars: Integer, pub median_chars: Integer, pub max_chars: Integer, - #[serde(default = "default_1133")] + #[serde(default = "default_1141")] pub models: Vec, } @@ -25230,11 +25367,11 @@ pub struct IngestJob { pub failure_class: IngestJobFailureClass, pub queued_at: String, pub updated_at: String, - #[serde(default = "default_1138")] + #[serde(default = "default_1146")] pub ended_at: Option, - #[serde(default = "default_1139")] + #[serde(default = "default_1147")] pub next_attempt_at: Option, - #[serde(default = "default_1140")] + #[serde(default = "default_1148")] pub stalled: bool, } @@ -25244,11 +25381,11 @@ pub struct SourceJobs { pub source_uri: String, pub jobs: Integer, pub open_jobs: Integer, - #[serde(default = "default_1137")] + #[serde(default = "default_1145")] pub open_ingestion_id: String, pub latest: IngestJob, pub current: IngestJob, - #[serde(default = "default_1141")] + #[serde(default = "default_1149")] pub replaced: bool, } @@ -25261,18 +25398,18 @@ pub struct InspectDocument { pub source_scheme: String, pub version: Integer, pub revision: Integer, - #[serde(default = "default_1131")] + #[serde(default = "default_1139")] pub ingestion_id: String, pub ingested_at: String, - #[serde(default = "default_1132")] + #[serde(default = "default_1140")] pub retired_versions: Option, - #[serde(default = "default_1134")] + #[serde(default = "default_1142")] pub chunks: Option, - #[serde(default = "default_1135")] + #[serde(default = "default_1143")] pub decisions: Option, - #[serde(default = "default_1136")] + #[serde(default = "default_1144")] pub extraction: Option, - #[serde(default = "default_1142")] + #[serde(default = "default_1150")] pub jobs: Option, } @@ -25317,40 +25454,40 @@ pub struct DocumentFinding { pub kind: DocumentFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_1145")] + #[serde(default = "default_1153")] pub window_seconds: Option, - #[serde(default = "default_1146")] + #[serde(default = "default_1154")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_1147")] + #[serde(default = "default_1155")] pub evidence: Vec, - #[serde(default = "default_1148")] + #[serde(default = "default_1156")] pub exceptions: String, - #[serde(default = "default_1149")] + #[serde(default = "default_1157")] pub uncertainty: String, pub code: String, pub severity: DocumentFindingSeverity, pub count: Integer, pub share: f64, - #[serde(default = "default_1150")] + #[serde(default = "default_1158")] pub samples: Vec, - #[serde(default = "default_1151")] + #[serde(default = "default_1159")] pub ingested: Integer, - #[serde(default = "default_1152")] + #[serde(default = "default_1160")] pub ingested_samples: Vec, pub detail: String, pub remedy: String, - #[serde(default = "default_1153")] + #[serde(default = "default_1161")] pub refs: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ReportCoverage { - #[serde(default = "default_1155")] + #[serde(default = "default_1163")] pub rules_run: Vec, - #[serde(default = "default_1156")] + #[serde(default = "default_1164")] pub rules_skipped: Vec, pub complete: bool, } @@ -25358,43 +25495,43 @@ pub struct ReportCoverage { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct IngestionTotals { - #[serde(default = "default_1157")] + #[serde(default = "default_1165")] pub sources: Option, - #[serde(default = "default_1158")] + #[serde(default = "default_1166")] pub without_document: Option, - #[serde(default = "default_1159")] + #[serde(default = "default_1167")] pub replaced: Option, - #[serde(default = "default_1160")] + #[serde(default = "default_1168")] pub pending: Option, - #[serde(default = "default_1161")] + #[serde(default = "default_1169")] pub processing: Option, - #[serde(default = "default_1162")] + #[serde(default = "default_1170")] pub stalled: Option, - #[serde(default = "default_1163")] + #[serde(default = "default_1171")] pub ready: Option, - #[serde(default = "default_1164")] + #[serde(default = "default_1172")] pub partial: Option, - #[serde(default = "default_1165")] + #[serde(default = "default_1173")] pub failed: Option, - #[serde(default = "default_1166")] + #[serde(default = "default_1174")] pub cancelled: Option, - #[serde(default = "default_1167")] + #[serde(default = "default_1175")] pub oldest_open_queued_at: Option, pub worker_enabled: bool, - #[serde(default = "default_1168")] + #[serde(default = "default_1176")] pub extractor_configured: Option, - #[serde(default = "default_1169")] + #[serde(default = "default_1177")] pub without_document_listed: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ExtractionTotals { - #[serde(default = "default_1170")] + #[serde(default = "default_1178")] pub documents: Option, - #[serde(default = "default_1171")] + #[serde(default = "default_1179")] pub incomplete: Option, - #[serde(default = "default_1172")] + #[serde(default = "default_1180")] pub lost: Vec, } @@ -25424,31 +25561,31 @@ pub struct IngestFinding { pub kind: IngestFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_1173")] + #[serde(default = "default_1181")] pub window_seconds: Option, - #[serde(default = "default_1174")] + #[serde(default = "default_1182")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_1175")] + #[serde(default = "default_1183")] pub evidence: Vec, - #[serde(default = "default_1176")] + #[serde(default = "default_1184")] pub exceptions: String, - #[serde(default = "default_1177")] + #[serde(default = "default_1185")] pub uncertainty: String, pub code: String, pub severity: IngestFindingSeverity, pub count: Integer, pub share: f64, - #[serde(default = "default_1178")] + #[serde(default = "default_1186")] pub samples: Vec, - #[serde(default = "default_1179")] + #[serde(default = "default_1187")] pub ingestion_ids: Vec, - #[serde(default = "default_1180")] + #[serde(default = "default_1188")] pub without_document: Integer, pub detail: String, pub remedy: String, - #[serde(default = "default_1181")] + #[serde(default = "default_1189")] pub refs: Vec, } @@ -25475,20 +25612,20 @@ pub struct KnowledgeInspectOutput { pub documents: DocumentTotals, pub chunks: ChunkTotals, pub decisions: DecisionTotals, - #[serde(default = "default_1143")] + #[serde(default = "default_1151")] pub listed: Vec, - #[serde(default = "default_1144")] + #[serde(default = "default_1152")] pub listed_complete: bool, - #[serde(default = "default_1154")] + #[serde(default = "default_1162")] pub findings: Vec, pub coverage: ReportCoverage, pub ingestions: IngestionTotals, pub extraction: ExtractionTotals, - #[serde(default = "default_1182")] + #[serde(default = "default_1190")] pub ingest_findings: Vec, - #[serde(default = "default_1183")] + #[serde(default = "default_1191")] pub memory_findings: Vec, - #[serde(default = "default_1184")] + #[serde(default = "default_1192")] pub skipped: Vec, } @@ -25635,7 +25772,7 @@ pub struct KnowledgeListEntry { #[non_exhaustive] pub struct KnowledgeListOutput { pub rows: Vec, - #[serde(default = "default_1185")] + #[serde(default = "default_1193")] pub next_cursor: Option, } @@ -25801,9 +25938,9 @@ pub enum KnowledgeMoveResultReason { #[non_exhaustive] pub struct KnowledgeMoveResult { pub source_uri: String, - #[serde(default = "default_1187")] + #[serde(default = "default_1195")] pub moved: bool, - #[serde(default = "default_1188")] + #[serde(default = "default_1196")] pub reason: KnowledgeMoveResultReason, } @@ -25811,9 +25948,9 @@ pub struct KnowledgeMoveResult { #[non_exhaustive] pub struct KnowledgeMoveOutput { pub found: bool, - #[serde(default = "default_1186")] + #[serde(default = "default_1194")] pub to_namespace: String, - #[serde(default = "default_1189")] + #[serde(default = "default_1197")] pub results: Vec, } @@ -25879,17 +26016,17 @@ pub struct OutlineEntry { pub struct KnowledgeOutlineOutput { pub found: bool, pub source_uri: String, - #[serde(default = "default_1190")] + #[serde(default = "default_1198")] pub title: String, - #[serde(default = "default_1191")] + #[serde(default = "default_1199")] pub structured: bool, - #[serde(default = "default_1192")] + #[serde(default = "default_1200")] pub chunk_count: Integer, - #[serde(default = "default_1193")] + #[serde(default = "default_1201")] pub sections: Vec, - #[serde(default = "default_1194")] + #[serde(default = "default_1202")] pub section_content: Option, - #[serde(default = "default_1195")] + #[serde(default = "default_1203")] pub section_chunk_idxs: Vec, } @@ -25996,12 +26133,12 @@ pub struct QueryReceipt { pub struct KnowledgeQueryOutput { pub columns: Vec, pub rows: Vec>, - #[serde(default = "default_1196")] + #[serde(default = "default_1204")] pub row_ids: Vec>, - #[serde(default = "default_1197")] + #[serde(default = "default_1205")] pub truncated: bool, pub complete: bool, - #[serde(default = "default_1198")] + #[serde(default = "default_1206")] pub incomplete: Vec, pub receipt: QueryReceipt, } @@ -26674,9 +26811,9 @@ pub struct QueryHistoryListOutputQueryHistorySource { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct QueryHistoryListOutput { - #[serde(default = "default_1199")] + #[serde(default = "default_1207")] pub enabled: bool, - #[serde(default = "default_1200")] + #[serde(default = "default_1208")] pub sources: Vec, } @@ -26807,7 +26944,7 @@ impl QueryHistoryRemoveInput { #[non_exhaustive] pub struct KnowledgeReadsOutput { pub window_days: Integer, - #[serde(default = "default_1201")] + #[serde(default = "default_1209")] pub reads: Vec>, } @@ -26910,15 +27047,15 @@ pub enum KnowledgeRestoreOutputOriginal { #[non_exhaustive] pub struct KnowledgeRestoreOutput { pub restored: bool, - #[serde(default = "default_1202")] + #[serde(default = "default_1210")] pub reason: KnowledgeRestoreOutputReason, - #[serde(default = "default_1203")] + #[serde(default = "default_1211")] pub doc_id: String, - #[serde(default = "default_1204")] + #[serde(default = "default_1212")] pub revision: Option, - #[serde(default = "default_1205")] + #[serde(default = "default_1213")] pub chunks_restored: Integer, - #[serde(default = "default_1206")] + #[serde(default = "default_1214")] pub original: KnowledgeRestoreOutputOriginal, } @@ -26991,35 +27128,35 @@ pub struct KnowledgeSourceCrawlProof { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceProbe { - #[serde(default = "default_1211")] + #[serde(default = "default_1219")] pub documents: Integer, - #[serde(default = "default_1212")] + #[serde(default = "default_1220")] pub more: bool, - #[serde(default = "default_1213")] + #[serde(default = "default_1221")] pub sample: Vec, - #[serde(default = "default_1214")] + #[serde(default = "default_1222")] pub checked: Integer, - #[serde(default = "default_1215")] + #[serde(default = "default_1223")] pub sampled: bool, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceAddOutput { - #[serde(default = "default_1207")] + #[serde(default = "default_1215")] pub crawl_proof: Option, pub name: String, pub kind: String, pub namespace: String, - #[serde(default = "default_1208")] + #[serde(default = "default_1216")] pub items: Vec>, - #[serde(default = "default_1209")] + #[serde(default = "default_1217")] pub include: Vec, - #[serde(default = "default_1210")] + #[serde(default = "default_1218")] pub config: std::collections::HashMap, - #[serde(default = "default_1216")] + #[serde(default = "default_1224")] pub probe: KnowledgeSourceProbe, - #[serde(default = "default_1217")] + #[serde(default = "default_1225")] pub dry_run: bool, } @@ -27236,21 +27373,21 @@ impl KnowledgeSourceAddInput { #[non_exhaustive] pub struct KnowledgeSourceCheckOutput { pub name: String, - #[serde(default = "default_1218")] + #[serde(default = "default_1226")] pub reachable: bool, - #[serde(default = "default_1219")] + #[serde(default = "default_1227")] pub documents: Integer, - #[serde(default = "default_1220")] + #[serde(default = "default_1228")] pub more: bool, - #[serde(default = "default_1221")] + #[serde(default = "default_1229")] pub sample: Vec, - #[serde(default = "default_1222")] + #[serde(default = "default_1230")] pub checked: Integer, - #[serde(default = "default_1223")] + #[serde(default = "default_1231")] pub sampled: bool, - #[serde(default = "default_1224")] + #[serde(default = "default_1232")] pub summary: String, - #[serde(default = "default_1225")] + #[serde(default = "default_1233")] pub checked_at: String, } @@ -27299,37 +27436,37 @@ impl KnowledgeSourceCheckInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceSync { - #[serde(default = "default_1236")] + #[serde(default = "default_1244")] pub requested_at: String, - #[serde(default = "default_1237")] + #[serde(default = "default_1245")] pub last_synced_at: String, - #[serde(default = "default_1238")] + #[serde(default = "default_1246")] pub status: String, - #[serde(default = "default_1239")] + #[serde(default = "default_1247")] pub documents_seen: Integer, - #[serde(default = "default_1240")] + #[serde(default = "default_1248")] pub changed: Integer, - #[serde(default = "default_1241")] + #[serde(default = "default_1249")] pub removed: Integer, - #[serde(default = "default_1242")] + #[serde(default = "default_1250")] pub unconverted: Integer, - #[serde(default = "default_1243")] + #[serde(default = "default_1251")] pub unconverted_reasons: std::collections::HashMap, - #[serde(default = "default_1244")] + #[serde(default = "default_1252")] pub skipped: Integer, - #[serde(default = "default_1245")] + #[serde(default = "default_1253")] pub error: String, - #[serde(default = "default_1246")] + #[serde(default = "default_1254")] pub pending_extract: Integer, - #[serde(default = "default_1247")] + #[serde(default = "default_1255")] pub last_extracted_at: String, - #[serde(default = "default_1248")] + #[serde(default = "default_1256")] pub extracted: Integer, - #[serde(default = "default_1249")] + #[serde(default = "default_1257")] pub flagged_pinned: Integer, - #[serde(default = "default_1250")] + #[serde(default = "default_1258")] pub unextracted: Integer, - #[serde(default = "default_1251")] + #[serde(default = "default_1259")] pub extract_error: String, } @@ -27337,11 +27474,11 @@ pub struct KnowledgeSourceSync { #[non_exhaustive] pub struct KnowledgeSourceDocument { pub source_uri: String, - #[serde(default = "default_1253")] + #[serde(default = "default_1261")] pub title: String, - #[serde(default = "default_1254")] + #[serde(default = "default_1262")] pub source_revision: String, - #[serde(default = "default_1255")] + #[serde(default = "default_1263")] pub ingested_at: String, } @@ -27350,29 +27487,29 @@ pub struct KnowledgeSourceDocument { pub struct KnowledgeSourceInspectOutput { pub name: String, pub kind: String, - #[serde(default = "default_1226")] + #[serde(default = "default_1234")] pub credential_mode: String, - #[serde(default = "default_1227")] + #[serde(default = "default_1235")] pub owned_by_caller: bool, - #[serde(default = "default_1228")] + #[serde(default = "default_1236")] pub access: String, - #[serde(default = "default_1229")] + #[serde(default = "default_1237")] pub crawl_options: std::collections::HashMap, - #[serde(default = "default_1230")] + #[serde(default = "default_1238")] pub owner_subject: String, - #[serde(default = "default_1231")] + #[serde(default = "default_1239")] pub items: Vec>, - #[serde(default = "default_1232")] + #[serde(default = "default_1240")] pub include: Vec, - #[serde(default = "default_1233")] + #[serde(default = "default_1241")] pub config: std::collections::HashMap, - #[serde(default = "default_1234")] + #[serde(default = "default_1242")] pub created_by: String, - #[serde(default = "default_1235")] + #[serde(default = "default_1243")] pub created_at: String, - #[serde(default = "default_1252")] + #[serde(default = "default_1260")] pub sync: KnowledgeSourceSync, - #[serde(default = "default_1256")] + #[serde(default = "default_1264")] pub documents: Vec, } @@ -27425,40 +27562,40 @@ impl KnowledgeSourceInspectInput { pub struct KnowledgeSourceEntry { pub name: String, pub kind: String, - #[serde(default = "default_1257")] + #[serde(default = "default_1265")] pub credential_mode: String, - #[serde(default = "default_1258")] + #[serde(default = "default_1266")] pub owned_by_caller: bool, - #[serde(default = "default_1259")] + #[serde(default = "default_1267")] pub access: String, - #[serde(default = "default_1260")] + #[serde(default = "default_1268")] pub crawl_options: std::collections::HashMap, - #[serde(default = "default_1261")] + #[serde(default = "default_1269")] pub owner_subject: String, - #[serde(default = "default_1262")] + #[serde(default = "default_1270")] pub items: Vec>, - #[serde(default = "default_1263")] + #[serde(default = "default_1271")] pub include: Vec, - #[serde(default = "default_1264")] + #[serde(default = "default_1272")] pub config: std::collections::HashMap, - #[serde(default = "default_1265")] + #[serde(default = "default_1273")] pub created_by: String, - #[serde(default = "default_1266")] + #[serde(default = "default_1274")] pub created_at: String, - #[serde(default = "default_1267")] + #[serde(default = "default_1275")] pub sync: KnowledgeSourceSync, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceListOutput { - #[serde(default = "default_1268")] + #[serde(default = "default_1276")] pub sources: Vec, - #[serde(default = "default_1269")] + #[serde(default = "default_1277")] pub enabled: bool, - #[serde(default = "default_1270")] + #[serde(default = "default_1278")] pub accepts_sources: bool, - #[serde(default = "default_1271")] + #[serde(default = "default_1279")] pub self_service: bool, } @@ -27511,18 +27648,18 @@ impl KnowledgeSourceListInput { #[non_exhaustive] pub struct KnowledgeSourceParsedLink { pub link: String, - #[serde(default = "default_1272")] + #[serde(default = "default_1280")] pub kind: String, - #[serde(default = "default_1273")] + #[serde(default = "default_1281")] pub item: std::collections::HashMap, - #[serde(default = "default_1274")] + #[serde(default = "default_1282")] pub unreadable: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceParseLinksOutput { - #[serde(default = "default_1275")] + #[serde(default = "default_1283")] pub links: Vec, } @@ -27573,25 +27710,25 @@ impl KnowledgeSourceParseLinksInput { #[derive(Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct PushStatusOutput { - #[serde(default = "default_1276")] + #[serde(default = "default_1284")] pub enabled: bool, - #[serde(default = "default_1277")] + #[serde(default = "default_1285")] pub status: String, - #[serde(default = "default_1278")] + #[serde(default = "default_1286")] pub provider: String, - #[serde(default = "default_1279")] + #[serde(default = "default_1287")] pub generation: String, - #[serde(default = "default_1280")] + #[serde(default = "default_1288")] pub callback_url: String, - #[serde(default = "default_1281")] + #[serde(default = "default_1289")] pub provider_id: String, - #[serde(default = "default_1282")] + #[serde(default = "default_1290")] pub challenge_fingerprint: String, - #[serde(default = "default_1283")] + #[serde(default = "default_1291")] pub verification_token: String, - #[serde(default = "default_1284")] + #[serde(default = "default_1292")] pub channels: Integer, - #[serde(default = "default_1285")] + #[serde(default = "default_1293")] pub expires_at: f64, } impl std::fmt::Debug for PushStatusOutput { @@ -27836,7 +27973,7 @@ impl PushStatusInput { #[non_exhaustive] pub struct KnowledgeSourceRemoveOutput { pub name: String, - #[serde(default = "default_1286")] + #[serde(default = "default_1294")] pub documents_pending: Integer, } @@ -27898,12 +28035,12 @@ impl KnowledgeSourceRemoveInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceRotateOutput { - #[serde(default = "default_1287")] + #[serde(default = "default_1295")] pub crawl_proof: Option, pub name: String, - #[serde(default = "default_1288")] + #[serde(default = "default_1296")] pub probe: KnowledgeSourceProbe, - #[serde(default = "default_1289")] + #[serde(default = "default_1297")] pub rotated_at: String, } @@ -27955,7 +28092,7 @@ impl KnowledgeSourceRotateInput { #[non_exhaustive] pub struct KnowledgeSourceSyncNowOutput { pub name: String, - #[serde(default = "default_1290")] + #[serde(default = "default_1298")] pub enabled: bool, } @@ -28017,20 +28154,20 @@ impl KnowledgeSourceSyncNowInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceUpdateOutput { - #[serde(default = "default_1291")] + #[serde(default = "default_1299")] pub crawl_proof: Option, pub name: String, - #[serde(default = "default_1292")] + #[serde(default = "default_1300")] pub items: Vec>, - #[serde(default = "default_1293")] + #[serde(default = "default_1301")] pub include: Vec, - #[serde(default = "default_1294")] + #[serde(default = "default_1302")] pub config: std::collections::HashMap, - #[serde(default = "default_1295")] + #[serde(default = "default_1303")] pub added: Vec>, - #[serde(default = "default_1296")] + #[serde(default = "default_1304")] pub removed: Vec>, - #[serde(default = "default_1297")] + #[serde(default = "default_1305")] pub probe: KnowledgeSourceProbe, } @@ -28161,9 +28298,9 @@ impl KnowledgeSourceUpdateInput { pub struct CitedChunk { pub source_uri: String, pub chunk_idx: Integer, - #[serde(default = "default_1299")] + #[serde(default = "default_1307")] pub revision: Integer, - #[serde(default = "default_1300")] + #[serde(default = "default_1308")] pub locator: Option>, } @@ -28172,12 +28309,12 @@ pub struct CitedChunk { pub struct SynthesizeCalculation { pub columns: Vec, pub rows: Vec>, - #[serde(default = "default_1307")] + #[serde(default = "default_1315")] pub row_ids: Vec>, - #[serde(default = "default_1308")] + #[serde(default = "default_1316")] pub truncated: bool, pub complete: bool, - #[serde(default = "default_1309")] + #[serde(default = "default_1317")] pub incomplete: Vec, pub receipt: QueryReceipt, pub citation: String, @@ -28191,23 +28328,23 @@ pub struct KnowledgeSynthesizeOutput { pub chunks_read: Integer, pub documents: Integer, pub reduce_rounds: Integer, - #[serde(default = "default_1298")] + #[serde(default = "default_1306")] pub citations: Vec, - #[serde(default = "default_1301")] + #[serde(default = "default_1309")] pub cited_chunks: Vec, - #[serde(default = "default_1302")] + #[serde(default = "default_1310")] pub unsupported_citations: Vec, - #[serde(default = "default_1303")] + #[serde(default = "default_1311")] pub truncated: bool, - #[serde(default = "default_1304")] + #[serde(default = "default_1312")] pub abstain: bool, - #[serde(default = "default_1305")] + #[serde(default = "default_1313")] pub abstain_reason: String, - #[serde(default = "default_1306")] + #[serde(default = "default_1314")] pub clarification: String, - #[serde(default = "default_1310")] + #[serde(default = "default_1318")] pub calculations: Vec, - #[serde(default = "default_1311")] + #[serde(default = "default_1319")] pub model: String, } @@ -28323,13 +28460,13 @@ impl KnowledgeSynthesizeInput { #[non_exhaustive] pub struct KnowledgeUpdateMetadataOutput { pub updated: bool, - #[serde(default = "default_1312")] + #[serde(default = "default_1320")] pub title: String, - #[serde(default = "default_1313")] + #[serde(default = "default_1321")] pub description: String, - #[serde(default = "default_1314")] + #[serde(default = "default_1322")] pub tags: Vec, - #[serde(default = "default_1315")] + #[serde(default = "default_1323")] pub chunks_reindexed: Integer, } @@ -28441,13 +28578,13 @@ pub struct KnowledgeUpsertOutput { pub chunks_superseded: Integer, pub embedding_model: String, pub embedding_dim: Integer, - #[serde(default = "default_1316")] + #[serde(default = "default_1324")] pub duplicate_of_uri: String, - #[serde(default = "default_1317")] + #[serde(default = "default_1325")] pub duplicate_chunk_count: Integer, - #[serde(default = "default_1318")] + #[serde(default = "default_1326")] pub namespace: String, - #[serde(default = "default_1319")] + #[serde(default = "default_1327")] pub source_uri: String, } @@ -28632,26 +28769,26 @@ pub struct LearningEntry { pub memory_type: String, pub proposed_value: Value, pub supporter_count: Integer, - #[serde(default = "default_1320")] + #[serde(default = "default_1328")] pub supporter_sessions: Integer, - #[serde(default = "default_1321")] + #[serde(default = "default_1329")] pub supporter_writers: Integer, pub confidence_avg: f64, pub supporters: Vec, pub rationale: String, - #[serde(default = "default_1322")] + #[serde(default = "default_1330")] pub source_kind: String, - #[serde(default = "default_1323")] + #[serde(default = "default_1331")] pub source_resource_id: String, - #[serde(default = "default_1324")] + #[serde(default = "default_1332")] pub agent: String, pub status: LearningEntryStatus, pub proposed_at: String, - #[serde(default = "default_1325")] + #[serde(default = "default_1333")] pub decided_at: Option, - #[serde(default = "default_1326")] + #[serde(default = "default_1334")] pub decided_by: String, - #[serde(default = "default_1327")] + #[serde(default = "default_1335")] pub decision_reason: String, } @@ -28854,11 +28991,11 @@ pub enum LearningsReviewOutputNewStatus { pub struct LearningsReviewOutput { pub candidate_id: String, pub new_status: LearningsReviewOutputNewStatus, - #[serde(default = "default_1328")] + #[serde(default = "default_1336")] pub promoted_to_shared: bool, - #[serde(default = "default_1329")] + #[serde(default = "default_1337")] pub promoted_to_knowledge: bool, - #[serde(default = "default_1330")] + #[serde(default = "default_1338")] pub knowledge_source_uri: String, pub decided_at: String, } @@ -29062,7 +29199,7 @@ impl MemoryAgentsListInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct AggregateRow { - #[serde(default = "default_1331")] + #[serde(default = "default_1339")] pub group: std::collections::HashMap, pub metric: f64, } @@ -29070,9 +29207,9 @@ pub struct AggregateRow { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryAggregateOutput { - #[serde(default = "default_1332")] + #[serde(default = "default_1340")] pub rows: Vec, - #[serde(default = "default_1333")] + #[serde(default = "default_1341")] pub sql_executed: String, } @@ -29240,15 +29377,15 @@ impl MemoryAggregateInput { pub struct BulkSetResult { pub memory_key: String, pub version: Integer, - #[serde(default = "default_1334")] + #[serde(default = "default_1342")] pub memory_id: String, - #[serde(default = "default_1335")] + #[serde(default = "default_1343")] pub conflict_verdict: String, - #[serde(default = "default_1336")] + #[serde(default = "default_1344")] pub peers: Vec, - #[serde(default = "default_1337")] + #[serde(default = "default_1345")] pub next: String, - #[serde(default = "default_1338")] + #[serde(default = "default_1346")] pub pinned_blocker_id: String, } @@ -29256,29 +29393,29 @@ pub struct BulkSetResult { #[non_exhaustive] pub struct MemoryBulkSetOutput { pub written: Vec, - #[serde(default = "default_1339")] + #[serde(default = "default_1347")] pub skipped_pinned: Vec, - #[serde(default = "default_1340")] + #[serde(default = "default_1348")] pub skipped_locked: Vec, - #[serde(default = "default_1341")] + #[serde(default = "default_1349")] pub skipped_blacklisted: Vec, - #[serde(default = "default_1342")] + #[serde(default = "default_1350")] pub merged: Vec, - #[serde(default = "default_1343")] + #[serde(default = "default_1351")] pub value_updates_linked: Integer, - #[serde(default = "default_1344")] + #[serde(default = "default_1352")] pub rejected_pinned: Vec, - #[serde(default = "default_1345")] + #[serde(default = "default_1353")] pub duplicates: Vec, - #[serde(default = "default_1346")] + #[serde(default = "default_1354")] pub conflicted: Vec, - #[serde(default = "default_1347")] + #[serde(default = "default_1355")] pub unchecked: Integer, - #[serde(default = "default_1348")] + #[serde(default = "default_1356")] pub retyped: Vec, - #[serde(default = "default_1349")] + #[serde(default = "default_1357")] pub identity_duplicates: std::collections::HashMap, - #[serde(default = "default_1350")] + #[serde(default = "default_1358")] pub stage_ms: std::collections::HashMap, } @@ -29428,18 +29565,18 @@ pub enum ApplyRowStatus { #[non_exhaustive] pub struct ApplyRow { pub memory_key: String, - #[serde(default = "default_1358")] + #[serde(default = "default_1366")] pub memory_id: String, - #[serde(default = "default_1359")] + #[serde(default = "default_1367")] pub agent: String, - #[serde(default = "default_1360")] + #[serde(default = "default_1368")] pub user_id: String, - #[serde(default = "default_1361")] + #[serde(default = "default_1369")] pub session_id: String, pub status: ApplyRowStatus, - #[serde(default = "default_1362")] + #[serde(default = "default_1370")] pub version: Option, - #[serde(default = "default_1363")] + #[serde(default = "default_1371")] pub detail: String, } @@ -29449,21 +29586,21 @@ pub struct MemoryApplyOutput { pub action: String, pub dry_run: bool, pub target: String, - #[serde(default = "default_1351")] + #[serde(default = "default_1359")] pub matched: Integer, - #[serde(default = "default_1352")] + #[serde(default = "default_1360")] pub applied: Integer, - #[serde(default = "default_1353")] + #[serde(default = "default_1361")] pub would_apply: Integer, - #[serde(default = "default_1354")] + #[serde(default = "default_1362")] pub refused: Integer, - #[serde(default = "default_1355")] + #[serde(default = "default_1363")] pub noop: Integer, - #[serde(default = "default_1356")] + #[serde(default = "default_1364")] pub failed: Integer, - #[serde(default = "default_1357")] + #[serde(default = "default_1365")] pub truncated: bool, - #[serde(default = "default_1364")] + #[serde(default = "default_1372")] pub rows: Vec, } @@ -30197,137 +30334,137 @@ pub enum MemoryAskOutputDeepFirst { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryAskOutput { - #[serde(default = "default_1365")] + #[serde(default = "default_1373")] pub answer: String, - #[serde(default = "default_1366")] + #[serde(default = "default_1374")] pub source: MemoryAskOutputSource, - #[serde(default = "default_1367")] + #[serde(default = "default_1375")] pub abstain: bool, - #[serde(default = "default_1368")] + #[serde(default = "default_1376")] pub abstain_reason: String, - #[serde(default = "default_1369")] + #[serde(default = "default_1377")] pub memory_keys: Vec, - #[serde(default = "default_1370")] + #[serde(default = "default_1378")] pub results: Vec, - #[serde(default = "default_1371")] + #[serde(default = "default_1379")] pub cited_sessions: Vec, - #[serde(default = "default_1372")] + #[serde(default = "default_1380")] pub next: String, - #[serde(default = "default_1373")] + #[serde(default = "default_1381")] pub synth_model: String, - #[serde(default = "default_1374")] + #[serde(default = "default_1382")] pub route_tier: MemoryAskOutputRouteTier, - #[serde(default = "default_1375")] + #[serde(default = "default_1383")] pub route_reason: String, - #[serde(default = "default_1376")] + #[serde(default = "default_1384")] pub llm_cache_hits: Integer, - #[serde(default = "default_1377")] + #[serde(default = "default_1385")] pub llm_cache_misses: Integer, - #[serde(default = "default_1378")] + #[serde(default = "default_1386")] pub llm_cache: bool, - #[serde(default = "default_1379")] + #[serde(default = "default_1387")] pub llm_cache_saved_usd: f64, - #[serde(default = "default_1380")] + #[serde(default = "default_1388")] pub temporal_consistency: Option, - #[serde(default = "default_1381")] + #[serde(default = "default_1389")] pub citation_concentration: Option, - #[serde(default = "default_1382")] + #[serde(default = "default_1390")] pub escalated: bool, - #[serde(default = "default_1383")] + #[serde(default = "default_1391")] pub gate_mode: String, - #[serde(default = "default_1384")] + #[serde(default = "default_1392")] pub gate_kept: Integer, - #[serde(default = "default_1385")] + #[serde(default = "default_1393")] pub gate_dropped: Integer, - #[serde(default = "default_1386")] + #[serde(default = "default_1394")] pub pending_extraction: Integer, - #[serde(default = "default_1387")] + #[serde(default = "default_1395")] pub pending_evidence: Integer, - #[serde(default = "default_1388")] + #[serde(default = "default_1396")] pub retrieval_query: String, - #[serde(default = "default_1389")] + #[serde(default = "default_1397")] pub facets: Vec, - #[serde(default = "default_1390")] + #[serde(default = "default_1398")] pub facet_memories_added: Integer, - #[serde(default = "default_1391")] + #[serde(default = "default_1399")] pub consistency: MemoryAskOutputConsistency, - #[serde(default = "default_1392")] + #[serde(default = "default_1400")] pub consistency_score: f64, - #[serde(default = "default_1393")] + #[serde(default = "default_1401")] pub consistency_note: String, - #[serde(default = "default_1394")] + #[serde(default = "default_1402")] pub identifier_chase_hops: Integer, - #[serde(default = "default_1395")] + #[serde(default = "default_1403")] pub identifier_chase_added: Integer, - #[serde(default = "default_1396")] + #[serde(default = "default_1404")] pub premise_conflict: String, - #[serde(default = "default_1397")] + #[serde(default = "default_1405")] pub premise_note: String, - #[serde(default = "default_1398")] + #[serde(default = "default_1406")] pub premise_verdict: String, - #[serde(default = "default_1399")] + #[serde(default = "default_1407")] pub attribution_note: String, - #[serde(default = "default_1400")] + #[serde(default = "default_1408")] pub depth: MemoryAskOutputDepth, - #[serde(default = "default_1401")] + #[serde(default = "default_1409")] pub deep_fired: bool, - #[serde(default = "default_1402")] + #[serde(default = "default_1410")] pub decomposed: Vec, - #[serde(default = "default_1403")] + #[serde(default = "default_1411")] pub decomposed_parts: Integer, - #[serde(default = "default_1404")] + #[serde(default = "default_1412")] pub superseded_dropped: Integer, - #[serde(default = "default_1405")] + #[serde(default = "default_1413")] pub stale_sentences_masked: Integer, - #[serde(default = "default_1406")] + #[serde(default = "default_1414")] pub entity_followed: Vec, - #[serde(default = "default_1407")] + #[serde(default = "default_1415")] pub when_evidence_turns: Integer, - #[serde(default = "default_1408")] + #[serde(default = "default_1416")] pub decompose_failed: Integer, - #[serde(default = "default_1409")] + #[serde(default = "default_1417")] pub pool_k: Integer, - #[serde(default = "default_1410")] + #[serde(default = "default_1418")] pub grounding: MemoryAskOutputGrounding, - #[serde(default = "default_1411")] + #[serde(default = "default_1419")] pub deep_reason: String, - #[serde(default = "default_1412")] + #[serde(default = "default_1420")] pub deep_keys: Vec, - #[serde(default = "default_1413")] + #[serde(default = "default_1421")] pub deep_chars: Integer, - #[serde(default = "default_1414")] + #[serde(default = "default_1422")] pub code_hits: Integer, - #[serde(default = "default_1415")] + #[serde(default = "default_1423")] pub pool_facts: Integer, - #[serde(default = "default_1416")] + #[serde(default = "default_1424")] pub pool_chunks: Integer, - #[serde(default = "default_1417")] + #[serde(default = "default_1425")] pub prompt_blocks: std::collections::HashMap, - #[serde(default = "default_1418")] + #[serde(default = "default_1426")] pub deep_selector: MemoryAskOutputDeepSelector, - #[serde(default = "default_1419")] + #[serde(default = "default_1427")] pub deep_first: MemoryAskOutputDeepFirst, - #[serde(default = "default_1420")] + #[serde(default = "default_1428")] pub synth_calls: Integer, - #[serde(default = "default_1421")] + #[serde(default = "default_1429")] pub synth_input_tokens: Integer, - #[serde(default = "default_1422")] + #[serde(default = "default_1430")] pub synth_cached_input_tokens: Integer, - #[serde(default = "default_1423")] + #[serde(default = "default_1431")] pub synth_cache_write_tokens: Integer, - #[serde(default = "default_1424")] + #[serde(default = "default_1432")] pub synth_cost_usd: f64, - #[serde(default = "default_1425")] + #[serde(default = "default_1433")] pub context_tokens_est: Integer, - #[serde(default = "default_1426")] + #[serde(default = "default_1434")] pub context_trimmed: Integer, - #[serde(default = "default_1427")] + #[serde(default = "default_1435")] pub summary_hits: Integer, - #[serde(default = "default_1428")] + #[serde(default = "default_1436")] pub knowledge_hits: Integer, - #[serde(default = "default_1429")] + #[serde(default = "default_1437")] pub timeline_rows: Integer, - #[serde(default = "default_1430")] + #[serde(default = "default_1438")] pub count_recomputed: bool, } @@ -31282,36 +31419,42 @@ pub struct MemoryAutoRetirement { pub reason: String, pub memory_id: String, pub memory_key: String, - #[serde(default = "default_1431")] + #[serde(default = "default_1439")] pub agent: String, - #[serde(default = "default_1432")] + #[serde(default = "default_1440")] pub user_id: String, - #[serde(default = "default_1433")] + #[serde(default = "default_1441")] pub session_id: String, - #[serde(default = "default_1434")] + #[serde(default = "default_1442")] pub superseded_by: String, - #[serde(default = "default_1435")] + #[serde(default = "default_1443")] pub superseded_by_key: String, - #[serde(default = "default_1436")] + #[serde(default = "default_1444")] pub label: String, - #[serde(default = "default_1437")] + #[serde(default = "default_1445")] pub unconfirmed: bool, - #[serde(default = "default_1438")] + #[serde(default = "default_1446")] pub judge_verdict: String, - #[serde(default = "default_1439")] + #[serde(default = "default_1447")] pub judge_confidence: Option, - #[serde(default = "default_1440")] + #[serde(default = "default_1448")] pub judge_model: String, - #[serde(default = "default_1441")] + #[serde(default = "default_1449")] pub judge_prompt_version: String, + #[serde(default = "default_1450")] + pub applied_policy: String, + #[serde(default = "default_1451")] + pub winner_capture_origin: String, + #[serde(default = "default_1452")] + pub retired_capture_origin: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryAutoRetirementsOutput { - #[serde(default = "default_1442")] + #[serde(default = "default_1453")] pub rows: Vec, - #[serde(default = "default_1443")] + #[serde(default = "default_1454")] pub next_cursor: Option, } @@ -31405,9 +31548,9 @@ impl MemoryAutoRetirementsInput { #[non_exhaustive] pub struct BacklinkVersion { pub version: Integer, - #[serde(default = "default_1445")] + #[serde(default = "default_1456")] pub status: String, - #[serde(default = "default_1446")] + #[serde(default = "default_1457")] pub created_at: String, } @@ -31415,7 +31558,7 @@ pub struct BacklinkVersion { #[non_exhaustive] pub struct BacklinkDigest { pub session_id: String, - #[serde(default = "default_1448")] + #[serde(default = "default_1459")] pub date: String, } @@ -31423,9 +31566,9 @@ pub struct BacklinkDigest { #[non_exhaustive] pub struct BacklinkEdge { pub memory_key: String, - #[serde(default = "default_1450")] + #[serde(default = "default_1461")] pub relation: String, - #[serde(default = "default_1451")] + #[serde(default = "default_1462")] pub created_at: String, } @@ -31433,7 +31576,7 @@ pub struct BacklinkEdge { #[non_exhaustive] pub struct BacklinkRelated { pub memory_key: String, - #[serde(default = "default_1455")] + #[serde(default = "default_1466")] pub shared_entities: Vec, } @@ -31441,19 +31584,19 @@ pub struct BacklinkRelated { #[non_exhaustive] pub struct MemoryBacklinksOutput { pub memory_key: String, - #[serde(default = "default_1444")] + #[serde(default = "default_1455")] pub found: bool, - #[serde(default = "default_1447")] + #[serde(default = "default_1458")] pub versions: Vec, - #[serde(default = "default_1449")] + #[serde(default = "default_1460")] pub digests: Vec, - #[serde(default = "default_1452")] + #[serde(default = "default_1463")] pub links_in: Vec, - #[serde(default = "default_1453")] + #[serde(default = "default_1464")] pub links_out: Vec, - #[serde(default = "default_1454")] + #[serde(default = "default_1465")] pub evidence_count: Integer, - #[serde(default = "default_1456")] + #[serde(default = "default_1467")] pub related: Vec, } @@ -31558,36 +31701,36 @@ impl MemoryBacklinksInput { #[non_exhaustive] pub struct BriefEvidence { pub memory_key: String, - #[serde(default = "default_1461")] + #[serde(default = "default_1472")] pub source: String, - #[serde(default = "default_1462")] + #[serde(default = "default_1473")] pub source_class: String, - #[serde(default = "default_1463")] + #[serde(default = "default_1474")] pub verified: bool, - #[serde(default = "default_1464")] + #[serde(default = "default_1475")] pub when: String, - #[serde(default = "default_1465")] + #[serde(default = "default_1476")] pub session_id: String, - #[serde(default = "default_1466")] + #[serde(default = "default_1477")] pub excerpt: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryBriefOutput { - #[serde(default = "default_1457")] + #[serde(default = "default_1468")] pub query: String, - #[serde(default = "default_1458")] + #[serde(default = "default_1469")] pub answer: String, - #[serde(default = "default_1459")] + #[serde(default = "default_1470")] pub abstained: bool, - #[serde(default = "default_1460")] + #[serde(default = "default_1471")] pub grounding: String, - #[serde(default = "default_1467")] + #[serde(default = "default_1478")] pub evidence: Vec, - #[serde(default = "default_1468")] + #[serde(default = "default_1479")] pub unknowns: Vec, - #[serde(default = "default_1469")] + #[serde(default = "default_1480")] pub next_reads: Vec, } @@ -32001,9 +32144,9 @@ pub struct MemoryBulkGetOutputMemoryGetOutput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryBulkGetOutput { - #[serde(default = "default_1470")] + #[serde(default = "default_1481")] pub results: std::collections::HashMap, - #[serde(default = "default_1471")] + #[serde(default = "default_1482")] pub missing: Vec, } @@ -32516,7 +32659,7 @@ pub struct MemoryClearOutput { pub cleared_at: String, pub rows_affected: std::collections::HashMap, pub total: Integer, - #[serde(default = "default_1472")] + #[serde(default = "default_1483")] pub locked_skipped: Integer, } @@ -32604,21 +32747,21 @@ pub struct MemoryConsolidateResult { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryConsolidateOutput { - #[serde(default = "default_1473")] + #[serde(default = "default_1484")] pub consolidated: Vec, - #[serde(default = "default_1474")] + #[serde(default = "default_1485")] pub examined: Integer, - #[serde(default = "default_1475")] + #[serde(default = "default_1486")] pub clusters_found: Integer, - #[serde(default = "default_1476")] + #[serde(default = "default_1487")] pub clusters_failed: Integer, - #[serde(default = "default_1477")] + #[serde(default = "default_1488")] pub clusters_refused_lossy: Integer, - #[serde(default = "default_1478")] + #[serde(default = "default_1489")] pub skipped_in_flight: Integer, - #[serde(default = "default_1479")] + #[serde(default = "default_1490")] pub tokens_in: Integer, - #[serde(default = "default_1480")] + #[serde(default = "default_1491")] pub tokens_out: Integer, } @@ -32759,7 +32902,7 @@ impl MemoryConsolidateInput { #[non_exhaustive] pub struct MemoryCopyToOutput { pub copied: bool, - #[serde(default = "default_1481")] + #[serde(default = "default_1492")] pub target_memory_id: String, pub target_namespace: String, pub target_key: String, @@ -32870,11 +33013,11 @@ impl MemoryCopyToInput { #[non_exhaustive] pub struct MemoryCrossPromoteOutput { pub promoted: bool, - #[serde(default = "default_1482")] + #[serde(default = "default_1493")] pub target_memory_id: String, pub target_namespace: String, pub target_key: String, - #[serde(default = "default_1483")] + #[serde(default = "default_1494")] pub cross_promoted_from_memory_id: String, } @@ -32957,23 +33100,23 @@ pub struct DedupCollapsePair { #[non_exhaustive] pub struct MemoryDedupCollapseOutput { pub namespace: String, - #[serde(default = "default_1484")] + #[serde(default = "default_1495")] pub prefix: String, - #[serde(default = "default_1485")] + #[serde(default = "default_1496")] pub dry_run: bool, - #[serde(default = "default_1486")] + #[serde(default = "default_1497")] pub pairs: Integer, - #[serde(default = "default_1487")] + #[serde(default = "default_1498")] pub canonical_live: Integer, - #[serde(default = "default_1488")] + #[serde(default = "default_1499")] pub orphans: Integer, - #[serde(default = "default_1489")] + #[serde(default = "default_1500")] pub mirror_stale: Integer, - #[serde(default = "default_1490")] + #[serde(default = "default_1501")] pub restamped: Integer, - #[serde(default = "default_1491")] + #[serde(default = "default_1502")] pub truncated: bool, - #[serde(default = "default_1492")] + #[serde(default = "default_1503")] pub sample: Vec, } @@ -33072,7 +33215,7 @@ pub struct DedupDuplicate { pub memory_id: String, pub memory_key: String, pub agent: String, - #[serde(default = "default_1495")] + #[serde(default = "default_1506")] pub created_at: Option, } @@ -33080,12 +33223,12 @@ pub struct DedupDuplicate { #[non_exhaustive] pub struct DedupCluster { pub canonical_id: String, - #[serde(default = "default_1493")] + #[serde(default = "default_1504")] pub canonical_key: String, - #[serde(default = "default_1494")] + #[serde(default = "default_1505")] pub canonical_agent: String, pub dup_count: Integer, - #[serde(default = "default_1496")] + #[serde(default = "default_1507")] pub duplicates: Vec, } @@ -33157,11 +33300,11 @@ pub struct MemoryDedupResolveOutput { pub canonical_key: String, pub duplicate_key: String, pub decision: String, - #[serde(default = "default_1497")] + #[serde(default = "default_1508")] pub canonical_tombstoned: bool, - #[serde(default = "default_1498")] + #[serde(default = "default_1509")] pub duplicate_tombstoned: bool, - #[serde(default = "default_1499")] + #[serde(default = "default_1510")] pub ignored_args: Vec, } @@ -33299,17 +33442,17 @@ pub struct LostName { pub struct DefinitionEntry { pub memory_key: String, pub promoted_at: String, - #[serde(default = "default_1500")] + #[serde(default = "default_1511")] pub capped: bool, - #[serde(default = "default_1501")] + #[serde(default = "default_1512")] pub term: Option, - #[serde(default = "default_1502")] + #[serde(default = "default_1513")] pub aliases: Vec, - #[serde(default = "default_1503")] + #[serde(default = "default_1514")] pub verdict: Option, - #[serde(default = "default_1504")] + #[serde(default = "default_1515")] pub lapse_reason: Option, - #[serde(default = "default_1505")] + #[serde(default = "default_1516")] pub lost: Vec, } @@ -33370,15 +33513,15 @@ impl MemoryDefinitionsListInput { #[non_exhaustive] pub struct MemoryDeleteVersionOutput { pub tombstoned: bool, - #[serde(default = "default_1506")] + #[serde(default = "default_1517")] pub version: Integer, - #[serde(default = "default_1507")] + #[serde(default = "default_1518")] pub found: bool, - #[serde(default = "default_1508")] + #[serde(default = "default_1519")] pub reason: String, - #[serde(default = "default_1509")] + #[serde(default = "default_1520")] pub dependents_tombstoned: Integer, - #[serde(default = "default_1510")] + #[serde(default = "default_1521")] pub dependents_downgraded: Integer, } @@ -33505,21 +33648,21 @@ pub struct DemonstrationRow { pub struct MemoryDemonstrateOutput { pub query: String, pub demonstrations: Vec, - #[serde(default = "default_1511")] + #[serde(default = "default_1522")] pub votes: std::collections::HashMap, - #[serde(default = "default_1512")] + #[serde(default = "default_1523")] pub predicted_label: String, - #[serde(default = "default_1513")] + #[serde(default = "default_1524")] pub margin: f64, - #[serde(default = "default_1514")] + #[serde(default = "default_1525")] pub abstain: bool, - #[serde(default = "default_1515")] + #[serde(default = "default_1526")] pub abstain_reason: String, - #[serde(default = "default_1516")] + #[serde(default = "default_1527")] pub few_shot_block: String, - #[serde(default = "default_1517")] + #[serde(default = "default_1528")] pub examined: Integer, - #[serde(default = "default_1518")] + #[serde(default = "default_1529")] pub labelled: Integer, } @@ -33659,7 +33802,7 @@ impl MemoryDemonstrateInput { pub struct MemoryDemoteOutput { pub demoted: bool, pub was_reversible: bool, - #[serde(default = "default_1519")] + #[serde(default = "default_1530")] pub tombstoned_at: Option, } @@ -33721,15 +33864,15 @@ impl MemoryDemoteInput { pub struct DigestRow { pub session_id: String, pub summary_text: String, - #[serde(default = "default_1520")] + #[serde(default = "default_1531")] pub key_facts: Vec, - #[serde(default = "default_1521")] + #[serde(default = "default_1532")] pub derived_from: Vec, - #[serde(default = "default_1522")] + #[serde(default = "default_1533")] pub valid_at: Option, - #[serde(default = "default_1523")] + #[serde(default = "default_1534")] pub created_at: Option, - #[serde(default = "default_1524")] + #[serde(default = "default_1535")] pub version: Integer, } @@ -33737,7 +33880,7 @@ pub struct DigestRow { #[non_exhaustive] pub struct MemoryDigestsOutput { pub rows: Vec, - #[serde(default = "default_1525")] + #[serde(default = "default_1536")] pub truncated: bool, } @@ -33862,17 +34005,17 @@ pub struct MemoryEvidenceItem { pub evidence_id: String, pub support_type: String, pub scope: MemoryEvidenceItemScope, - #[serde(default = "default_1529")] + #[serde(default = "default_1540")] pub role: String, - #[serde(default = "default_1530")] + #[serde(default = "default_1541")] pub observed_at: Option, - #[serde(default = "default_1531")] + #[serde(default = "default_1542")] pub content: String, - #[serde(default = "default_1532")] + #[serde(default = "default_1543")] pub char_start: Integer, - #[serde(default = "default_1533")] + #[serde(default = "default_1544")] pub char_end: Integer, - #[serde(default = "default_1534")] + #[serde(default = "default_1545")] pub span: String, } @@ -33880,23 +34023,23 @@ pub struct MemoryEvidenceItem { #[non_exhaustive] pub struct MemoryEvidenceOutput { pub found: bool, - #[serde(default = "default_1526")] + #[serde(default = "default_1537")] pub memory_key: String, - #[serde(default = "default_1527")] + #[serde(default = "default_1538")] pub memory_id: String, - #[serde(default = "default_1528")] + #[serde(default = "default_1539")] pub value: String, - #[serde(default = "default_1535")] + #[serde(default = "default_1546")] pub items: Vec, - #[serde(default = "default_1536")] + #[serde(default = "default_1547")] pub truncated: bool, - #[serde(default = "default_1537")] + #[serde(default = "default_1548")] pub cited: Integer, - #[serde(default = "default_1538")] + #[serde(default = "default_1549")] pub lexical: Integer, - #[serde(default = "default_1539")] + #[serde(default = "default_1550")] pub window: Integer, - #[serde(default = "default_1540")] + #[serde(default = "default_1551")] pub derived: Integer, } @@ -34001,26 +34144,26 @@ impl MemoryEvidenceInput { #[non_exhaustive] pub struct EvidenceChunk { pub session_id: String, - #[serde(default = "default_1541")] + #[serde(default = "default_1552")] pub chunk_index: Integer, pub content: String, - #[serde(default = "default_1542")] + #[serde(default = "default_1553")] pub content_sha256: String, - #[serde(default = "default_1543")] + #[serde(default = "default_1554")] pub agent: String, - #[serde(default = "default_1544")] + #[serde(default = "default_1555")] pub user_id: String, - #[serde(default = "default_1545")] + #[serde(default = "default_1556")] pub parent_memory_key: String, - #[serde(default = "default_1546")] + #[serde(default = "default_1557")] pub memory_keys: Vec, - #[serde(default = "default_1547")] + #[serde(default = "default_1558")] pub line_start: Integer, - #[serde(default = "default_1548")] + #[serde(default = "default_1559")] pub line_end: Integer, - #[serde(default = "default_1549")] + #[serde(default = "default_1560")] pub created_at: String, - #[serde(default = "default_1550")] + #[serde(default = "default_1561")] pub source_url: String, } @@ -34029,17 +34172,17 @@ pub struct EvidenceChunk { pub struct EvidenceDigest { pub session_id: String, pub summary_text: String, - #[serde(default = "default_1552")] + #[serde(default = "default_1563")] pub agent: String, - #[serde(default = "default_1553")] + #[serde(default = "default_1564")] pub user_id: String, - #[serde(default = "default_1554")] + #[serde(default = "default_1565")] pub key_facts: Vec, - #[serde(default = "default_1555")] + #[serde(default = "default_1566")] pub derived_from: Vec, - #[serde(default = "default_1556")] + #[serde(default = "default_1567")] pub valid_at: String, - #[serde(default = "default_1557")] + #[serde(default = "default_1568")] pub created_at: String, } @@ -34049,28 +34192,28 @@ pub struct EvidenceEdge { pub from_key: String, pub to_key: String, pub relation: String, - #[serde(default = "default_1559")] + #[serde(default = "default_1570")] pub confidence: f64, - #[serde(default = "default_1560")] + #[serde(default = "default_1571")] pub explanation: String, - #[serde(default = "default_1561")] + #[serde(default = "default_1572")] pub created_at: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExportEvidenceOutput { - #[serde(default = "default_1551")] + #[serde(default = "default_1562")] pub chunks: Vec, - #[serde(default = "default_1558")] + #[serde(default = "default_1569")] pub digests: Vec, - #[serde(default = "default_1562")] + #[serde(default = "default_1573")] pub edges: Vec, - #[serde(default = "default_1563")] + #[serde(default = "default_1574")] pub has_more: bool, - #[serde(default = "default_1564")] + #[serde(default = "default_1575")] pub next_cursor: String, - #[serde(default = "default_1565")] + #[serde(default = "default_1576")] pub held_high: Integer, } @@ -34263,15 +34406,15 @@ impl ExposureSummaryInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExtractionRetryMineOutput { - #[serde(default = "default_1566")] + #[serde(default = "default_1577")] pub requeued: Vec, - #[serde(default = "default_1567")] + #[serde(default = "default_1578")] pub not_failed: Vec, - #[serde(default = "default_1568")] + #[serde(default = "default_1579")] pub model_calls_off: Vec, - #[serde(default = "default_1569")] + #[serde(default = "default_1580")] pub expired: Vec, - #[serde(default = "default_1570")] + #[serde(default = "default_1581")] pub unknown: Vec, } @@ -34332,20 +34475,20 @@ pub struct ExtractionQueueRow { pub content_chars: Integer, pub written: Integer, pub last_error: String, - #[serde(default = "default_1571")] + #[serde(default = "default_1582")] pub enqueued_at: Option, - #[serde(default = "default_1572")] + #[serde(default = "default_1583")] pub updated_at: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExtractionStatusOutput { - #[serde(default = "default_1573")] + #[serde(default = "default_1584")] pub batches: Vec, - #[serde(default = "default_1574")] + #[serde(default = "default_1585")] pub pending: Integer, - #[serde(default = "default_1575")] + #[serde(default = "default_1586")] pub failed: Integer, } @@ -34493,13 +34636,13 @@ impl MemoryExtractionStatusInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExtractionStatusMineOutput { - #[serde(default = "default_1576")] + #[serde(default = "default_1587")] pub batches: Vec, - #[serde(default = "default_1577")] + #[serde(default = "default_1588")] pub unknown: Vec, - #[serde(default = "default_1578")] + #[serde(default = "default_1589")] pub pending: Integer, - #[serde(default = "default_1579")] + #[serde(default = "default_1590")] pub failed: Integer, } @@ -34620,39 +34763,39 @@ pub struct MemoryForFileHit { pub memory_key: String, pub memory_type: String, pub value: String, - #[serde(default = "default_1580")] + #[serde(default = "default_1591")] pub value_truncated: bool, - #[serde(default = "default_1581")] + #[serde(default = "default_1592")] pub tags: Vec, - #[serde(default = "default_1582")] + #[serde(default = "default_1593")] pub confidence: f64, - #[serde(default = "default_1583")] + #[serde(default = "default_1594")] pub pinned: bool, - #[serde(default = "default_1584")] + #[serde(default = "default_1595")] pub status: String, - #[serde(default = "default_1585")] + #[serde(default = "default_1596")] pub agent: String, - #[serde(default = "default_1586")] + #[serde(default = "default_1597")] pub updated_at: Option, - #[serde(default = "default_1587")] + #[serde(default = "default_1598")] pub namespace: String, - #[serde(default = "default_1588")] + #[serde(default = "default_1599")] pub actor: String, - #[serde(default = "default_1589")] + #[serde(default = "default_1600")] pub supersedes_key: String, - #[serde(default = "default_1590")] + #[serde(default = "default_1601")] pub supersedes: String, - #[serde(default = "default_1591")] + #[serde(default = "default_1602")] pub supersedes_kind: MemoryForFileHitSupersedesKind, - #[serde(default = "default_1592")] + #[serde(default = "default_1603")] pub matched_files: Vec, - #[serde(default = "default_1593")] + #[serde(default = "default_1604")] pub source_resource_id: String, - #[serde(default = "default_1594")] + #[serde(default = "default_1605")] pub verification: MemoryForFileHitVerification, - #[serde(default = "default_1595")] + #[serde(default = "default_1606")] pub code_state: MemoryForFileHitCodeState, - #[serde(default = "default_1596")] + #[serde(default = "default_1607")] pub code_moved: Vec, } @@ -34662,7 +34805,7 @@ pub struct MemoryForFilePrintedRow { pub namespace: String, pub memory_key: String, pub line: String, - #[serde(default = "default_1600")] + #[serde(default = "default_1611")] pub binding: bool, } @@ -34672,13 +34815,13 @@ pub struct MemoryForFileOutput { pub path: String, pub total: Integer, pub hits: Vec, - #[serde(default = "default_1597")] + #[serde(default = "default_1608")] pub rendered: String, - #[serde(default = "default_1598")] + #[serde(default = "default_1609")] pub tokens_estimate: Integer, - #[serde(default = "default_1599")] + #[serde(default = "default_1610")] pub truncated: bool, - #[serde(default = "default_1601")] + #[serde(default = "default_1612")] pub printed: Vec, } @@ -34786,61 +34929,61 @@ impl MemoryForFileInput { #[non_exhaustive] pub struct MemoryGetByIdOutput { pub found: bool, - #[serde(default = "default_1602")] + #[serde(default = "default_1613")] pub memory_id: String, - #[serde(default = "default_1603")] + #[serde(default = "default_1614")] pub namespace: String, - #[serde(default = "default_1604")] + #[serde(default = "default_1615")] pub agent: String, - #[serde(default = "default_1605")] + #[serde(default = "default_1616")] pub user_id: String, - #[serde(default = "default_1606")] + #[serde(default = "default_1617")] pub session_id: String, - #[serde(default = "default_1607")] + #[serde(default = "default_1618")] pub memory_key: String, - #[serde(default = "default_1608")] + #[serde(default = "default_1619")] pub memory_type: Option, - #[serde(default = "default_1609")] + #[serde(default = "default_1620")] pub value: Value, - #[serde(default = "default_1610")] + #[serde(default = "default_1621")] pub confidence: Option, - #[serde(default = "default_1611")] + #[serde(default = "default_1622")] pub version: Option, - #[serde(default = "default_1612")] + #[serde(default = "default_1623")] pub created_at: Option, - #[serde(default = "default_1613")] + #[serde(default = "default_1624")] pub expires_at: Option, - #[serde(default = "default_1614")] + #[serde(default = "default_1625")] pub valid_at: Option, - #[serde(default = "default_1615")] + #[serde(default = "default_1626")] pub valid_to: Option, - #[serde(default = "default_1616")] + #[serde(default = "default_1627")] pub pinned: bool, - #[serde(default = "default_1617")] + #[serde(default = "default_1628")] pub content_sha256: String, - #[serde(default = "default_1618")] + #[serde(default = "default_1629")] pub verified_by: String, - #[serde(default = "default_1619")] + #[serde(default = "default_1630")] pub verified_at: Option, - #[serde(default = "default_1620")] + #[serde(default = "default_1631")] pub verification: String, - #[serde(default = "default_1621")] + #[serde(default = "default_1632")] pub sensitivity: String, - #[serde(default = "default_1622")] + #[serde(default = "default_1633")] pub actor: String, - #[serde(default = "default_1623")] + #[serde(default = "default_1634")] pub source_class: String, - #[serde(default = "default_1624")] + #[serde(default = "default_1635")] pub lock_mode: String, - #[serde(default = "default_1625")] + #[serde(default = "default_1636")] pub lock_reason: String, - #[serde(default = "default_1626")] + #[serde(default = "default_1637")] pub lock_until: Option, - #[serde(default = "default_1627")] + #[serde(default = "default_1638")] pub locked_by: String, - #[serde(default = "default_1628")] + #[serde(default = "default_1639")] pub on_expire: String, - #[serde(default = "default_1629")] + #[serde(default = "default_1640")] pub expire_reason: String, } @@ -34916,41 +35059,41 @@ pub struct MemoryHealthTopRow { pub memory_type: String, pub recall_count: Integer, pub used_count: Integer, - #[serde(default = "default_1632")] + #[serde(default = "default_1643")] pub harm_count: Integer, - #[serde(default = "default_1633")] + #[serde(default = "default_1644")] pub last_recalled_at: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryHealthStaleness { - #[serde(default = "default_1635")] + #[serde(default = "default_1646")] pub by_age: std::collections::HashMap, - #[serde(default = "default_1636")] + #[serde(default = "default_1647")] pub with_validity_end: Integer, - #[serde(default = "default_1637")] + #[serde(default = "default_1648")] pub with_validity_end_share: f64, - #[serde(default = "default_1638")] + #[serde(default = "default_1649")] pub with_expiry: Integer, - #[serde(default = "default_1639")] + #[serde(default = "default_1650")] pub expiring_7d: Integer, - #[serde(default = "default_1640")] + #[serde(default = "default_1651")] pub pinned: Integer, - #[serde(default = "default_1641")] + #[serde(default = "default_1652")] pub days_since_reinforced_p50: Integer, - #[serde(default = "default_1642")] + #[serde(default = "default_1653")] pub days_since_reinforced_p90: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryHealthFootprint { - #[serde(default = "default_1644")] + #[serde(default = "default_1655")] pub value_chars: Integer, - #[serde(default = "default_1645")] + #[serde(default = "default_1656")] pub value_tokens_est: Integer, - #[serde(default = "default_1646")] + #[serde(default = "default_1657")] pub tokens_per_row_est: f64, } @@ -34960,19 +35103,19 @@ pub struct MemoryHealthOutput { pub live: Integer, pub recalled_ever: Integer, pub used_ever: Integer, - #[serde(default = "default_1630")] + #[serde(default = "default_1641")] pub harmed_ever: Integer, pub silent: Integer, pub silent_older: Integer, pub silent_share: f64, pub silent_after_days: Integer, - #[serde(default = "default_1631")] + #[serde(default = "default_1642")] pub by_type: Vec, - #[serde(default = "default_1634")] + #[serde(default = "default_1645")] pub top_recalled: Vec, - #[serde(default = "default_1643")] + #[serde(default = "default_1654")] pub staleness: MemoryHealthStaleness, - #[serde(default = "default_1647")] + #[serde(default = "default_1658")] pub footprint: MemoryHealthFootprint, } @@ -35092,51 +35235,51 @@ impl MemoryHealthInput { pub struct MemoryHistoryRow { pub memory_id: String, pub version: Integer, - #[serde(default = "default_1648")] + #[serde(default = "default_1659")] pub version_text: String, - #[serde(default = "default_1649")] + #[serde(default = "default_1660")] pub value: Value, pub confidence: f64, - #[serde(default = "default_1650")] + #[serde(default = "default_1661")] pub source_trace: String, - #[serde(default = "default_1651")] + #[serde(default = "default_1662")] pub pinned: bool, pub created_at: String, - #[serde(default = "default_1652")] + #[serde(default = "default_1663")] pub expires_at: Option, - #[serde(default = "default_1653")] + #[serde(default = "default_1664")] pub tombstoned_at: Option, - #[serde(default = "default_1654")] + #[serde(default = "default_1665")] pub redacted_at: Option, - #[serde(default = "default_1655")] + #[serde(default = "default_1666")] pub redaction_reason: String, - #[serde(default = "default_1656")] + #[serde(default = "default_1667")] pub content_sha256: String, - #[serde(default = "default_1657")] + #[serde(default = "default_1668")] pub actor: String, - #[serde(default = "default_1658")] + #[serde(default = "default_1669")] pub source_class: String, - #[serde(default = "default_1659")] + #[serde(default = "default_1670")] pub agent: String, - #[serde(default = "default_1660")] + #[serde(default = "default_1671")] pub written_at: Option, - #[serde(default = "default_1661")] + #[serde(default = "default_1672")] pub status: String, - #[serde(default = "default_1662")] + #[serde(default = "default_1673")] pub conflict_with: Vec, - #[serde(default = "default_1663")] + #[serde(default = "default_1674")] pub tags: Vec, - #[serde(default = "default_1664")] + #[serde(default = "default_1675")] pub verified_at: Option, - #[serde(default = "default_1665")] + #[serde(default = "default_1676")] pub verified_by: String, - #[serde(default = "default_1666")] + #[serde(default = "default_1677")] pub verified_sha256: String, - #[serde(default = "default_1667")] + #[serde(default = "default_1678")] pub lock_mode: String, - #[serde(default = "default_1668")] + #[serde(default = "default_1679")] pub lock_reason: String, - #[serde(default = "default_1669")] + #[serde(default = "default_1680")] pub lock_until: Option, } @@ -35246,13 +35389,13 @@ impl MemoryHistoryInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryImportTotals { - #[serde(default = "default_1670")] + #[serde(default = "default_1681")] pub written: Integer, - #[serde(default = "default_1671")] + #[serde(default = "default_1682")] pub held: Integer, - #[serde(default = "default_1672")] + #[serde(default = "default_1683")] pub skipped: Integer, - #[serde(default = "default_1673")] + #[serde(default = "default_1684")] pub refused: Integer, } @@ -35335,11 +35478,11 @@ pub struct MemoryImportResult { pub index: Integer, pub key: String, pub outcome: MemoryImportResultOutcome, - #[serde(default = "default_1674")] + #[serde(default = "default_1685")] pub reason: MemoryImportResultReason, - #[serde(default = "default_1675")] + #[serde(default = "default_1686")] pub held_by: String, - #[serde(default = "default_1676")] + #[serde(default = "default_1687")] pub note: MemoryImportResultNote, } @@ -35348,7 +35491,7 @@ pub struct MemoryImportResult { pub struct MemoryImportOutput { pub totals: MemoryImportTotals, pub results: Vec, - #[serde(default = "default_1677")] + #[serde(default = "default_1688")] pub dry_run: bool, } @@ -35541,9 +35684,9 @@ pub struct MemoryImportCuratedRow { pub section_heading: String, pub bytes_written: Integer, pub verdict: String, - #[serde(default = "default_1678")] + #[serde(default = "default_1689")] pub rejection_reason: String, - #[serde(default = "default_1679")] + #[serde(default = "default_1690")] pub pinned_blocker_id: Option, } @@ -35635,21 +35778,21 @@ impl MemoryImportCuratedInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryImportEvidenceOutput { - #[serde(default = "default_1680")] + #[serde(default = "default_1691")] pub chunks_written: Integer, - #[serde(default = "default_1681")] + #[serde(default = "default_1692")] pub links_written: Integer, - #[serde(default = "default_1682")] + #[serde(default = "default_1693")] pub digests_written: Integer, - #[serde(default = "default_1683")] + #[serde(default = "default_1694")] pub embedding_model: String, - #[serde(default = "default_1684")] + #[serde(default = "default_1695")] pub embedding_dim: Integer, - #[serde(default = "default_1685")] + #[serde(default = "default_1696")] pub edited: Vec, - #[serde(default = "default_1686")] + #[serde(default = "default_1697")] pub skipped: Integer, - #[serde(default = "default_1687")] + #[serde(default = "default_1698")] pub unchecked: Integer, } @@ -35986,7 +36129,7 @@ pub struct InspectRow { pub memory_key: String, pub memory_id: String, pub version: Integer, - #[serde(default = "default_1697")] + #[serde(default = "default_1708")] pub content_sha256: String, pub memory_type: String, pub status: String, @@ -35997,9 +36140,9 @@ pub struct InspectRow { pub actor: String, pub updated_at: String, pub sensitivity: String, - #[serde(default = "default_1698")] + #[serde(default = "default_1709")] pub versions: Integer, - #[serde(default = "default_1699")] + #[serde(default = "default_1710")] pub excerpt: String, } @@ -36007,27 +36150,27 @@ pub struct InspectRow { #[non_exhaustive] pub struct InspectView { pub definition: String, - #[serde(default = "default_1688")] + #[serde(default = "default_1699")] pub refs: Vec, - #[serde(default = "default_1689")] + #[serde(default = "default_1700")] pub live_rows: Integer, - #[serde(default = "default_1690")] + #[serde(default = "default_1701")] pub by_type: Vec, - #[serde(default = "default_1691")] + #[serde(default = "default_1702")] pub by_status: Vec, - #[serde(default = "default_1692")] + #[serde(default = "default_1703")] pub by_source_class: Vec, - #[serde(default = "default_1693")] + #[serde(default = "default_1704")] pub top_tags: Vec, - #[serde(default = "default_1694")] + #[serde(default = "default_1705")] pub categories: Vec, - #[serde(default = "default_1695")] + #[serde(default = "default_1706")] pub first_updated_at: Option, - #[serde(default = "default_1696")] + #[serde(default = "default_1707")] pub last_updated_at: Option, - #[serde(default = "default_1700")] + #[serde(default = "default_1711")] pub newest: Vec, - #[serde(default = "default_1701")] + #[serde(default = "default_1712")] pub complete: bool, } @@ -36043,32 +36186,32 @@ pub struct InspectCall { #[non_exhaustive] pub struct InspectActivity { pub window_seconds: Integer, - #[serde(default = "default_1702")] + #[serde(default = "default_1713")] pub calls: Vec, - #[serde(default = "default_1703")] + #[serde(default = "default_1714")] pub first_at: Option, - #[serde(default = "default_1704")] + #[serde(default = "default_1715")] pub last_at: Option, - #[serde(default = "default_1705")] + #[serde(default = "default_1716")] pub gap: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct InspectSettings { - #[serde(default = "default_1706")] + #[serde(default = "default_1717")] pub guide_revision: Integer, - #[serde(default = "default_1707")] + #[serde(default = "default_1718")] pub guide_summary: String, - #[serde(default = "default_1708")] + #[serde(default = "default_1719")] pub categories_registered: Integer, - #[serde(default = "default_1709")] + #[serde(default = "default_1720")] pub extraction_policy: Option, - #[serde(default = "default_1710")] + #[serde(default = "default_1721")] pub extraction_policy_unavailable: String, - #[serde(default = "default_1711")] + #[serde(default = "default_1722")] pub extraction_instructions: String, - #[serde(default = "default_1712")] + #[serde(default = "default_1723")] pub extraction_instructions_refs: Vec, } @@ -36084,7 +36227,7 @@ pub struct MemoryInspectOutput { pub others: InspectView, pub activity: InspectActivity, pub settings: InspectSettings, - #[serde(default = "default_1713")] + #[serde(default = "default_1724")] pub skipped: Vec, } @@ -36178,7 +36321,7 @@ pub struct MemoryKeyRef { #[non_exhaustive] pub struct MemoryKeysOutput { pub keys: Vec, - #[serde(default = "default_1714")] + #[serde(default = "default_1725")] pub truncated: bool, } @@ -36281,9 +36424,9 @@ pub struct LineageCandidate { pub decided_at: String, pub decided_by: String, pub match_confidence: LineageCandidateMatchConfidence, - #[serde(default = "default_1723")] + #[serde(default = "default_1734")] pub seeded_from_thread_id: String, - #[serde(default = "default_1724")] + #[serde(default = "default_1735")] pub seeded_from_msg_id: String, } @@ -36301,25 +36444,25 @@ pub struct LineageAuditEvent { pub struct MemoryLineageOutput { pub found: bool, pub memory_key: String, - #[serde(default = "default_1715")] + #[serde(default = "default_1726")] pub promotion_event: String, - #[serde(default = "default_1716")] + #[serde(default = "default_1727")] pub promoted_by: String, - #[serde(default = "default_1717")] + #[serde(default = "default_1728")] pub promoted_at: Option, - #[serde(default = "default_1718")] + #[serde(default = "default_1729")] pub rationale: String, - #[serde(default = "default_1719")] + #[serde(default = "default_1730")] pub source_trace: String, - #[serde(default = "default_1720")] + #[serde(default = "default_1731")] pub source_resource_id: String, - #[serde(default = "default_1721")] + #[serde(default = "default_1732")] pub mechanism: MemoryLineageOutputMechanism, - #[serde(default = "default_1722")] + #[serde(default = "default_1733")] pub supporters: Vec, - #[serde(default = "default_1725")] + #[serde(default = "default_1736")] pub candidate: Option, - #[serde(default = "default_1726")] + #[serde(default = "default_1737")] pub audit_chain: Vec, } @@ -36448,11 +36591,11 @@ pub struct MemoryLinkOutput { pub from_key: String, pub to_key: String, pub relation: String, - #[serde(default = "default_1727")] + #[serde(default = "default_1738")] pub confidence: f64, - #[serde(default = "default_1728")] + #[serde(default = "default_1739")] pub conflict_opened: bool, - #[serde(default = "default_1729")] + #[serde(default = "default_1740")] pub relation_defaulted: bool, } @@ -36766,17 +36909,17 @@ pub struct MemoryListEntry { pub struct MemoryListOutput { pub entries: Vec, pub truncated: bool, - #[serde(default = "default_1730")] + #[serde(default = "default_1741")] pub total: Integer, - #[serde(default = "default_1731")] + #[serde(default = "default_1742")] pub today: Integer, - #[serde(default = "default_1732")] + #[serde(default = "default_1743")] pub namespace_version: String, - #[serde(default = "default_1733")] + #[serde(default = "default_1744")] pub unchanged: bool, - #[serde(default = "default_1734")] + #[serde(default = "default_1745")] pub hidden: Integer, - #[serde(default = "default_1735")] + #[serde(default = "default_1746")] pub hidden_hint: String, } @@ -37162,19 +37305,19 @@ impl MemoryListInput { #[non_exhaustive] pub struct MemoryLockOutput { pub locked: bool, - #[serde(default = "default_1736")] + #[serde(default = "default_1747")] pub reason: String, - #[serde(default = "default_1737")] + #[serde(default = "default_1748")] pub memory_id: String, - #[serde(default = "default_1738")] + #[serde(default = "default_1749")] pub version: Option, - #[serde(default = "default_1739")] + #[serde(default = "default_1750")] pub lock_mode: String, - #[serde(default = "default_1740")] + #[serde(default = "default_1751")] pub lock_until: Option, - #[serde(default = "default_1741")] + #[serde(default = "default_1752")] pub locked_by: String, - #[serde(default = "default_1742")] + #[serde(default = "default_1753")] pub previous_mode: String, } @@ -37333,21 +37476,21 @@ pub struct MemoryMoveOutput { pub from_key: String, pub to_key: String, pub redirected: bool, - #[serde(default = "default_1743")] + #[serde(default = "default_1754")] pub memory_id: String, - #[serde(default = "default_1744")] + #[serde(default = "default_1755")] pub version: Integer, - #[serde(default = "default_1745")] + #[serde(default = "default_1756")] pub content_sha256: String, - #[serde(default = "default_1746")] + #[serde(default = "default_1757")] pub advisories: Vec, - #[serde(default = "default_1747")] + #[serde(default = "default_1758")] pub dry_run: bool, - #[serde(default = "default_1748")] + #[serde(default = "default_1759")] pub memory_type: String, - #[serde(default = "default_1749")] + #[serde(default = "default_1760")] pub value_preview: String, - #[serde(default = "default_1750")] + #[serde(default = "default_1761")] pub sensitivity: String, } @@ -37559,7 +37702,7 @@ impl MemoryMoveInput { pub struct MemoryOutcomeOutput { pub recorded: bool, pub evidence_count_after: Integer, - #[serde(default = "default_1751")] + #[serde(default = "default_1762")] pub quarantined: bool, } @@ -37802,13 +37945,13 @@ impl MemoryOutcomeRunInput { #[non_exhaustive] pub struct OutlineSession { pub session_id: String, - #[serde(default = "default_1753")] + #[serde(default = "default_1764")] pub date: String, - #[serde(default = "default_1754")] + #[serde(default = "default_1765")] pub headline: String, - #[serde(default = "default_1755")] + #[serde(default = "default_1766")] pub key_facts: Integer, - #[serde(default = "default_1756")] + #[serde(default = "default_1767")] pub rows: Integer, } @@ -37816,7 +37959,7 @@ pub struct OutlineSession { #[non_exhaustive] pub struct OutlineHub { pub entity: String, - #[serde(default = "default_1759")] + #[serde(default = "default_1770")] pub degree: Integer, } @@ -37824,28 +37967,28 @@ pub struct OutlineHub { #[non_exhaustive] pub struct OutlineCommunity { pub community_id: Integer, - #[serde(default = "default_1761")] + #[serde(default = "default_1772")] pub label: String, - #[serde(default = "default_1762")] + #[serde(default = "default_1773")] pub size: Integer, - #[serde(default = "default_1763")] + #[serde(default = "default_1774")] pub computed_at: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryOutlineOutput { - #[serde(default = "default_1752")] + #[serde(default = "default_1763")] pub rows_by_type: std::collections::HashMap, - #[serde(default = "default_1757")] + #[serde(default = "default_1768")] pub sessions: Vec, - #[serde(default = "default_1758")] + #[serde(default = "default_1769")] pub sessions_total: Integer, - #[serde(default = "default_1760")] + #[serde(default = "default_1771")] pub hubs: Vec, - #[serde(default = "default_1764")] + #[serde(default = "default_1775")] pub communities: Vec, - #[serde(default = "default_1765")] + #[serde(default = "default_1776")] pub profile_chars: Integer, } @@ -37997,7 +38140,7 @@ pub struct OwnerUsageRow { pub recalls: Integer, pub used: Integer, pub harm: Integer, - #[serde(default = "default_1766")] + #[serde(default = "default_1777")] pub last_recalled: Option, } @@ -38484,7 +38627,7 @@ pub struct MemoryPromoteOutput { pub shared_memory_key: String, pub promotion_event: String, pub reversible_until: String, - #[serde(default = "default_1767")] + #[serde(default = "default_1778")] pub ignored_args: Vec, } @@ -38653,18 +38796,18 @@ impl MemoryPromoteInput { pub struct MemoryProposalDecision { pub memory_key: String, pub decided: bool, - #[serde(default = "default_1769")] + #[serde(default = "default_1780")] pub status: String, - #[serde(default = "default_1770")] + #[serde(default = "default_1781")] pub reason: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryProposalDecideOutput { - #[serde(default = "default_1768")] + #[serde(default = "default_1779")] pub decided: Integer, - #[serde(default = "default_1771")] + #[serde(default = "default_1782")] pub results: Vec, } @@ -38765,33 +38908,33 @@ pub enum MemoryProposalReady { pub struct MemoryProposal { pub memory_key: String, pub memory_id: String, - #[serde(default = "default_1772")] + #[serde(default = "default_1783")] pub content_sha256: String, - #[serde(default = "default_1773")] + #[serde(default = "default_1784")] pub agent: String, - #[serde(default = "default_1774")] + #[serde(default = "default_1785")] pub memory_type: String, - #[serde(default = "default_1775")] + #[serde(default = "default_1786")] pub value_preview: String, - #[serde(default = "default_1776")] + #[serde(default = "default_1787")] pub sensitivity: String, - #[serde(default = "default_1777")] + #[serde(default = "default_1788")] pub tags: Vec, - #[serde(default = "default_1778")] + #[serde(default = "default_1789")] pub created_at: String, - #[serde(default = "default_1779")] + #[serde(default = "default_1790")] pub graded_passes: Integer, - #[serde(default = "default_1780")] + #[serde(default = "default_1791")] pub graded_fails: Integer, - #[serde(default = "default_1781")] + #[serde(default = "default_1792")] pub last_graded_at: String, - #[serde(default = "default_1782")] + #[serde(default = "default_1793")] pub used_count: Integer, - #[serde(default = "default_1783")] + #[serde(default = "default_1794")] pub harm_count: Integer, - #[serde(default = "default_1784")] + #[serde(default = "default_1795")] pub ready: MemoryProposalReady, - #[serde(default = "default_1785")] + #[serde(default = "default_1796")] pub conflict_with: Vec, } @@ -38807,24 +38950,24 @@ pub enum ProposalPolicyMode { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProposalPolicy { - #[serde(default = "default_1788")] + #[serde(default = "default_1799")] pub mode: ProposalPolicyMode, - #[serde(default = "default_1789")] + #[serde(default = "default_1800")] pub min_passes: Integer, - #[serde(default = "default_1790")] + #[serde(default = "default_1801")] pub max_fails: Integer, - #[serde(default = "default_1791")] + #[serde(default = "default_1802")] pub reject_after_fails: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryProposalsOutput { - #[serde(default = "default_1786")] + #[serde(default = "default_1797")] pub proposals: Vec, - #[serde(default = "default_1787")] + #[serde(default = "default_1798")] pub total: Integer, - #[serde(default = "default_1792")] + #[serde(default = "default_1803")] pub policy: ProposalPolicy, } @@ -38942,19 +39085,19 @@ impl MemoryProposalsInput { pub struct MemoryProvenanceLink { pub direction: String, pub memory_key: String, - #[serde(default = "default_1806")] + #[serde(default = "default_1817")] pub relation: String, - #[serde(default = "default_1807")] + #[serde(default = "default_1818")] pub label: String, - #[serde(default = "default_1808")] + #[serde(default = "default_1819")] pub explanation: String, - #[serde(default = "default_1809")] + #[serde(default = "default_1820")] pub evidence: Vec, - #[serde(default = "default_1810")] + #[serde(default = "default_1821")] pub confidence: f64, - #[serde(default = "default_1811")] + #[serde(default = "default_1822")] pub author: String, - #[serde(default = "default_1812")] + #[serde(default = "default_1823")] pub run_id: String, } @@ -38962,33 +39105,33 @@ pub struct MemoryProvenanceLink { #[non_exhaustive] pub struct MemoryProvenanceOutput { pub found: bool, - #[serde(default = "default_1793")] + #[serde(default = "default_1804")] pub source_trace: String, - #[serde(default = "default_1794")] + #[serde(default = "default_1805")] pub source_kind: String, - #[serde(default = "default_1795")] + #[serde(default = "default_1806")] pub actor: String, - #[serde(default = "default_1796")] + #[serde(default = "default_1807")] pub source_class: String, - #[serde(default = "default_1797")] + #[serde(default = "default_1808")] pub source_label: String, - #[serde(default = "default_1798")] + #[serde(default = "default_1809")] pub thread_id: String, - #[serde(default = "default_1799")] + #[serde(default = "default_1810")] pub thread_exists: bool, - #[serde(default = "default_1800")] + #[serde(default = "default_1811")] pub thread_title: String, - #[serde(default = "default_1801")] + #[serde(default = "default_1812")] pub agent: String, - #[serde(default = "default_1802")] + #[serde(default = "default_1813")] pub session_id: String, - #[serde(default = "default_1803")] + #[serde(default = "default_1814")] pub run_id: String, - #[serde(default = "default_1804")] + #[serde(default = "default_1815")] pub written_at: String, - #[serde(default = "default_1805")] + #[serde(default = "default_1816")] pub source_resource_id: String, - #[serde(default = "default_1813")] + #[serde(default = "default_1824")] pub links: Vec, } @@ -39083,17 +39226,17 @@ impl MemoryProvenanceInput { pub struct RecallTurn { pub evidence_id: String, pub session_id: String, - #[serde(default = "default_1814")] + #[serde(default = "default_1825")] pub role: String, - #[serde(default = "default_1815")] + #[serde(default = "default_1826")] pub actor: String, - #[serde(default = "default_1816")] + #[serde(default = "default_1827")] pub observed_at: String, - #[serde(default = "default_1817")] + #[serde(default = "default_1828")] pub content: String, - #[serde(default = "default_1818")] + #[serde(default = "default_1829")] pub truncated: bool, - #[serde(default = "default_1819")] + #[serde(default = "default_1830")] pub matched_tokens: Integer, } @@ -39110,21 +39253,21 @@ pub enum MemoryRecallOutputOrder { #[non_exhaustive] pub struct MemoryRecallOutput { pub turns: Vec, - #[serde(default = "default_1820")] + #[serde(default = "default_1831")] pub total_matched: Integer, - #[serde(default = "default_1821")] + #[serde(default = "default_1832")] pub returned: Integer, - #[serde(default = "default_1822")] + #[serde(default = "default_1833")] pub has_more: bool, - #[serde(default = "default_1823")] + #[serde(default = "default_1834")] pub next_cursor: String, - #[serde(default = "default_1824")] + #[serde(default = "default_1835")] pub next_offset: Integer, - #[serde(default = "default_1825")] + #[serde(default = "default_1836")] pub order: MemoryRecallOutputOrder, - #[serde(default = "default_1826")] + #[serde(default = "default_1837")] pub query_tokens: Vec, - #[serde(default = "default_1827")] + #[serde(default = "default_1838")] pub tokens_returned: Integer, } @@ -39406,19 +39549,19 @@ pub struct MemoryRecordConflictRow { pub schema_name: String, pub memory_key: String, pub field_name: String, - #[serde(default = "default_1828")] + #[serde(default = "default_1839")] pub prior_value: Value, - #[serde(default = "default_1829")] + #[serde(default = "default_1840")] pub incoming_value: Value, pub prior_record_id: String, pub incoming_record_id: String, - #[serde(default = "default_1830")] + #[serde(default = "default_1841")] pub prior_memory_id: String, - #[serde(default = "default_1831")] + #[serde(default = "default_1842")] pub incoming_memory_id: String, - #[serde(default = "default_1832")] + #[serde(default = "default_1843")] pub detected_at: Option, - #[serde(default = "default_1833")] + #[serde(default = "default_1844")] pub resolved_at: Option, } @@ -39426,7 +39569,7 @@ pub struct MemoryRecordConflictRow { #[non_exhaustive] pub struct MemoryRecordConflictsOutput { pub rows: Vec, - #[serde(default = "default_1834")] + #[serde(default = "default_1845")] pub truncated: bool, } @@ -39536,19 +39679,19 @@ pub enum MemoryRecordRowStatus { #[non_exhaustive] pub struct MemoryRecordRow { pub record_id: String, - #[serde(default = "default_1835")] + #[serde(default = "default_1846")] pub memory_key: String, - #[serde(default = "default_1836")] + #[serde(default = "default_1847")] pub memory_id: String, - #[serde(default = "default_1837")] + #[serde(default = "default_1848")] pub record: std::collections::HashMap, - #[serde(default = "default_1838")] + #[serde(default = "default_1849")] pub field_states: std::collections::HashMap, - #[serde(default = "default_1839")] + #[serde(default = "default_1850")] pub status: MemoryRecordRowStatus, - #[serde(default = "default_1840")] + #[serde(default = "default_1851")] pub valid_at: Option, - #[serde(default = "default_1841")] + #[serde(default = "default_1852")] pub valid_to: Option, } @@ -39615,7 +39758,7 @@ impl MemoryRecordHistoryInput { #[non_exhaustive] pub struct MemoryRecordQueryOutput { pub rows: Vec, - #[serde(default = "default_1842")] + #[serde(default = "default_1853")] pub truncated: bool, } @@ -39839,15 +39982,15 @@ pub enum MemoryRecordWriteOutputKeySource { pub struct MemoryRecordWriteOutput { pub record_id: String, pub field_count: Integer, - #[serde(default = "default_1843")] + #[serde(default = "default_1854")] pub memory_key: String, - #[serde(default = "default_1844")] + #[serde(default = "default_1855")] pub key_source: MemoryRecordWriteOutputKeySource, - #[serde(default = "default_1845")] + #[serde(default = "default_1856")] pub fold: std::collections::HashMap, - #[serde(default = "default_1846")] + #[serde(default = "default_1857")] pub superseded_record_id: String, - #[serde(default = "default_1847")] + #[serde(default = "default_1858")] pub conflicts: Integer, } @@ -40090,13 +40233,13 @@ impl MemoryRecordWriteInput { #[non_exhaustive] pub struct MemoryRedactOutput { pub redacted: bool, - #[serde(default = "default_1848")] + #[serde(default = "default_1859")] pub refused_head: bool, - #[serde(default = "default_1849")] + #[serde(default = "default_1860")] pub redacted_at: Option, - #[serde(default = "default_1850")] + #[serde(default = "default_1861")] pub cache_rows_deleted: Integer, - #[serde(default = "default_1851")] + #[serde(default = "default_1862")] pub precedent_rows_deleted: Integer, } @@ -40256,7 +40399,7 @@ impl MemoryReindexInput { #[non_exhaustive] pub struct MemoryRejectOutput { pub rejected: bool, - #[serde(default = "default_1852")] + #[serde(default = "default_1863")] pub rejected_at: Option, } @@ -40372,7 +40515,7 @@ pub struct MemoryRelatedHit { pub struct MemoryRelatedOutput { pub results: Vec, pub source_entities: Vec, - #[serde(default = "default_1853")] + #[serde(default = "default_1864")] pub reason: String, } @@ -40487,13 +40630,13 @@ impl MemoryRelatedInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryResolveOrphanDuplicatesOutput { - #[serde(default = "default_1854")] + #[serde(default = "default_1865")] pub candidates: Integer, - #[serde(default = "default_1855")] + #[serde(default = "default_1866")] pub reactivated: Integer, - #[serde(default = "default_1856")] + #[serde(default = "default_1867")] pub dry_run: bool, - #[serde(default = "default_1857")] + #[serde(default = "default_1868")] pub memory_ids: Vec, } @@ -40570,15 +40713,15 @@ impl MemoryResolveOrphanDuplicatesInput { #[non_exhaustive] pub struct MemoryRestoreOutput { pub restored: bool, - #[serde(default = "default_1858")] + #[serde(default = "default_1869")] pub memory_id: Option, - #[serde(default = "default_1859")] + #[serde(default = "default_1870")] pub version: Option, - #[serde(default = "default_1860")] + #[serde(default = "default_1871")] pub expired: bool, - #[serde(default = "default_1861")] + #[serde(default = "default_1872")] pub redacted: bool, - #[serde(default = "default_1862")] + #[serde(default = "default_1873")] pub from_status: String, } @@ -40698,13 +40841,13 @@ pub struct SearchTraceHit { pub content_excerpt: String, pub distance: f64, pub similarity: f64, - #[serde(default = "default_1863")] + #[serde(default = "default_1874")] pub entity_boost: f64, pub rank_score: f64, pub rank: Integer, - #[serde(default = "default_1864")] + #[serde(default = "default_1875")] pub source: String, - #[serde(default = "default_1865")] + #[serde(default = "default_1876")] pub parent_memory_key: String, } @@ -40714,11 +40857,11 @@ pub struct MemorySearchTraceOutput { pub results: Vec, pub embedding_model: String, pub entity_filter: Vec, - #[serde(default = "default_1866")] + #[serde(default = "default_1877")] pub query_spellings: std::collections::HashMap, - #[serde(default = "default_1867")] + #[serde(default = "default_1878")] pub query_spellings_skipped: bool, - #[serde(default = "default_1868")] + #[serde(default = "default_1879")] pub stale_dropped: Integer, } @@ -41899,7 +42042,7 @@ pub struct SearchTraceLogRow { pub embedding_model: String, pub latency_ms: Integer, pub run_id: String, - #[serde(default = "default_1869")] + #[serde(default = "default_1880")] pub operation: String, } @@ -42008,71 +42151,71 @@ pub struct RefusedFact { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemorySetFromMessagesOutput { - #[serde(default = "default_1870")] + #[serde(default = "default_1881")] pub written: Vec, - #[serde(default = "default_1871")] + #[serde(default = "default_1882")] pub refused: Vec, - #[serde(default = "default_1872")] + #[serde(default = "default_1883")] pub tokens_in: Integer, - #[serde(default = "default_1873")] + #[serde(default = "default_1884")] pub tokens_out: Integer, - #[serde(default = "default_1874")] + #[serde(default = "default_1885")] pub llm_provider: String, - #[serde(default = "default_1875")] + #[serde(default = "default_1886")] pub llm_model: String, - #[serde(default = "default_1876")] + #[serde(default = "default_1887")] pub segments: Integer, - #[serde(default = "default_1877")] + #[serde(default = "default_1888")] pub foresight: Integer, - #[serde(default = "default_1878")] + #[serde(default = "default_1889")] pub forgotten: Integer, - #[serde(default = "default_1879")] + #[serde(default = "default_1890")] pub forgotten_keys: Vec, - #[serde(default = "default_1880")] + #[serde(default = "default_1891")] pub forget_requests: Integer, - #[serde(default = "default_1881")] + #[serde(default = "default_1892")] pub about_other: Integer, - #[serde(default = "default_1882")] + #[serde(default = "default_1893")] pub premise_facts: Integer, - #[serde(default = "default_1883")] + #[serde(default = "default_1894")] pub learning_candidates: Integer, - #[serde(default = "default_1884")] + #[serde(default = "default_1895")] pub ignored_args: Vec, - #[serde(default = "default_1885")] + #[serde(default = "default_1896")] pub segmenter: String, - #[serde(default = "default_1886")] + #[serde(default = "default_1897")] pub cached_tokens_in: Integer, - #[serde(default = "default_1887")] + #[serde(default = "default_1898")] pub ontology_warnings: Vec, - #[serde(default = "default_1888")] + #[serde(default = "default_1899")] pub evidence_ids: Vec, - #[serde(default = "default_1889")] + #[serde(default = "default_1900")] pub belief_source_links: Integer, - #[serde(default = "default_1890")] + #[serde(default = "default_1901")] pub pipeline_errors: Vec, - #[serde(default = "default_1891")] + #[serde(default = "default_1902")] pub value_updates_linked: Integer, - #[serde(default = "default_1892")] + #[serde(default = "default_1903")] pub stubbed_fields: Vec, - #[serde(default = "default_1893")] + #[serde(default = "default_1904")] pub degraded: Vec, - #[serde(default = "default_1894")] + #[serde(default = "default_1905")] pub deferred: bool, - #[serde(default = "default_1895")] + #[serde(default = "default_1906")] pub queue_id: String, - #[serde(default = "default_1896")] + #[serde(default = "default_1907")] pub deferred_by: String, - #[serde(default = "default_1897")] + #[serde(default = "default_1908")] pub stage_ms: std::collections::HashMap, - #[serde(default = "default_1898")] + #[serde(default = "default_1909")] pub observation_date_source: String, - #[serde(default = "default_1899")] + #[serde(default = "default_1910")] pub under_operator_policy: bool, - #[serde(default = "default_1900")] + #[serde(default = "default_1911")] pub extract_prompt_keys: Vec, - #[serde(default = "default_1901")] + #[serde(default = "default_1912")] pub llm_cache_hits: Integer, - #[serde(default = "default_1902")] + #[serde(default = "default_1913")] pub llm_cache_misses: Integer, } @@ -42527,22 +42670,22 @@ pub enum StackEntrySection { #[non_exhaustive] pub struct StackEntry { pub section: StackEntrySection, - #[serde(default = "default_1903")] + #[serde(default = "default_1914")] pub memory_key: String, - #[serde(default = "default_1904")] + #[serde(default = "default_1915")] pub memory_type: String, - #[serde(default = "default_1905")] + #[serde(default = "default_1916")] pub value: String, pub tokens: Integer, - #[serde(default = "default_1906")] + #[serde(default = "default_1917")] pub pinned: bool, - #[serde(default = "default_1907")] + #[serde(default = "default_1918")] pub recall_count: Integer, - #[serde(default = "default_1908")] + #[serde(default = "default_1919")] pub last_recalled_at: Option, - #[serde(default = "default_1909")] + #[serde(default = "default_1920")] pub actor: String, - #[serde(default = "default_1910")] + #[serde(default = "default_1921")] pub namespace: String, } @@ -42727,14 +42870,14 @@ impl MemoryStackInput { pub struct MemoryStatus { pub memory_id: String, pub status: String, - #[serde(default = "default_1911")] + #[serde(default = "default_1922")] pub superseded_by: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryStatusesOutput { - #[serde(default = "default_1912")] + #[serde(default = "default_1923")] pub rows: Vec, } @@ -42783,23 +42926,23 @@ impl MemoryStatusesInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemorySweepExpiredOutput { - #[serde(default = "default_1913")] + #[serde(default = "default_1924")] pub scanned: Integer, - #[serde(default = "default_1914")] + #[serde(default = "default_1925")] pub tombstoned: Integer, - #[serde(default = "default_1915")] + #[serde(default = "default_1926")] pub demoted: Integer, - #[serde(default = "default_1916")] + #[serde(default = "default_1927")] pub anonymized: Integer, - #[serde(default = "default_1917")] + #[serde(default = "default_1928")] pub locked_skipped: Integer, - #[serde(default = "default_1918")] + #[serde(default = "default_1929")] pub moved_skipped: Integer, - #[serde(default = "default_1919")] + #[serde(default = "default_1930")] pub dry_run: bool, - #[serde(default = "default_1920")] + #[serde(default = "default_1931")] pub sample: Vec>, - #[serde(default = "default_1921")] + #[serde(default = "default_1932")] pub failures: Vec, } @@ -42876,10 +43019,10 @@ pub struct MemoryTimelineEntry { pub memory_key: String, pub memory_type: String, pub content_excerpt: String, - #[serde(default = "default_1922")] + #[serde(default = "default_1933")] pub valid_at: Option, pub created_at: String, - #[serde(default = "default_1923")] + #[serde(default = "default_1934")] pub namespace: String, } @@ -42887,7 +43030,7 @@ pub struct MemoryTimelineEntry { #[non_exhaustive] pub struct MemoryTimelineOutput { pub events: Vec, - #[serde(default = "default_1924")] + #[serde(default = "default_1935")] pub total_matching: Integer, } @@ -43079,9 +43222,9 @@ impl MemoryTimelineInput { pub struct MemoryTouchResult { pub memory_key: String, pub touched: bool, - #[serde(default = "default_1927")] + #[serde(default = "default_1938")] pub version: Option, - #[serde(default = "default_1928")] + #[serde(default = "default_1939")] pub expires_at: Option, } @@ -43089,13 +43232,13 @@ pub struct MemoryTouchResult { #[non_exhaustive] pub struct MemoryTouchOutput { pub touched: bool, - #[serde(default = "default_1925")] + #[serde(default = "default_1936")] pub version: Option, - #[serde(default = "default_1926")] + #[serde(default = "default_1937")] pub expires_at: Option, - #[serde(default = "default_1929")] + #[serde(default = "default_1940")] pub results: Vec, - #[serde(default = "default_1930")] + #[serde(default = "default_1941")] pub touched_count: Integer, } @@ -43275,15 +43418,15 @@ impl MemoryTouchInput { #[non_exhaustive] pub struct MemoryUnlockOutput { pub unlocked: bool, - #[serde(default = "default_1931")] + #[serde(default = "default_1942")] pub reason: String, - #[serde(default = "default_1932")] + #[serde(default = "default_1943")] pub memory_id: String, - #[serde(default = "default_1933")] + #[serde(default = "default_1944")] pub version: Option, - #[serde(default = "default_1934")] + #[serde(default = "default_1945")] pub previous_mode: String, - #[serde(default = "default_1935")] + #[serde(default = "default_1946")] pub unlocked_by: String, } @@ -43388,11 +43531,11 @@ impl MemoryUnlockInput { #[non_exhaustive] pub struct MemoryUnpinOutput { pub unpinned: bool, - #[serde(default = "default_1936")] + #[serde(default = "default_1947")] pub reason: String, - #[serde(default = "default_1937")] + #[serde(default = "default_1948")] pub memory_id: String, - #[serde(default = "default_1938")] + #[serde(default = "default_1949")] pub version: Option, } @@ -43486,15 +43629,15 @@ impl MemoryUnpinInput { #[non_exhaustive] pub struct MemoryUpdateCandidate { pub memory_id: String, - #[serde(default = "default_1944")] + #[serde(default = "default_1955")] pub agent: String, - #[serde(default = "default_1945")] + #[serde(default = "default_1956")] pub user_id: String, - #[serde(default = "default_1946")] + #[serde(default = "default_1957")] pub session_id: String, - #[serde(default = "default_1947")] + #[serde(default = "default_1958")] pub version: Integer, - #[serde(default = "default_1948")] + #[serde(default = "default_1959")] pub status: String, } @@ -43502,23 +43645,23 @@ pub struct MemoryUpdateCandidate { #[non_exhaustive] pub struct MemoryUpdateOutput { pub updated: bool, - #[serde(default = "default_1939")] + #[serde(default = "default_1950")] pub memory_id: String, - #[serde(default = "default_1940")] + #[serde(default = "default_1951")] pub memory_key: String, - #[serde(default = "default_1941")] + #[serde(default = "default_1952")] pub new_version: Integer, - #[serde(default = "default_1942")] + #[serde(default = "default_1953")] pub content_sha256: String, - #[serde(default = "default_1943")] + #[serde(default = "default_1954")] pub reason: String, - #[serde(default = "default_1949")] + #[serde(default = "default_1960")] pub candidates: Vec, - #[serde(default = "default_1950")] + #[serde(default = "default_1961")] pub conflict_verdict: String, - #[serde(default = "default_1951")] + #[serde(default = "default_1962")] pub conflict_peers: Integer, - #[serde(default = "default_1952")] + #[serde(default = "default_1963")] pub duplicate_of: String, } @@ -43727,15 +43870,15 @@ impl MemoryUpdateInput { #[non_exhaustive] pub struct MemoryUpdateByIdOutput { pub updated: bool, - #[serde(default = "default_1953")] + #[serde(default = "default_1964")] pub new_version: Integer, - #[serde(default = "default_1954")] + #[serde(default = "default_1965")] pub content_sha256: String, - #[serde(default = "default_1955")] + #[serde(default = "default_1966")] pub conflict_verdict: String, - #[serde(default = "default_1956")] + #[serde(default = "default_1967")] pub conflict_peers: Integer, - #[serde(default = "default_1957")] + #[serde(default = "default_1968")] pub duplicate_of: String, } @@ -43863,23 +44006,23 @@ impl MemoryUpdateByIdInput { #[non_exhaustive] pub struct MemoryVerifyOutput { pub found: bool, - #[serde(default = "default_1958")] + #[serde(default = "default_1969")] pub changed: bool, - #[serde(default = "default_1959")] + #[serde(default = "default_1970")] pub memory_id: String, - #[serde(default = "default_1960")] + #[serde(default = "default_1971")] pub memory_key: String, - #[serde(default = "default_1961")] + #[serde(default = "default_1972")] pub namespace: String, - #[serde(default = "default_1962")] + #[serde(default = "default_1973")] pub verified_by: String, - #[serde(default = "default_1963")] + #[serde(default = "default_1974")] pub verified_at: Option, - #[serde(default = "default_1964")] + #[serde(default = "default_1975")] pub verification: String, - #[serde(default = "default_1965")] + #[serde(default = "default_1976")] pub version: Integer, - #[serde(default = "default_1966")] + #[serde(default = "default_1977")] pub content_sha256: String, } @@ -44084,13 +44227,13 @@ pub struct SchemaFieldOutput { #[serde(rename = "type")] pub r#type: String, pub required: bool, - #[serde(default = "default_1969")] + #[serde(default = "default_1980")] pub identity: bool, - #[serde(default = "default_1970")] + #[serde(default = "default_1981")] pub enum_values: Vec, - #[serde(default = "default_1971")] + #[serde(default = "default_1982")] pub constraints: std::collections::HashMap, - #[serde(default = "default_1972")] + #[serde(default = "default_1983")] pub description: String, } @@ -44099,11 +44242,11 @@ pub struct SchemaFieldOutput { pub struct MemorySchemaSummary { pub schema_id: String, pub name: String, - #[serde(default = "default_1967")] + #[serde(default = "default_1978")] pub description: String, - #[serde(default = "default_1968")] + #[serde(default = "default_1979")] pub status: String, - #[serde(default = "default_1973")] + #[serde(default = "default_1984")] pub fields: Vec, } @@ -44518,13 +44661,13 @@ impl MemorySchemaRegisterInput { #[non_exhaustive] pub struct MentorPlane { pub plane: String, - #[serde(default = "default_1975")] + #[serde(default = "default_1986")] pub calls: Integer, - #[serde(default = "default_1976")] + #[serde(default = "default_1987")] pub available: Option, - #[serde(default = "default_1977")] + #[serde(default = "default_1988")] pub when: String, - #[serde(default = "default_1978")] + #[serde(default = "default_1989")] pub mentored: bool, } @@ -44534,11 +44677,11 @@ pub struct MentorHint { pub code: String, pub severity: String, pub text: String, - #[serde(default = "default_1980")] + #[serde(default = "default_1992")] pub ops: Vec, - #[serde(default = "default_1981")] + #[serde(default = "default_1993")] pub evidence: std::collections::HashMap, - #[serde(default = "default_1982")] + #[serde(default = "default_1994")] pub plane: Option, } @@ -44546,9 +44689,9 @@ pub struct MentorHint { #[non_exhaustive] pub struct MentorAdoption { pub code: String, - #[serde(default = "default_1984")] + #[serde(default = "default_1996")] pub shown_sessions: Integer, - #[serde(default = "default_1985")] + #[serde(default = "default_1997")] pub followed_sessions: Integer, } @@ -44584,7 +44727,7 @@ pub enum UsageRungSource { #[non_exhaustive] pub struct UsageRung { pub rung: UsageRungRung, - #[serde(default = "default_1987")] + #[serde(default = "default_1999")] pub count: Option, pub source: UsageRungSource, pub meaning: String, @@ -44599,27 +44742,30 @@ pub struct MentorBriefOutput { pub window_seconds: Integer, pub computed_at: String, pub sessions: Integer, - #[serde(default = "default_1974")] + #[serde(default = "default_1985")] pub usage: std::collections::HashMap, - #[serde(default = "default_1979")] + #[serde(default = "default_1990")] pub planes: Vec, - #[serde(default = "default_1983")] + #[serde(default = "default_1991")] + pub conflict_backlog: + std::collections::HashMap>, + #[serde(default = "default_1995")] pub hints: Vec, - #[serde(default = "default_1986")] + #[serde(default = "default_1998")] pub adoption: Vec, - #[serde(default = "default_1988")] + #[serde(default = "default_2000")] pub usage_evidence: Vec, - #[serde(default = "default_1989")] + #[serde(default = "default_2001")] pub ledger_from: Option, - #[serde(default = "default_1990")] + #[serde(default = "default_2002")] pub ledger_retention_days: Option, - #[serde(default = "default_1991")] + #[serde(default = "default_2003")] pub agents: Vec, - #[serde(default = "default_1992")] + #[serde(default = "default_2004")] pub agent_defaulted: bool, - #[serde(default = "default_1993")] + #[serde(default = "default_2005")] pub skipped: Vec, - #[serde(default = "default_1994")] + #[serde(default = "default_2006")] pub healthy: bool, } @@ -44768,33 +44914,33 @@ impl MentorGuideInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct NamespaceAuditSummary { - #[serde(default = "default_1995")] + #[serde(default = "default_2007")] pub live_rows: Integer, - #[serde(default = "default_1996")] + #[serde(default = "default_2008")] pub live_bytes: Integer, - #[serde(default = "default_1997")] + #[serde(default = "default_2009")] pub excerpt_bytes: Integer, - #[serde(default = "default_1998")] + #[serde(default = "default_2010")] pub version_rows: Integer, - #[serde(default = "default_1999")] + #[serde(default = "default_2011")] pub version_bytes: Integer, - #[serde(default = "default_2000")] + #[serde(default = "default_2012")] pub unembedded_rows: Integer, - #[serde(default = "default_2001")] + #[serde(default = "default_2013")] pub gets: Integer, - #[serde(default = "default_2002")] + #[serde(default = "default_2014")] pub searches: Integer, - #[serde(default = "default_2003")] + #[serde(default = "default_2015")] pub sets: Integer, - #[serde(default = "default_2004")] + #[serde(default = "default_2016")] pub get_search_ratio: f64, - #[serde(default = "default_2005")] + #[serde(default = "default_2017")] pub inspector_calls: Integer, - #[serde(default = "default_2006")] + #[serde(default = "default_2018")] pub typed_gets: Integer, - #[serde(default = "default_2007")] + #[serde(default = "default_2019")] pub written_in_window: Integer, - #[serde(default = "default_2008")] + #[serde(default = "default_2020")] pub ledger_calls: Integer, } @@ -44826,25 +44972,25 @@ pub struct NamespaceAuditFinding { pub kind: NamespaceAuditFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_2009")] + #[serde(default = "default_2021")] pub window_seconds: Option, - #[serde(default = "default_2010")] + #[serde(default = "default_2022")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_2011")] + #[serde(default = "default_2023")] pub evidence: Vec, - #[serde(default = "default_2012")] + #[serde(default = "default_2024")] pub exceptions: String, - #[serde(default = "default_2013")] + #[serde(default = "default_2025")] pub uncertainty: String, pub code: String, pub severity: NamespaceAuditFindingSeverity, pub count: Integer, pub share: f64, - #[serde(default = "default_2014")] + #[serde(default = "default_2026")] pub bytes: Integer, - #[serde(default = "default_2015")] + #[serde(default = "default_2027")] pub samples: Vec>, pub detail: String, pub remedy: String, @@ -44859,7 +45005,7 @@ pub struct NamespaceAuditOutput { pub window_seconds: Integer, pub summary: NamespaceAuditSummary, pub findings: Vec, - #[serde(default = "default_2016")] + #[serde(default = "default_2028")] pub skipped: Vec, pub coverage: ReportCoverage, pub healthy: bool, @@ -44950,29 +45096,29 @@ pub enum BrowseEntryMyStatus { #[non_exhaustive] pub struct BrowseEntry { pub namespace: String, - #[serde(default = "default_2017")] + #[serde(default = "default_2029")] pub kind: String, pub description: String, pub owner_email: String, pub member_count: Integer, - #[serde(default = "default_2018")] + #[serde(default = "default_2030")] pub requires_approval: bool, pub created_at: String, - #[serde(default = "default_2019")] + #[serde(default = "default_2031")] pub join_policy: String, - #[serde(default = "default_2020")] + #[serde(default = "default_2032")] pub visibility: String, - #[serde(default = "default_2021")] + #[serde(default = "default_2033")] pub my_status: BrowseEntryMyStatus, - #[serde(default = "default_2022")] + #[serde(default = "default_2034")] pub my_role: String, - #[serde(default = "default_2023")] + #[serde(default = "default_2035")] pub repo: String, - #[serde(default = "default_2024")] + #[serde(default = "default_2036")] pub branch: String, - #[serde(default = "default_2025")] + #[serde(default = "default_2037")] pub guide_revision: Integer, - #[serde(default = "default_2026")] + #[serde(default = "default_2038")] pub guide_summary: String, } @@ -45076,9 +45222,9 @@ pub enum NamespaceCancelRequestOutputClearedRole { pub struct NamespaceCancelRequestOutput { pub cancelled: bool, pub namespace: String, - #[serde(default = "default_2027")] + #[serde(default = "default_2039")] pub cleared_role: Option, - #[serde(default = "default_2028")] + #[serde(default = "default_2040")] pub cancelled_at: Option, } @@ -45150,7 +45296,7 @@ pub struct NamespaceDeleteOutput { pub deleted: bool, pub namespace: String, pub updated_at: String, - #[serde(default = "default_2029")] + #[serde(default = "default_2041")] pub sources_retired: Vec, } @@ -45219,67 +45365,71 @@ pub enum NamespaceGetOutputClassification { pub struct NamespaceGetOutput { pub found: bool, pub namespace: String, - #[serde(default = "default_2030")] + #[serde(default = "default_2042")] pub kind: Option, - #[serde(default = "default_2031")] + #[serde(default = "default_2043")] pub owner_email: Option, - #[serde(default = "default_2032")] + #[serde(default = "default_2044")] pub description: Option, - #[serde(default = "default_2033")] + #[serde(default = "default_2045")] pub tags: Option>, - #[serde(default = "default_2034")] + #[serde(default = "default_2046")] pub active: Option, - #[serde(default = "default_2035")] + #[serde(default = "default_2047")] pub conversation_logging_enabled: Option, - #[serde(default = "default_2036")] + #[serde(default = "default_2048")] pub capture_generation_io: Option, - #[serde(default = "default_2037")] + #[serde(default = "default_2049")] pub coverage_sweep: Option, - #[serde(default = "default_2038")] + #[serde(default = "default_2050")] pub consolidation_enabled: Option, - #[serde(default = "default_2039")] + #[serde(default = "default_2051")] pub daily_cost_cap_usd: Option, - #[serde(default = "default_2040")] + #[serde(default = "default_2052")] pub daily_user_cost_cap_usd: Option, - #[serde(default = "default_2041")] + #[serde(default = "default_2053")] pub budget_alert_inbox: Option, - #[serde(default = "default_2042")] + #[serde(default = "default_2054")] pub conflict_threshold: Option, - #[serde(default = "default_2043")] + #[serde(default = "default_2055")] pub retention_days: Option, - #[serde(default = "default_2044")] + #[serde(default = "default_2056")] pub warm_days: Option, - #[serde(default = "default_2045")] + #[serde(default = "default_2057")] pub visibility: Option, - #[serde(default = "default_2046")] + #[serde(default = "default_2058")] pub requires_approval: Option, - #[serde(default = "default_2047")] + #[serde(default = "default_2059")] pub join_policy: Option, - #[serde(default = "default_2048")] + #[serde(default = "default_2060")] pub effective_join_policy: Option, - #[serde(default = "default_2049")] + #[serde(default = "default_2061")] pub retrieval_defaults: Option>, - #[serde(default = "default_2050")] + #[serde(default = "default_2062")] pub rerank_endpoint: Option, - #[serde(default = "default_2051")] + #[serde(default = "default_2063")] pub classify_endpoint: Option, - #[serde(default = "default_2052")] + #[serde(default = "default_2064")] pub default_conflict_policy: Option, - #[serde(default = "default_2053")] + #[serde(default = "default_2065")] + pub captured_conflict_policy: String, + #[serde(default = "default_2066")] + pub captured_conflict_confidence: f64, + #[serde(default = "default_2067")] pub proposal_policy: Option, - #[serde(default = "default_2054")] + #[serde(default = "default_2068")] pub code_change_policy: Option, - #[serde(default = "default_2055")] + #[serde(default = "default_2069")] pub tag_registry: Option>>, - #[serde(default = "default_2056")] + #[serde(default = "default_2070")] pub classification: Option, - #[serde(default = "default_2057")] + #[serde(default = "default_2071")] pub guide_revision: Option, - #[serde(default = "default_2058")] + #[serde(default = "default_2072")] pub guide_summary: Option, - #[serde(default = "default_2059")] + #[serde(default = "default_2073")] pub created_at: Option, - #[serde(default = "default_2060")] + #[serde(default = "default_2074")] pub updated_at: Option, } @@ -45332,17 +45482,17 @@ impl NamespaceGetInput { #[non_exhaustive] pub struct NamespaceGuideGetOutput { pub found: bool, - #[serde(default = "default_2061")] + #[serde(default = "default_2075")] pub revision: Integer, - #[serde(default = "default_2062")] + #[serde(default = "default_2076")] pub content: String, - #[serde(default = "default_2063")] + #[serde(default = "default_2077")] pub summary: String, - #[serde(default = "default_2064")] + #[serde(default = "default_2078")] pub note: String, - #[serde(default = "default_2065")] + #[serde(default = "default_2079")] pub updated_by: String, - #[serde(default = "default_2066")] + #[serde(default = "default_2080")] pub updated_at: Option, } @@ -45479,17 +45629,17 @@ impl NamespaceGuideHistoryInput { #[non_exhaustive] pub struct NamespaceGuideSetOutputNamespaceGuideGetOutput { pub found: bool, - #[serde(default = "default_2068")] + #[serde(default = "default_2082")] pub revision: Integer, - #[serde(default = "default_2069")] + #[serde(default = "default_2083")] pub content: String, - #[serde(default = "default_2070")] + #[serde(default = "default_2084")] pub summary: String, - #[serde(default = "default_2071")] + #[serde(default = "default_2085")] pub note: String, - #[serde(default = "default_2072")] + #[serde(default = "default_2086")] pub updated_by: String, - #[serde(default = "default_2073")] + #[serde(default = "default_2087")] pub updated_at: Option, } @@ -45497,10 +45647,10 @@ pub struct NamespaceGuideSetOutputNamespaceGuideGetOutput { #[non_exhaustive] pub struct NamespaceGuideSetOutput { pub written: bool, - #[serde(default = "default_2067")] + #[serde(default = "default_2081")] pub conflict: bool, pub revision: Integer, - #[serde(default = "default_2074")] + #[serde(default = "default_2088")] pub current: Option, } @@ -45621,7 +45771,7 @@ pub struct InventorySection { #[serde(deserialize_with = "required_nullable")] pub latest_at: Option, pub complete: bool, - #[serde(default = "default_2075")] + #[serde(default = "default_2089")] pub reason: String, } @@ -45651,10 +45801,10 @@ pub struct InventoryPopulation { pub population: InventoryPopulationPopulation, #[serde(deserialize_with = "required_nullable")] pub total: Option, - #[serde(default = "default_2076")] + #[serde(default = "default_2090")] pub top: Vec, pub complete: bool, - #[serde(default = "default_2077")] + #[serde(default = "default_2091")] pub reason: String, } @@ -45820,11 +45970,11 @@ pub struct NamespaceJoinOutput { pub joined: bool, pub namespace: String, pub role: NamespaceJoinOutputRole, - #[serde(default = "default_2078")] + #[serde(default = "default_2092")] pub status: String, - #[serde(default = "default_2079")] + #[serde(default = "default_2093")] pub requested_role: Option, - #[serde(default = "default_2080")] + #[serde(default = "default_2094")] pub pending_admins: Vec, pub joined_at: String, } @@ -45916,7 +46066,7 @@ impl NamespaceJoinInput { pub struct NamespaceLeaveOutput { pub left: bool, pub namespace: String, - #[serde(default = "default_2081")] + #[serde(default = "default_2095")] pub left_at: Option, } @@ -45993,27 +46143,27 @@ pub enum NamespaceEntryVisibility { #[non_exhaustive] pub struct NamespaceEntry { pub namespace: String, - #[serde(default = "default_2082")] + #[serde(default = "default_2096")] pub kind: String, pub owner_email: String, pub description: String, pub tags: Vec, pub active: bool, - #[serde(default = "default_2083")] + #[serde(default = "default_2097")] pub consolidation_enabled: bool, - #[serde(default = "default_2084")] + #[serde(default = "default_2098")] pub daily_cost_cap_usd: f64, - #[serde(default = "default_2085")] + #[serde(default = "default_2099")] pub daily_user_cost_cap_usd: f64, - #[serde(default = "default_2086")] + #[serde(default = "default_2100")] pub budget_alert_inbox: String, - #[serde(default = "default_2087")] + #[serde(default = "default_2101")] pub conflict_threshold: Option, - #[serde(default = "default_2088")] + #[serde(default = "default_2102")] pub retention_days: Integer, - #[serde(default = "default_2089")] + #[serde(default = "default_2103")] pub warm_days: Integer, - #[serde(default = "default_2090")] + #[serde(default = "default_2104")] pub visibility: NamespaceEntryVisibility, pub created_at: String, pub updated_at: String, @@ -46168,27 +46318,27 @@ pub enum MineEntryVisibility { pub struct MineEntry { pub namespace: String, pub role: String, - #[serde(default = "default_2091")] + #[serde(default = "default_2105")] pub status: String, - #[serde(default = "default_2092")] + #[serde(default = "default_2106")] pub pending_role: Option, - #[serde(default = "default_2093")] + #[serde(default = "default_2107")] pub pending_since: Option, - #[serde(default = "default_2094")] + #[serde(default = "default_2108")] pub pending_admins: Vec, - #[serde(default = "default_2095")] + #[serde(default = "default_2109")] pub visibility: MineEntryVisibility, - #[serde(default = "default_2096")] + #[serde(default = "default_2110")] pub kind: String, - #[serde(default = "default_2097")] + #[serde(default = "default_2111")] pub title: String, - #[serde(default = "default_2098")] + #[serde(default = "default_2112")] pub description: String, - #[serde(default = "default_2099")] + #[serde(default = "default_2113")] pub joined_at: Option, - #[serde(default = "default_2100")] + #[serde(default = "default_2114")] pub is_new: bool, - #[serde(default = "default_2101")] + #[serde(default = "default_2115")] pub inherited: bool, } @@ -46254,7 +46404,7 @@ pub struct OntologyEntry { pub name: String, pub status: String, pub description: String, - #[serde(default = "default_2102")] + #[serde(default = "default_2116")] pub cardinality: String, pub created_by: String, pub updated_at: String, @@ -46447,7 +46597,7 @@ pub struct NamespaceRegisterOutput { pub registered: bool, pub namespace: String, pub updated_at: String, - #[serde(default = "default_2103")] + #[serde(default = "default_2117")] pub visibility: NamespaceRegisterOutputVisibility, } @@ -46799,6 +46949,15 @@ pub enum NamespaceRegisterInputDefaultConflictPolicy { AppendOnly, } +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[non_exhaustive] +pub enum NamespaceRegisterInputCapturedConflictPolicy { + #[serde(rename = "manual_review")] + ManualReview, + #[serde(rename = "resolver_update")] + ResolverUpdate, +} + #[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] #[non_exhaustive] pub enum NamespaceRegisterInputProposalPolicyMode { @@ -47050,6 +47209,18 @@ pub struct NamespaceRegisterInput { skip_serializing_if = "Option::is_none", deserialize_with = "present_nullable" )] + pub captured_conflict_policy: Option>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_nullable" + )] + pub captured_conflict_confidence: Option>, + #[serde( + default, + skip_serializing_if = "Option::is_none", + deserialize_with = "present_nullable" + )] pub proposal_policy: Option>, #[serde( default, @@ -47089,6 +47260,8 @@ impl NamespaceRegisterInput { classify_prompt_template: None, tag_registry: None, default_conflict_policy: None, + captured_conflict_policy: None, + captured_conflict_confidence: None, proposal_policy: None, code_change_policy: None, } @@ -47296,6 +47469,25 @@ impl NamespaceRegisterInput { self.default_conflict_policy = Some(None); self } + pub fn captured_conflict_policy( + mut self, + captured_conflict_policy: NamespaceRegisterInputCapturedConflictPolicy, + ) -> Self { + self.captured_conflict_policy = Some(Some(captured_conflict_policy)); + self + } + pub fn captured_conflict_policy_null(mut self) -> Self { + self.captured_conflict_policy = Some(None); + self + } + pub fn captured_conflict_confidence(mut self, captured_conflict_confidence: f64) -> Self { + self.captured_conflict_confidence = Some(Some(captured_conflict_confidence)); + self + } + pub fn captured_conflict_confidence_null(mut self) -> Self { + self.captured_conflict_confidence = Some(None); + self + } pub fn proposal_policy( mut self, proposal_policy: NamespaceRegisterInputProposalPolicy, @@ -47527,7 +47719,7 @@ impl NamespaceRegisterOntologyInput { #[non_exhaustive] pub struct NamespaceRestoreOutput { pub restored: bool, - #[serde(default = "default_2104")] + #[serde(default = "default_2118")] pub publication_pending: bool, pub target_namespace: String, pub snapshot_id: String, @@ -48414,15 +48606,15 @@ pub struct NamespaceRollbackOutput { pub version_at: Integer, pub reinstate: Integer, pub remove: Integer, - #[serde(default = "default_2105")] + #[serde(default = "default_2119")] pub skipped_no_head: Integer, - #[serde(default = "default_2106")] + #[serde(default = "default_2120")] pub skipped_already_gone: Integer, - #[serde(default = "default_2107")] + #[serde(default = "default_2121")] pub truncated: bool, - #[serde(default = "default_2108")] + #[serde(default = "default_2122")] pub sample: Vec>, - #[serde(default = "default_2109")] + #[serde(default = "default_2123")] pub applied_at: Option, } @@ -48601,101 +48793,101 @@ pub struct NamespaceSnapshotOutputSnapshotMemoryRow { pub confidence: f64, pub source_trace: String, pub pinned: bool, - #[serde(default = "default_2110")] + #[serde(default = "default_2124")] pub expires_at: Option, - #[serde(default = "default_2111")] + #[serde(default = "default_2125")] pub entities: Vec, - #[serde(default = "default_2112")] + #[serde(default = "default_2126")] pub version: Integer, - #[serde(default = "default_2113")] + #[serde(default = "default_2127")] pub content_sha256: String, - #[serde(default = "default_2114")] + #[serde(default = "default_2128")] pub actor: String, - #[serde(default = "default_2115")] + #[serde(default = "default_2129")] pub source_class: String, - #[serde(default = "default_2116")] + #[serde(default = "default_2130")] pub source_resource_id: String, - #[serde(default = "default_2117")] + #[serde(default = "default_2131")] pub verified_by: String, - #[serde(default = "default_2118")] + #[serde(default = "default_2132")] pub verified_at: Option, - #[serde(default = "default_2119")] + #[serde(default = "default_2133")] pub verified_sha256: String, - #[serde(default = "default_2120")] + #[serde(default = "default_2134")] pub grounding: String, - #[serde(default = "default_2121")] + #[serde(default = "default_2135")] pub evidence: String, - #[serde(default = "default_2122")] + #[serde(default = "default_2136")] pub tags: Vec, - #[serde(default = "default_2123")] + #[serde(default = "default_2137")] pub valid_at: Option, - #[serde(default = "default_2124")] + #[serde(default = "default_2138")] pub valid_to: Option, - #[serde(default = "default_2125")] + #[serde(default = "default_2139")] pub created_at: Option, - #[serde(default = "default_2126")] + #[serde(default = "default_2140")] pub updated_at: Option, - #[serde(default = "default_2127")] + #[serde(default = "default_2141")] pub value_json: String, - #[serde(default = "default_2128")] + #[serde(default = "default_2142")] pub status: NamespaceSnapshotOutputSnapshotMemoryRowStatus, - #[serde(default = "default_2129")] + #[serde(default = "default_2143")] pub requires_review: Option, - #[serde(default = "default_2130")] + #[serde(default = "default_2144")] pub conflict_with: Vec, - #[serde(default = "default_2131")] + #[serde(default = "default_2145")] pub duplicate_of: String, - #[serde(default = "default_2132")] + #[serde(default = "default_2146")] pub evidence_count: Integer, - #[serde(default = "default_2133")] + #[serde(default = "default_2147")] pub recall_count: Integer, - #[serde(default = "default_2134")] + #[serde(default = "default_2148")] pub last_recalled_at: Option, - #[serde(default = "default_2135")] + #[serde(default = "default_2149")] pub cross_promoted_from_memory_id: String, - #[serde(default = "default_2136")] + #[serde(default = "default_2150")] pub cross_promoted_from_namespace: String, - #[serde(default = "default_2137")] + #[serde(default = "default_2151")] pub superseded_by: String, - #[serde(default = "default_2138")] + #[serde(default = "default_2152")] pub rejection_reason: String, - #[serde(default = "default_2139")] + #[serde(default = "default_2153")] pub temporal_anchor: Option, - #[serde(default = "default_2140")] + #[serde(default = "default_2154")] pub temporal_confidence: f64, - #[serde(default = "default_2141")] + #[serde(default = "default_2155")] pub invalid_at: Option, - #[serde(default = "default_2142")] + #[serde(default = "default_2156")] pub char_limit: Option, - #[serde(default = "default_2143")] + #[serde(default = "default_2157")] pub reinforcement_count: Integer, - #[serde(default = "default_2144")] + #[serde(default = "default_2158")] pub last_reinforced_at: Option, - #[serde(default = "default_2145")] + #[serde(default = "default_2159")] pub mentioned_at: Option, - #[serde(default = "default_2146")] + #[serde(default = "default_2160")] pub sensitivity: String, - #[serde(default = "default_2147")] + #[serde(default = "default_2161")] pub redacted_at: Option, - #[serde(default = "default_2148")] + #[serde(default = "default_2162")] pub redaction_reason: String, - #[serde(default = "default_2149")] + #[serde(default = "default_2163")] pub lock_mode: String, - #[serde(default = "default_2150")] + #[serde(default = "default_2164")] pub lock_reason: String, - #[serde(default = "default_2151")] + #[serde(default = "default_2165")] pub lock_until: Option, - #[serde(default = "default_2152")] + #[serde(default = "default_2166")] pub locked_by: String, - #[serde(default = "default_2153")] + #[serde(default = "default_2167")] pub locked_at: Option, - #[serde(default = "default_2154")] + #[serde(default = "default_2168")] pub on_expire: String, - #[serde(default = "default_2155")] + #[serde(default = "default_2169")] pub expire_reason: String, - #[serde(default = "default_2156")] + #[serde(default = "default_2170")] pub files: Vec, - #[serde(default = "default_2157")] + #[serde(default = "default_2171")] pub concepts: Vec, } @@ -48704,11 +48896,11 @@ pub struct NamespaceSnapshotOutputSnapshotMemoryRow { pub struct NamespaceSnapshotOutputSnapshotTypeRow { pub memory_type: String, pub retention_days: Integer, - #[serde(default = "default_2158")] + #[serde(default = "default_2172")] pub dedup_threshold: Option, - #[serde(default = "default_2159")] + #[serde(default = "default_2173")] pub hot_quota: Integer, - #[serde(default = "default_2160")] + #[serde(default = "default_2174")] pub conflict_policy: String, } @@ -48923,7 +49115,7 @@ pub struct TaxonomyCommunity { pub community_id: Integer, pub label: String, pub size: Integer, - #[serde(default = "default_2161")] + #[serde(default = "default_2175")] pub top_entities: Vec, } @@ -48934,9 +49126,9 @@ pub struct NamespaceTaxonomyOutput { pub entities: Vec, pub memory_count: Integer, pub memory_types: Vec, - #[serde(default = "default_2162")] + #[serde(default = "default_2176")] pub communities: Vec, - #[serde(default = "default_2163")] + #[serde(default = "default_2177")] pub communities_computed_at: String, } @@ -49036,15 +49228,15 @@ pub enum TuneProposalTarget { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TuneEvidence { - #[serde(default = "default_2165")] + #[serde(default = "default_2179")] pub finding_codes: Vec, - #[serde(default = "default_2166")] + #[serde(default = "default_2180")] pub supporting_count: Integer, - #[serde(default = "default_2167")] + #[serde(default = "default_2181")] pub supporting: Vec, - #[serde(default = "default_2168")] + #[serde(default = "default_2182")] pub counter_count: Option, - #[serde(default = "default_2169")] + #[serde(default = "default_2183")] pub documents: Vec, } @@ -49070,10 +49262,10 @@ pub enum TuneApplyVia { #[non_exhaustive] pub struct TuneApply { pub op: String, - #[serde(default = "default_2173")] + #[serde(default = "default_2187")] pub via: TuneApplyVia, pub args: std::collections::HashMap, - #[serde(default = "default_2174")] + #[serde(default = "default_2188")] pub args_complete: bool, pub required_role: String, pub guard: String, @@ -49092,7 +49284,7 @@ pub struct ChunkStats { pub sections: Integer, pub sections_cut: Integer, pub max_input_tokens: Integer, - #[serde(default = "default_2176")] + #[serde(default = "default_2190")] pub over_input_limit: Option, } @@ -49112,25 +49304,25 @@ pub struct TuneProposal { pub title: String, pub rationale: String, pub current: String, - #[serde(default = "default_2164")] + #[serde(default = "default_2178")] pub current_revision: Option, pub proposed: String, pub evidence: TuneEvidence, - #[serde(default = "default_2170")] + #[serde(default = "default_2184")] pub affected_agents: Vec, - #[serde(default = "default_2171")] + #[serde(default = "default_2185")] pub affected_agents_total: Option, - #[serde(default = "default_2172")] + #[serde(default = "default_2186")] pub effect: TuneProposalEffect, pub historical: String, pub apply: TuneApply, - #[serde(default = "default_2175")] + #[serde(default = "default_2189")] pub apply_also: Vec, - #[serde(default = "default_2177")] + #[serde(default = "default_2191")] pub preview: Option, - #[serde(default = "default_2178")] + #[serde(default = "default_2192")] pub limits: String, - #[serde(default = "default_2179")] + #[serde(default = "default_2193")] pub refs: Vec, } @@ -49138,13 +49330,13 @@ pub struct TuneProposal { #[non_exhaustive] pub struct ChunkingSample { pub cap: Integer, - #[serde(default = "default_2185")] + #[serde(default = "default_2199")] pub population: Option, pub documents: Integer, pub unread: Integer, pub load_cap: Integer, pub embedder_model: String, - #[serde(default = "default_2186")] + #[serde(default = "default_2200")] pub input_token_limit: Option, pub current: ChunkStats, } @@ -49155,21 +49347,21 @@ pub struct NamespaceTuneOutput { pub org: String, pub namespace: String, pub computed_at: String, - #[serde(default = "default_2180")] + #[serde(default = "default_2194")] pub proposals: Vec, - #[serde(default = "default_2181")] + #[serde(default = "default_2195")] pub guide_revision: Option, - #[serde(default = "default_2182")] + #[serde(default = "default_2196")] pub categories_registered: Option, - #[serde(default = "default_2183")] + #[serde(default = "default_2197")] pub extraction_policy: Option, - #[serde(default = "default_2184")] + #[serde(default = "default_2198")] pub extraction_policy_unavailable: String, - #[serde(default = "default_2187")] + #[serde(default = "default_2201")] pub chunking: Option, - #[serde(default = "default_2188")] + #[serde(default = "default_2202")] pub skipped: Vec, - #[serde(default = "default_2189")] + #[serde(default = "default_2203")] pub model_used: bool, } @@ -49290,25 +49482,25 @@ pub struct NamespaceValidateFinding { pub kind: NamespaceValidateFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_2190")] + #[serde(default = "default_2204")] pub window_seconds: Option, - #[serde(default = "default_2191")] + #[serde(default = "default_2205")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_2192")] + #[serde(default = "default_2206")] pub evidence: Vec, - #[serde(default = "default_2193")] + #[serde(default = "default_2207")] pub exceptions: String, - #[serde(default = "default_2194")] + #[serde(default = "default_2208")] pub uncertainty: String, pub check: String, pub severity: NamespaceValidateFindingSeverity, pub count: Integer, - #[serde(default = "default_2195")] + #[serde(default = "default_2209")] pub samples: Vec>, pub detail: String, - #[serde(default = "default_2196")] + #[serde(default = "default_2210")] pub totals: std::collections::HashMap, } @@ -49322,9 +49514,9 @@ pub struct NamespaceValidateOutput { pub warnings: Integer, pub infos: Integer, pub findings: Vec, - #[serde(default = "default_2197")] + #[serde(default = "default_2211")] pub skipped: Vec, - #[serde(default = "default_2198")] + #[serde(default = "default_2212")] pub keys_scoped: Integer, pub coverage: ReportCoverage, pub checked_at: String, @@ -49444,9 +49636,9 @@ impl NamespaceValidateInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ObserveCrystallizeOutput { - #[serde(default = "default_2199")] + #[serde(default = "default_2213")] pub enqueued: Integer, - #[serde(default = "default_2200")] + #[serde(default = "default_2214")] pub session_id: String, } @@ -49543,23 +49735,23 @@ impl ObserveCrystallizeInput { #[non_exhaustive] pub struct ObserveRecordOutput { pub memory_key: String, - #[serde(default = "default_2201")] + #[serde(default = "default_2215")] pub memory_id: String, - #[serde(default = "default_2202")] + #[serde(default = "default_2216")] pub kind: String, - #[serde(default = "default_2203")] + #[serde(default = "default_2217")] pub tags: Vec, - #[serde(default = "default_2204")] + #[serde(default = "default_2218")] pub file_paths: Vec, - #[serde(default = "default_2205")] + #[serde(default = "default_2219")] pub content_sha256: String, - #[serde(default = "default_2206")] + #[serde(default = "default_2220")] pub tool_name: String, - #[serde(default = "default_2207")] + #[serde(default = "default_2221")] pub has_error: bool, - #[serde(default = "default_2208")] + #[serde(default = "default_2222")] pub narrative_chars: Integer, - #[serde(default = "default_2209")] + #[serde(default = "default_2223")] pub skipped_reason: String, } @@ -49758,26 +49950,26 @@ pub struct ProjectionFailureRow { pub failure_id: String, pub org: String, pub namespace: String, - #[serde(default = "default_2210")] + #[serde(default = "default_2224")] pub agent: String, pub projection: String, - #[serde(default = "default_2211")] + #[serde(default = "default_2225")] pub source_operation: String, - #[serde(default = "default_2212")] + #[serde(default = "default_2226")] pub source_resource_id: String, - #[serde(default = "default_2213")] + #[serde(default = "default_2227")] pub memory_keys: Vec, - #[serde(default = "default_2214")] + #[serde(default = "default_2228")] pub error_type: String, - #[serde(default = "default_2215")] + #[serde(default = "default_2229")] pub error_message: String, - #[serde(default = "default_2216")] + #[serde(default = "default_2230")] pub payload: std::collections::HashMap, - #[serde(default = "default_2217")] + #[serde(default = "default_2231")] pub status: String, - #[serde(default = "default_2218")] + #[serde(default = "default_2232")] pub created_at: Option, - #[serde(default = "default_2219")] + #[serde(default = "default_2233")] pub resolved_at: Option, } @@ -49931,22 +50123,22 @@ pub struct ProjectionFailureRetryRow { pub projection: String, pub retried: bool, pub resolved: bool, - #[serde(default = "default_2220")] + #[serde(default = "default_2234")] pub abandoned: bool, - #[serde(default = "default_2221")] + #[serde(default = "default_2235")] pub reason: String, - #[serde(default = "default_2222")] + #[serde(default = "default_2236")] pub error: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProjectionFailureRetryOutput { - #[serde(default = "default_2223")] + #[serde(default = "default_2237")] pub results: Vec, pub retried: Integer, pub resolved: Integer, - #[serde(default = "default_2224")] + #[serde(default = "default_2238")] pub abandoned: Integer, } @@ -50028,15 +50220,15 @@ impl ProjectionFailureRetryInput { pub struct OrgModelCallsOutput { pub org: String, pub enabled: bool, - #[serde(default = "default_2225")] + #[serde(default = "default_2239")] pub reason: String, - #[serde(default = "default_2226")] + #[serde(default = "default_2240")] pub updated_by: String, - #[serde(default = "default_2227")] + #[serde(default = "default_2241")] pub updated_at: Option, - #[serde(default = "default_2228")] + #[serde(default = "default_2242")] pub locked: bool, - #[serde(default = "default_2229")] + #[serde(default = "default_2243")] pub locked_by: String, } @@ -50375,7 +50567,7 @@ impl PolicyDecisionsInput { #[non_exhaustive] pub struct PolicyDeleteOutput { pub removed: bool, - #[serde(default = "default_2230")] + #[serde(default = "default_2244")] pub widening: bool, } @@ -50441,12 +50633,12 @@ pub struct PolicyRuleOut { pub condition: std::collections::HashMap, pub description: String, pub enabled: bool, - #[serde(default = "default_2231")] + #[serde(default = "default_2245")] pub mode: String, pub created_by: String, - #[serde(default = "default_2232")] + #[serde(default = "default_2246")] pub created_at: Option, - #[serde(default = "default_2233")] + #[serde(default = "default_2247")] pub updated_at: Option, } @@ -50518,9 +50710,9 @@ impl PolicyListInput { pub struct PolicySetOutput { pub rule: PolicyRuleOut, pub leaf_count: Integer, - #[serde(default = "default_2234")] + #[serde(default = "default_2248")] pub widening: bool, - #[serde(default = "default_2235")] + #[serde(default = "default_2249")] pub change: Vec, } @@ -50790,37 +50982,37 @@ pub struct ProcedureEvolveOutput { pub revision: Integer, pub changed: bool, pub template: bool, - #[serde(default = "default_2236")] + #[serde(default = "default_2250")] pub folded_runs: Integer, - #[serde(default = "default_2237")] + #[serde(default = "default_2251")] pub gate: ProcedureEvolveOutputGate, - #[serde(default = "default_2238")] + #[serde(default = "default_2252")] pub gate_mode: String, - #[serde(default = "default_2239")] + #[serde(default = "default_2253")] pub gate_llr: f64, - #[serde(default = "default_2240")] + #[serde(default = "default_2254")] pub gate_before: std::collections::HashMap, - #[serde(default = "default_2241")] + #[serde(default = "default_2255")] pub gate_after: std::collections::HashMap, - #[serde(default = "default_2242")] + #[serde(default = "default_2256")] pub gate_cost_before: std::collections::HashMap, - #[serde(default = "default_2243")] + #[serde(default = "default_2257")] pub gate_cost_after: std::collections::HashMap, - #[serde(default = "default_2244")] + #[serde(default = "default_2258")] pub gate_reason: String, - #[serde(default = "default_2245")] + #[serde(default = "default_2259")] pub dead_end_steps: Vec, - #[serde(default = "default_2246")] + #[serde(default = "default_2260")] pub fail_prone_steps: Vec, - #[serde(default = "default_2247")] + #[serde(default = "default_2261")] pub fail_prone_transitions: Vec, - #[serde(default = "default_2248")] + #[serde(default = "default_2262")] pub run_stats: std::collections::HashMap, - #[serde(default = "default_2249")] + #[serde(default = "default_2263")] pub strikes: Integer, - #[serde(default = "default_2250")] + #[serde(default = "default_2264")] pub quarantined: bool, - #[serde(default = "default_2251")] + #[serde(default = "default_2265")] pub retention: std::collections::HashMap, } @@ -51043,9 +51235,9 @@ pub struct ProcedureForkOutput { pub memory_key: String, pub version: Integer, pub name: String, - #[serde(default = "default_2252")] + #[serde(default = "default_2266")] pub steps: Vec, - #[serde(default = "default_2253")] + #[serde(default = "default_2267")] pub forked_from: std::collections::HashMap, } @@ -51305,32 +51497,32 @@ pub enum ProcedureLocateOutputStatus { #[non_exhaustive] pub struct ProcedureLocateOutput { pub memory_key: String, - #[serde(default = "default_2254")] + #[serde(default = "default_2268")] pub name: String, - #[serde(default = "default_2255")] + #[serde(default = "default_2269")] pub status: ProcedureLocateOutputStatus, pub matched: bool, - #[serde(default = "default_2256")] + #[serde(default = "default_2270")] pub active: Option>, - #[serde(default = "default_2257")] + #[serde(default = "default_2271")] pub hops: Vec>>, - #[serde(default = "default_2258")] + #[serde(default = "default_2272")] pub entry_nodes: Vec, - #[serde(default = "default_2259")] + #[serde(default = "default_2273")] pub dominant_next: Vec, - #[serde(default = "default_2260")] + #[serde(default = "default_2274")] pub revisits: std::collections::HashMap, - #[serde(default = "default_2261")] + #[serde(default = "default_2275")] pub looping: bool, - #[serde(default = "default_2262")] + #[serde(default = "default_2276")] pub exits: Vec, - #[serde(default = "default_2263")] + #[serde(default = "default_2277")] pub failure_notes: Vec>, - #[serde(default = "default_2264")] + #[serde(default = "default_2278")] pub rendered: String, - #[serde(default = "default_2265")] + #[serde(default = "default_2279")] pub run_stats: std::collections::HashMap, - #[serde(default = "default_2266")] + #[serde(default = "default_2280")] pub for_agent: std::collections::HashMap, } @@ -51485,43 +51677,43 @@ pub struct ProcedureMatch { pub name: String, pub situation: String, pub steps: Vec, - #[serde(default = "default_2267")] + #[serde(default = "default_2281")] pub tags: Vec, - #[serde(default = "default_2268")] + #[serde(default = "default_2282")] pub metadata: std::collections::HashMap, pub similarity: f64, pub memory_key: String, pub namespace: String, - #[serde(default = "default_2269")] + #[serde(default = "default_2283")] pub graph: Option>, - #[serde(default = "default_2270")] + #[serde(default = "default_2284")] pub template: bool, - #[serde(default = "default_2271")] + #[serde(default = "default_2285")] pub run_stats: std::collections::HashMap, - #[serde(default = "default_2272")] + #[serde(default = "default_2286")] pub status: ProcedureMatchStatus, - #[serde(default = "default_2273")] + #[serde(default = "default_2287")] pub quarantined: Option>, - #[serde(default = "default_2274")] + #[serde(default = "default_2288")] pub fail_prone_steps: Vec, - #[serde(default = "default_2275")] + #[serde(default = "default_2289")] pub revision: Integer, - #[serde(default = "default_2276")] + #[serde(default = "default_2290")] pub rejected_revisions: Vec>, - #[serde(default = "default_2277")] + #[serde(default = "default_2291")] pub tool_overlap: f64, - #[serde(default = "default_2278")] + #[serde(default = "default_2292")] pub score: f64, - #[serde(default = "default_2279")] + #[serde(default = "default_2293")] pub utility: f64, - #[serde(default = "default_2280")] + #[serde(default = "default_2294")] pub goal_similarity: Option, - #[serde(default = "default_2281")] + #[serde(default = "default_2295")] pub for_agent: std::collections::HashMap, - #[serde(default = "default_2282")] + #[serde(default = "default_2296")] pub run_stats_by_agent: std::collections::HashMap>, - #[serde(default = "default_2283")] + #[serde(default = "default_2297")] pub actor: String, } @@ -51529,11 +51721,11 @@ pub struct ProcedureMatch { #[non_exhaustive] pub struct ProcedureMatchOutput { pub matches: Vec, - #[serde(default = "default_2284")] + #[serde(default = "default_2298")] pub matched: Integer, - #[serde(default = "default_2285")] + #[serde(default = "default_2299")] pub procedure_key: String, - #[serde(default = "default_2286")] + #[serde(default = "default_2300")] pub score: f64, } @@ -51925,9 +52117,9 @@ pub struct ProcedureReviseOutput { pub revision: Integer, pub prior_revision: Integer, pub digest: String, - #[serde(default = "default_2287")] + #[serde(default = "default_2301")] pub steps: Vec, - #[serde(default = "default_2288")] + #[serde(default = "default_2302")] pub outcome: ProcedureReviseOutputOutcome, } @@ -52039,14 +52231,14 @@ pub struct ProfileActivityEntry { pub agent: String, pub last_activated_at: String, pub event_count: Integer, - #[serde(default = "default_2289")] + #[serde(default = "default_2303")] pub operations: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProfileActivityOutput { - #[serde(default = "default_2290")] + #[serde(default = "default_2304")] pub entries: Vec, } @@ -52154,17 +52346,17 @@ impl ProfileActivityInput { #[non_exhaustive] pub struct ProfileMutationOutput { pub version: Integer, - #[serde(default = "default_2291")] + #[serde(default = "default_2305")] pub memory_id: String, - #[serde(default = "default_2292")] + #[serde(default = "default_2306")] pub content_sha256: String, - #[serde(default = "default_2293")] + #[serde(default = "default_2307")] pub namespace: String, - #[serde(default = "default_2294")] + #[serde(default = "default_2308")] pub label: String, - #[serde(default = "default_2295")] + #[serde(default = "default_2309")] pub char_limit: Option, - #[serde(default = "default_2296")] + #[serde(default = "default_2310")] pub value_length: Integer, } @@ -52273,7 +52465,7 @@ pub struct ProfileRenderOutput { pub rendered: String, pub section_count: Integer, pub total_chars: Integer, - #[serde(default = "default_2297")] + #[serde(default = "default_2311")] pub labels: Vec, } @@ -52658,17 +52850,17 @@ pub enum ProfileStructuredOutputStatus { #[non_exhaustive] pub struct ProfileStructuredOutput { pub status: ProfileStructuredOutputStatus, - #[serde(default = "default_2298")] + #[serde(default = "default_2312")] pub profile: std::collections::HashMap, - #[serde(default = "default_2299")] + #[serde(default = "default_2313")] pub built_at: Option, - #[serde(default = "default_2300")] + #[serde(default = "default_2314")] pub memory_id: String, - #[serde(default = "default_2301")] + #[serde(default = "default_2315")] pub version: Integer, - #[serde(default = "default_2302")] + #[serde(default = "default_2316")] pub version_text: String, - #[serde(default = "default_2303")] + #[serde(default = "default_2317")] pub schema_sha256: String, } @@ -52785,13 +52977,13 @@ impl ProfileStructuredInput { #[non_exhaustive] pub struct ProfileSchemaOutput { pub found: bool, - #[serde(default = "default_2304")] + #[serde(default = "default_2318")] pub json_schema: std::collections::HashMap, - #[serde(default = "default_2305")] + #[serde(default = "default_2319")] pub schema_sha256: String, - #[serde(default = "default_2306")] + #[serde(default = "default_2320")] pub updated_by: String, - #[serde(default = "default_2307")] + #[serde(default = "default_2321")] pub updated_at: Option, } @@ -52944,10 +53136,10 @@ pub enum RunBeginOutputStatus { #[non_exhaustive] pub struct RunBeginOutput { pub run_id: String, - #[serde(default = "default_2308")] + #[serde(default = "default_2322")] pub status: RunBeginOutputStatus, pub started_at: String, - #[serde(default = "default_2309")] + #[serde(default = "default_2323")] pub next: String, } @@ -53155,29 +53347,29 @@ pub struct RunCompleteOutput { pub run_id: String, pub status: RunCompleteOutputStatus, pub duration_ms: Integer, - #[serde(default = "default_2310")] + #[serde(default = "default_2324")] pub used_applied: Integer, - #[serde(default = "default_2311")] + #[serde(default = "default_2325")] pub evidence_applied: Integer, - #[serde(default = "default_2312")] + #[serde(default = "default_2326")] pub harm_applied: Integer, - #[serde(default = "default_2313")] + #[serde(default = "default_2327")] pub memories_written: Vec, - #[serde(default = "default_2314")] + #[serde(default = "default_2328")] pub recalled: Integer, - #[serde(default = "default_2315")] + #[serde(default = "default_2329")] pub observations: Integer, - #[serde(default = "default_2316")] + #[serde(default = "default_2330")] pub procedure_runs_recorded: Integer, - #[serde(default = "default_2317")] + #[serde(default = "default_2331")] pub reflection_key: String, - #[serde(default = "default_2318")] + #[serde(default = "default_2332")] pub retain: String, - #[serde(default = "default_2319")] + #[serde(default = "default_2333")] pub retained: Integer, - #[serde(default = "default_2320")] + #[serde(default = "default_2334")] pub demoted: Integer, - #[serde(default = "default_2321")] + #[serde(default = "default_2335")] pub expiring: Integer, } @@ -53698,25 +53890,25 @@ pub enum RunGetOutputOverBudgetItem { #[non_exhaustive] pub struct RunGetOutput { pub found: bool, - #[serde(default = "default_2322")] + #[serde(default = "default_2336")] pub run: Option, - #[serde(default = "default_2323")] + #[serde(default = "default_2337")] pub recalled: Integer, - #[serde(default = "default_2324")] + #[serde(default = "default_2338")] pub recalled_keys: Vec, - #[serde(default = "default_2325")] + #[serde(default = "default_2339")] pub memories_written: Vec, - #[serde(default = "default_2326")] + #[serde(default = "default_2340")] pub observations: Integer, - #[serde(default = "default_2327")] + #[serde(default = "default_2341")] pub turns: Integer, - #[serde(default = "default_2328")] + #[serde(default = "default_2342")] pub unpriced_turns: Integer, - #[serde(default = "default_2329")] + #[serde(default = "default_2343")] pub cost_usd: f64, - #[serde(default = "default_2330")] + #[serde(default = "default_2344")] pub elapsed_seconds: Integer, - #[serde(default = "default_2331")] + #[serde(default = "default_2345")] pub over_budget: Vec, } @@ -53783,17 +53975,17 @@ pub struct RunGradeProposal { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct RunGradeOutput { - #[serde(default = "default_2332")] + #[serde(default = "default_2346")] pub graded: Integer, - #[serde(default = "default_2333")] + #[serde(default = "default_2347")] pub run_ids: Vec, - #[serde(default = "default_2334")] + #[serde(default = "default_2348")] pub skipped_active: Integer, - #[serde(default = "default_2335")] + #[serde(default = "default_2349")] pub unchanged: Integer, - #[serde(default = "default_2336")] + #[serde(default = "default_2350")] pub memories_counted: Integer, - #[serde(default = "default_2337")] + #[serde(default = "default_2351")] pub proposals_decided: Vec, } @@ -53908,7 +54100,7 @@ impl RunGradeInput { #[non_exhaustive] pub struct RunListOutput { pub runs: Vec, - #[serde(default = "default_2338")] + #[serde(default = "default_2352")] pub total: Option, } @@ -54185,39 +54377,39 @@ pub struct LiveSearchHit { pub title: String, pub url: String, pub provider: LiveSearchHitProvider, - #[serde(default = "default_2341")] + #[serde(default = "default_2355")] pub content: String, - #[serde(default = "default_2342")] + #[serde(default = "default_2356")] pub live: LiveSearchHitLive, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct LiveSearchResults { - #[serde(default = "default_2340")] + #[serde(default = "default_2354")] pub live: LiveSearchResultsLive, - #[serde(default = "default_2343")] + #[serde(default = "default_2357")] pub results: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SearchOutput { - #[serde(default = "default_2339")] + #[serde(default = "default_2353")] pub tracker: Option>, - #[serde(default = "default_2344")] + #[serde(default = "default_2358")] pub live: Option, - #[serde(default = "default_2345")] + #[serde(default = "default_2359")] pub memory: std::collections::HashMap, - #[serde(default = "default_2346")] + #[serde(default = "default_2360")] pub knowledge: std::collections::HashMap, - #[serde(default = "default_2347")] + #[serde(default = "default_2361")] pub profile: std::collections::HashMap, - #[serde(default = "default_2348")] + #[serde(default = "default_2362")] pub conversations: std::collections::HashMap, - #[serde(default = "default_2349")] + #[serde(default = "default_2363")] pub withheld: Option>, - #[serde(default = "default_2350")] + #[serde(default = "default_2364")] pub namespaces_skipped: Vec, } @@ -54410,7 +54602,7 @@ impl SearchInput { pub struct SessionBriefDeleteOutput { pub deleted: bool, pub brief_key: String, - #[serde(default = "default_2351")] + #[serde(default = "default_2365")] pub revision: Integer, } @@ -54503,67 +54695,67 @@ impl SessionBriefDeleteInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDecision { - #[serde(default = "default_2360")] + #[serde(default = "default_2374")] pub what: String, - #[serde(default = "default_2361")] + #[serde(default = "default_2375")] pub why: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDeadEnd { - #[serde(default = "default_2363")] + #[serde(default = "default_2377")] pub tried: String, - #[serde(default = "default_2364")] + #[serde(default = "default_2378")] pub why_not: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDone { - #[serde(default = "default_2366")] + #[serde(default = "default_2380")] pub what: String, - #[serde(rename = "ref", default = "default_2367")] + #[serde(rename = "ref", default = "default_2381")] pub r#ref: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefFile { - #[serde(default = "default_2371")] + #[serde(default = "default_2385")] pub path: String, - #[serde(default = "default_2372")] + #[serde(default = "default_2386")] pub role: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefSections { - #[serde(default = "default_2357")] + #[serde(default = "default_2371")] pub goal: String, - #[serde(default = "default_2358")] + #[serde(default = "default_2372")] pub status: String, - #[serde(default = "default_2359")] + #[serde(default = "default_2373")] pub verification: String, - #[serde(default = "default_2362")] + #[serde(default = "default_2376")] pub decisions: Vec, - #[serde(default = "default_2365")] + #[serde(default = "default_2379")] pub dead_ends: Vec, - #[serde(default = "default_2368")] + #[serde(default = "default_2382")] pub done: Vec, - #[serde(default = "default_2369")] + #[serde(default = "default_2383")] pub open_questions: Vec, - #[serde(default = "default_2370")] + #[serde(default = "default_2384")] pub next_steps: Vec, - #[serde(default = "default_2373")] + #[serde(default = "default_2387")] pub files: Vec, - #[serde(default = "default_2374")] + #[serde(default = "default_2388")] pub constraints: Vec, - #[serde(default = "default_2375")] + #[serde(default = "default_2389")] pub pointers: Vec, - #[serde(default = "default_2376")] + #[serde(default = "default_2390")] pub client_summary: String, - #[serde(default = "default_2377")] + #[serde(default = "default_2391")] pub client_summary_at: String, } @@ -54571,45 +54763,45 @@ pub struct BriefSections { #[non_exhaustive] pub struct SessionBriefGetOutput { pub found: bool, - #[serde(default = "default_2352")] + #[serde(default = "default_2366")] pub brief_key: String, - #[serde(default = "default_2353")] + #[serde(default = "default_2367")] pub revision: Integer, - #[serde(default = "default_2354")] + #[serde(default = "default_2368")] pub snapshot_id: String, - #[serde(default = "default_2355")] + #[serde(default = "default_2369")] pub snapshot_key: String, - #[serde(default = "default_2356")] + #[serde(default = "default_2370")] pub rendered: String, - #[serde(default = "default_2378")] + #[serde(default = "default_2392")] pub sections: Option, - #[serde(default = "default_2379")] + #[serde(default = "default_2393")] pub project: String, - #[serde(default = "default_2380")] + #[serde(default = "default_2394")] pub branch: String, - #[serde(default = "default_2381")] + #[serde(default = "default_2395")] pub head_sha: String, - #[serde(default = "default_2382")] + #[serde(default = "default_2396")] pub author: String, - #[serde(default = "default_2383")] + #[serde(default = "default_2397")] pub trigger: String, - #[serde(default = "default_2384")] + #[serde(default = "default_2398")] pub actor: String, - #[serde(default = "default_2385")] + #[serde(default = "default_2399")] pub source_sessions: Vec, - #[serde(default = "default_2386")] + #[serde(default = "default_2400")] pub updated_at: Option, - #[serde(default = "default_2387")] + #[serde(default = "default_2401")] pub age_seconds: Integer, - #[serde(default = "default_2388")] + #[serde(default = "default_2402")] pub revisions: Integer, - #[serde(default = "default_2389")] + #[serde(default = "default_2403")] pub events_total: Integer, - #[serde(default = "default_2390")] + #[serde(default = "default_2404")] pub source_chars: Integer, - #[serde(default = "default_2391")] + #[serde(default = "default_2405")] pub brief_chars: Integer, - #[serde(default = "default_2392")] + #[serde(default = "default_2406")] pub deleted: bool, } @@ -54784,34 +54976,34 @@ impl SessionBriefGetInput { pub struct SessionBriefSummary { pub brief_key: String, pub revision: Integer, - #[serde(default = "default_2393")] + #[serde(default = "default_2407")] pub project: String, - #[serde(default = "default_2394")] + #[serde(default = "default_2408")] pub branch: String, - #[serde(default = "default_2395")] + #[serde(default = "default_2409")] pub agent: String, - #[serde(default = "default_2396")] + #[serde(default = "default_2410")] pub goal: String, - #[serde(default = "default_2397")] + #[serde(default = "default_2411")] pub status: String, - #[serde(default = "default_2398")] + #[serde(default = "default_2412")] pub author: String, - #[serde(default = "default_2399")] + #[serde(default = "default_2413")] pub actor: String, - #[serde(default = "default_2400")] + #[serde(default = "default_2414")] pub updated_at: Option, - #[serde(default = "default_2401")] + #[serde(default = "default_2415")] pub age_seconds: Integer, - #[serde(default = "default_2402")] + #[serde(default = "default_2416")] pub brief_chars: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SessionBriefListOutput { - #[serde(default = "default_2403")] + #[serde(default = "default_2417")] pub briefs: Vec, - #[serde(default = "default_2404")] + #[serde(default = "default_2418")] pub rendered: String, } @@ -54951,25 +55143,25 @@ impl SessionBriefListInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SessionBriefStats { - #[serde(default = "default_2408")] + #[serde(default = "default_2422")] pub events_in: Integer, - #[serde(default = "default_2409")] + #[serde(default = "default_2423")] pub windows: Integer, - #[serde(default = "default_2410")] + #[serde(default = "default_2424")] pub events_total: Integer, - #[serde(default = "default_2411")] + #[serde(default = "default_2425")] pub source_chars: Integer, - #[serde(default = "default_2412")] + #[serde(default = "default_2426")] pub brief_chars: Integer, - #[serde(default = "default_2413")] + #[serde(default = "default_2427")] pub compression_ratio: f64, - #[serde(default = "default_2414")] + #[serde(default = "default_2428")] pub dropped_ungrounded: Integer, - #[serde(default = "default_2415")] + #[serde(default = "default_2429")] pub tokens_in: Integer, - #[serde(default = "default_2416")] + #[serde(default = "default_2430")] pub tokens_out: Integer, - #[serde(default = "default_2417")] + #[serde(default = "default_2431")] pub llm_model: String, } @@ -54979,13 +55171,13 @@ pub struct SessionBriefSaveOutput { pub brief_key: String, pub revision: Integer, pub changed: bool, - #[serde(default = "default_2405")] + #[serde(default = "default_2419")] pub author: String, - #[serde(default = "default_2406")] + #[serde(default = "default_2420")] pub reason: String, - #[serde(default = "default_2407")] + #[serde(default = "default_2421")] pub rendered: String, - #[serde(default = "default_2418")] + #[serde(default = "default_2432")] pub stats: SessionBriefStats, } @@ -55730,39 +55922,39 @@ pub struct TaskPayload { pub priority: Integer, pub disclosure: TaskPayloadDisclosure, pub status: TaskPayloadStatus, - #[serde(default = "default_2419")] + #[serde(default = "default_2433")] pub reason: String, - #[serde(default = "default_2420")] + #[serde(default = "default_2434")] pub blocked_on: String, - #[serde(default = "default_2421")] + #[serde(default = "default_2435")] pub not_before: Option, - #[serde(default = "default_2422")] + #[serde(default = "default_2436")] pub resume_at: Option, - #[serde(default = "default_2423")] + #[serde(default = "default_2437")] pub deadline: Option, - #[serde(default = "default_2424")] + #[serde(default = "default_2438")] pub defer_count: Integer, pub title: String, - #[serde(default = "default_2425")] + #[serde(default = "default_2439")] pub brief: std::collections::HashMap, pub from_agent: String, - #[serde(default = "default_2426")] + #[serde(default = "default_2440")] pub from_subject: String, - #[serde(default = "default_2427")] + #[serde(default = "default_2441")] pub origin: String, - #[serde(default = "default_2428")] + #[serde(default = "default_2442")] pub parent_task_id: Option, - #[serde(default = "default_2429")] + #[serde(default = "default_2443")] pub owner: String, - #[serde(default = "default_2430")] + #[serde(default = "default_2444")] pub attempt: Integer, - #[serde(default = "default_2431")] + #[serde(default = "default_2445")] pub fence: Integer, - #[serde(default = "default_2432")] + #[serde(default = "default_2446")] pub lease_until: Option, - #[serde(default = "default_2433")] + #[serde(default = "default_2447")] pub outcome: std::collections::HashMap, - #[serde(default = "default_2434")] + #[serde(default = "default_2448")] pub last_actor: String, pub created_at: String, pub updated_at: String, @@ -55773,7 +55965,7 @@ pub struct TaskPayload { #[non_exhaustive] pub struct TaskOutput { pub task: TaskPayload, - #[serde(default = "default_2435")] + #[serde(default = "default_2449")] pub seq: Integer, } @@ -56174,10 +56366,10 @@ impl TaskCompleteInput { pub struct InboxCount { pub inbox: String, pub status: String, - #[serde(default = "default_2436")] + #[serde(default = "default_2450")] pub blocked_on: String, pub n: Integer, - #[serde(default = "default_2437")] + #[serde(default = "default_2451")] pub oldest: Option, } @@ -56264,7 +56456,7 @@ pub struct TaskCreateOutput { pub task: TaskPayload, pub created: bool, pub seq: Integer, - #[serde(default = "default_2438")] + #[serde(default = "default_2452")] pub next: String, } @@ -56603,7 +56795,7 @@ impl TaskFailInput { #[non_exhaustive] pub struct TaskGetOutput { pub found: bool, - #[serde(default = "default_2439")] + #[serde(default = "default_2453")] pub task: Option, } @@ -56737,23 +56929,23 @@ pub struct TaskEventPayload { pub task_id: String, pub inbox: String, pub event: String, - #[serde(default = "default_2440")] + #[serde(default = "default_2454")] pub from_status: String, - #[serde(default = "default_2441")] + #[serde(default = "default_2455")] pub to_status: String, - #[serde(default = "default_2442")] + #[serde(default = "default_2456")] pub actor: String, - #[serde(default = "default_2443")] + #[serde(default = "default_2457")] pub agent: String, - #[serde(default = "default_2444")] + #[serde(default = "default_2458")] pub fence: Integer, - #[serde(default = "default_2445")] + #[serde(default = "default_2459")] pub version: Integer, - #[serde(default = "default_2446")] + #[serde(default = "default_2460")] pub reason: String, - #[serde(default = "default_2447")] + #[serde(default = "default_2461")] pub patch: std::collections::HashMap, - #[serde(default = "default_2448")] + #[serde(default = "default_2462")] pub note: String, pub ts: String, } @@ -57093,7 +57285,7 @@ pub struct TaskPullOutput { pub tasks: Vec, pub waited_ms: Integer, pub backend: String, - #[serde(default = "default_2449")] + #[serde(default = "default_2463")] pub note: String, } @@ -57489,7 +57681,7 @@ impl TaskUnblockInput { pub struct TaskUpdateOutput { pub task: TaskPayload, pub seq: Integer, - #[serde(default = "default_2450")] + #[serde(default = "default_2464")] pub conflict: bool, } @@ -57852,19 +58044,19 @@ impl TaskReasonInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerAnswerOutput { - #[serde(default = "default_2451")] + #[serde(default = "default_2465")] pub intent: String, - #[serde(default = "default_2452")] + #[serde(default = "default_2466")] pub anchors: std::collections::HashMap, - #[serde(default = "default_2453")] + #[serde(default = "default_2467")] pub sections: Vec>, - #[serde(default = "default_2454")] + #[serde(default = "default_2468")] pub searched: Vec, - #[serde(default = "default_2455")] + #[serde(default = "default_2469")] pub lines: Vec, - #[serde(default = "default_2456")] + #[serde(default = "default_2470")] pub restricted: bool, - #[serde(default = "default_2457")] + #[serde(default = "default_2471")] pub verdict: String, } @@ -57960,17 +58152,17 @@ impl TrackerAnswerInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerBindingOutput { - #[serde(default = "default_2458")] + #[serde(default = "default_2472")] pub tracker_namespace: String, - #[serde(default = "default_2459")] + #[serde(default = "default_2473")] pub tracker_namespaces: Vec, - #[serde(default = "default_2460")] + #[serde(default = "default_2474")] pub restricted: bool, - #[serde(default = "default_2461")] + #[serde(default = "default_2475")] pub kind: String, - #[serde(default = "default_2462")] + #[serde(default = "default_2476")] pub authorized: bool, - #[serde(default = "default_2463")] + #[serde(default = "default_2477")] pub templates: Vec, } @@ -58023,13 +58215,13 @@ impl TrackerBindingInput { #[non_exhaustive] pub struct TrackerComponentOutput { pub component: String, - #[serde(default = "default_2464")] + #[serde(default = "default_2478")] pub risk: std::collections::HashMap, - #[serde(default = "default_2465")] + #[serde(default = "default_2479")] pub open_issues: Vec>, - #[serde(default = "default_2466")] + #[serde(default = "default_2480")] pub known: bool, - #[serde(default = "default_2467")] + #[serde(default = "default_2481")] pub tracker_unavailable: bool, } @@ -58090,9 +58282,9 @@ impl TrackerComponentInput { #[non_exhaustive] pub struct TrackerContractOutput { pub database: String, - #[serde(default = "default_2468")] + #[serde(default = "default_2482")] pub tables: Vec>, - #[serde(default = "default_2469")] + #[serde(default = "default_2483")] pub templates: std::collections::HashMap, } @@ -58145,66 +58337,66 @@ impl TrackerContractInput { #[non_exhaustive] pub struct TrackerLegStatus { pub name: String, - #[serde(default = "default_2480")] + #[serde(default = "default_2494")] pub status: String, - #[serde(default = "default_2481")] + #[serde(default = "default_2495")] pub reason: String, - #[serde(default = "default_2482")] + #[serde(default = "default_2496")] pub message: String, - #[serde(default = "default_2483")] + #[serde(default = "default_2497")] pub retried: bool, - #[serde(default = "default_2484")] + #[serde(default = "default_2498")] pub ms: Integer, - #[serde(default = "default_2485")] + #[serde(default = "default_2499")] pub cause: String, - #[serde(default = "default_2486")] + #[serde(default = "default_2500")] pub namespace: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerDuplicateCheckOutput { - #[serde(default = "default_2470")] + #[serde(default = "default_2484")] pub verdict: String, - #[serde(default = "default_2471")] + #[serde(default = "default_2485")] pub items: Vec>, - #[serde(default = "default_2472")] + #[serde(default = "default_2486")] pub undecided: bool, - #[serde(default = "default_2473")] + #[serde(default = "default_2487")] pub epistemic: String, - #[serde(default = "default_2474")] + #[serde(default = "default_2488")] pub thresholds: std::collections::HashMap, - #[serde(default = "default_2475")] + #[serde(default = "default_2489")] pub judge: std::collections::HashMap, - #[serde(default = "default_2476")] + #[serde(default = "default_2490")] pub fit_at: String, - #[serde(default = "default_2477")] + #[serde(default = "default_2491")] pub fit: std::collections::HashMap, - #[serde(default = "default_2478")] + #[serde(default = "default_2492")] pub query: std::collections::HashMap, - #[serde(default = "default_2479")] + #[serde(default = "default_2493")] pub legs: std::collections::HashMap, - #[serde(default = "default_2487")] + #[serde(default = "default_2501")] pub leg_status: Vec, - #[serde(default = "default_2488")] + #[serde(default = "default_2502")] pub tracker_unavailable: bool, - #[serde(default = "default_2489")] + #[serde(default = "default_2503")] pub namespaces: Vec, - #[serde(default = "default_2490")] + #[serde(default = "default_2504")] pub by_namespace: std::collections::HashMap>, - #[serde(default = "default_2491")] + #[serde(default = "default_2505")] pub closest: Vec>, - #[serde(default = "default_2492")] + #[serde(default = "default_2506")] pub needs: Vec>, - #[serde(default = "default_2493")] + #[serde(default = "default_2507")] pub closest_note: String, - #[serde(default = "default_2494")] + #[serde(default = "default_2508")] pub nearest: Vec>, - #[serde(default = "default_2495")] + #[serde(default = "default_2509")] pub rerank: std::collections::HashMap, - #[serde(default = "default_2496")] + #[serde(default = "default_2510")] pub answer: String, - #[serde(default = "default_2497")] + #[serde(default = "default_2511")] pub related_prs: Vec>, } @@ -58411,17 +58603,17 @@ impl TrackerDuplicateCheckInput { #[non_exhaustive] pub struct TrackerFlakyOutput { pub test_name: String, - #[serde(default = "default_2498")] + #[serde(default = "default_2512")] pub known_flaky: bool, - #[serde(default = "default_2499")] + #[serde(default = "default_2513")] pub open_issues: Integer, - #[serde(default = "default_2500")] + #[serde(default = "default_2514")] pub issues: Vec>, - #[serde(default = "default_2501")] + #[serde(default = "default_2515")] pub verdict: String, - #[serde(default = "default_2502")] + #[serde(default = "default_2516")] pub tracker_unavailable: bool, - #[serde(default = "default_2503")] + #[serde(default = "default_2517")] pub signal: Option>, } @@ -58504,9 +58696,9 @@ impl TrackerFlakyInput { #[non_exhaustive] pub struct TrackerItemOutput { pub items: Vec>, - #[serde(default = "default_2504")] + #[serde(default = "default_2518")] pub unknown: Vec, - #[serde(default = "default_2505")] + #[serde(default = "default_2519")] pub tracker_unavailable: bool, } @@ -58555,19 +58747,19 @@ impl TrackerItemInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerLinksOutput { - #[serde(default = "default_2506")] + #[serde(default = "default_2520")] pub subject: std::collections::HashMap, - #[serde(default = "default_2507")] + #[serde(default = "default_2521")] pub verdict: String, - #[serde(default = "default_2508")] + #[serde(default = "default_2522")] pub items: Vec>, - #[serde(default = "default_2509")] + #[serde(default = "default_2523")] pub epistemic: String, - #[serde(default = "default_2510")] + #[serde(default = "default_2524")] pub record: std::collections::HashMap, - #[serde(default = "default_2511")] + #[serde(default = "default_2525")] pub computed_at: String, - #[serde(default = "default_2512")] + #[serde(default = "default_2526")] pub tracker_unavailable: bool, } @@ -58665,11 +58857,11 @@ impl TrackerLinksInput { pub struct TrackerReleaseOutput { pub version: String, pub blockers: Vec>, - #[serde(default = "default_2513")] + #[serde(default = "default_2527")] pub active_blockers: Integer, - #[serde(default = "default_2514")] + #[serde(default = "default_2528")] pub health: std::collections::HashMap, - #[serde(default = "default_2515")] + #[serde(default = "default_2529")] pub tracker_unavailable: bool, } @@ -58718,17 +58910,17 @@ impl TrackerReleaseInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerSimilarOutput { - #[serde(default = "default_2516")] + #[serde(default = "default_2530")] pub items: Vec>, - #[serde(default = "default_2517")] + #[serde(default = "default_2531")] pub query: std::collections::HashMap, - #[serde(default = "default_2518")] + #[serde(default = "default_2532")] pub legs: std::collections::HashMap, - #[serde(default = "default_2519")] + #[serde(default = "default_2533")] pub epistemic: String, - #[serde(default = "default_2520")] + #[serde(default = "default_2534")] pub tracker_unavailable: bool, - #[serde(default = "default_2521")] + #[serde(default = "default_2535")] pub namespaces: Vec, } @@ -58849,19 +59041,19 @@ pub struct TrackerSourceAddOutput { pub name: String, pub host: String, pub database: String, - #[serde(default = "default_2522")] + #[serde(default = "default_2536")] pub namespaces: Vec>, - #[serde(default = "default_2523")] + #[serde(default = "default_2537")] pub contract: std::collections::HashMap, - #[serde(default = "default_2524")] + #[serde(default = "default_2538")] pub roles: Vec, - #[serde(default = "default_2525")] + #[serde(default = "default_2539")] pub my_role: String, - #[serde(default = "default_2526")] + #[serde(default = "default_2540")] pub dry_run: bool, - #[serde(default = "default_2527")] + #[serde(default = "default_2541")] pub written: bool, - #[serde(default = "default_2528")] + #[serde(default = "default_2542")] pub view_templates: std::collections::HashMap, } @@ -59024,13 +59216,13 @@ impl TrackerSourceAddInput { #[non_exhaustive] pub struct TrackerSourceCheckOutput { pub name: String, - #[serde(default = "default_2529")] + #[serde(default = "default_2543")] pub database: String, - #[serde(default = "default_2530")] + #[serde(default = "default_2544")] pub reachable: bool, - #[serde(default = "default_2531")] + #[serde(default = "default_2545")] pub contract: std::collections::HashMap, - #[serde(default = "default_2532")] + #[serde(default = "default_2546")] pub view_templates: std::collections::HashMap, } @@ -59070,11 +59262,11 @@ impl TrackerSourceCheckInput { pub struct TrackerSourceInspectOutput { pub host: String, pub database: String, - #[serde(default = "default_2533")] + #[serde(default = "default_2547")] pub tables: Vec>, - #[serde(default = "default_2534")] + #[serde(default = "default_2548")] pub roles: Vec, - #[serde(default = "default_2535")] + #[serde(default = "default_2549")] pub proposal: std::collections::HashMap, } @@ -59203,9 +59395,9 @@ impl TrackerSourceInspectInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerSourceListOutput { - #[serde(default = "default_2536")] + #[serde(default = "default_2550")] pub sources: Vec>, - #[serde(default = "default_2537")] + #[serde(default = "default_2551")] pub self_service: bool, } @@ -59258,9 +59450,9 @@ impl TrackerSourceListInput { #[non_exhaustive] pub struct TrackerSourceRemoveOutput { pub name: String, - #[serde(default = "default_2538")] + #[serde(default = "default_2552")] pub deactivated: bool, - #[serde(default = "default_2539")] + #[serde(default = "default_2553")] pub namespaces_retired: Vec, } @@ -59301,9 +59493,9 @@ impl TrackerSourceRemoveInput { #[non_exhaustive] pub struct TrackerSourceRotateOutput { pub name: String, - #[serde(default = "default_2540")] + #[serde(default = "default_2554")] pub contract: std::collections::HashMap, - #[serde(default = "default_2541")] + #[serde(default = "default_2555")] pub rotated_at: String, } @@ -59350,11 +59542,11 @@ impl TrackerSourceRotateInput { #[non_exhaustive] pub struct TrackerSourceSetMappingOutput { pub name: String, - #[serde(default = "default_2542")] + #[serde(default = "default_2556")] pub contract: std::collections::HashMap, - #[serde(default = "default_2543")] + #[serde(default = "default_2557")] pub dry_run: bool, - #[serde(default = "default_2544")] + #[serde(default = "default_2558")] pub written: bool, } @@ -59421,45 +59613,45 @@ impl TrackerSourceSetMappingInput { #[non_exhaustive] pub struct TrackerTestSignalOutput { pub test_name: String, - #[serde(default = "default_2545")] + #[serde(default = "default_2559")] pub verdict: String, - #[serde(default = "default_2546")] + #[serde(default = "default_2560")] pub why: Vec, - #[serde(default = "default_2547")] + #[serde(default = "default_2561")] pub lower_bound: f64, - #[serde(default = "default_2548")] + #[serde(default = "default_2562")] pub window_days: Integer, - #[serde(default = "default_2549")] + #[serde(default = "default_2563")] pub since: String, - #[serde(default = "default_2550")] + #[serde(default = "default_2564")] pub features: std::collections::HashMap, - #[serde(default = "default_2551")] + #[serde(default = "default_2565")] pub infra: std::collections::HashMap, - #[serde(default = "default_2552")] + #[serde(default = "default_2566")] pub churn: std::collections::HashMap, - #[serde(default = "default_2553")] + #[serde(default = "default_2567")] pub thresholds: std::collections::HashMap, - #[serde(default = "default_2554")] + #[serde(default = "default_2568")] pub source: String, - #[serde(default = "default_2555")] + #[serde(default = "default_2569")] pub timings_ms: std::collections::HashMap, - #[serde(default = "default_2556")] + #[serde(default = "default_2570")] pub tracker_unavailable: bool, - #[serde(default = "default_2557")] + #[serde(default = "default_2571")] pub rollup: std::collections::HashMap, - #[serde(default = "default_2558")] + #[serde(default = "default_2572")] pub streak: std::collections::HashMap, - #[serde(default = "default_2559")] + #[serde(default = "default_2573")] pub smells: std::collections::HashMap, - #[serde(default = "default_2560")] + #[serde(default = "default_2574")] pub prior: std::collections::HashMap, - #[serde(default = "default_2561")] + #[serde(default = "default_2575")] pub unavailable_reason: String, - #[serde(default = "default_2562")] + #[serde(default = "default_2576")] pub candidates: Vec>, - #[serde(default = "default_2563")] + #[serde(default = "default_2577")] pub candidate_matches: Integer, - #[serde(default = "default_2564")] + #[serde(default = "default_2578")] pub resolved_from: String, } @@ -59563,9 +59755,9 @@ impl TrackerTestSignalInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct UiVitalsOutput { - #[serde(default = "default_2565")] + #[serde(default = "default_2579")] pub recorded: bool, - #[serde(default = "default_2566")] + #[serde(default = "default_2580")] pub route: String, } @@ -59749,7 +59941,7 @@ pub struct WebhookDelivery { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct WebhookDeliveriesOutput { - #[serde(default = "default_2567")] + #[serde(default = "default_2581")] pub deliveries: Vec, } @@ -59871,14 +60063,14 @@ pub struct WebhookInfo { pub secret_ref: String, pub events: Vec, pub created_at: String, - #[serde(default = "default_2568")] + #[serde(default = "default_2582")] pub secret_present: bool, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct WebhookListOutput { - #[serde(default = "default_2569")] + #[serde(default = "default_2583")] pub webhooks: Vec, } @@ -60060,7 +60252,7 @@ pub struct WorkingMemoryMutationOutput { pub version: Integer, pub char_limit: Integer, pub value_length: Integer, - #[serde(default = "default_2570")] + #[serde(default = "default_2584")] pub fill_ratio: f64, } @@ -60284,15 +60476,15 @@ impl WorkingMemoryDeleteInput { pub struct WorkingMemoryGetOutput { pub found: bool, pub block_key: String, - #[serde(default = "default_2571")] + #[serde(default = "default_2585")] pub content: String, - #[serde(default = "default_2572")] + #[serde(default = "default_2586")] pub char_limit: Integer, - #[serde(default = "default_2573")] + #[serde(default = "default_2587")] pub version: Integer, - #[serde(default = "default_2574")] + #[serde(default = "default_2588")] pub updated_at: Option, - #[serde(default = "default_2575")] + #[serde(default = "default_2589")] pub fill_ratio: f64, } @@ -60403,7 +60595,7 @@ pub struct WorkingMemoryBlock { pub content: String, pub char_limit: Integer, pub version: Integer, - #[serde(default = "default_2576")] + #[serde(default = "default_2590")] pub updated_at: Option, } @@ -60411,7 +60603,7 @@ pub struct WorkingMemoryBlock { #[non_exhaustive] pub struct WorkingMemoryRenderOutput { pub rendered: String, - #[serde(default = "default_2577")] + #[serde(default = "default_2591")] pub blocks: Vec, pub block_count: Integer, pub total_chars: Integer, @@ -63408,8 +63600,8 @@ fn default_874() -> Option { fn default_875() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_876() -> Option { - serde_json::from_str("null").expect("schema default") +fn default_876() -> String { + serde_json::from_str("\"\"").expect("schema default") } fn default_877() -> Option { serde_json::from_str("null").expect("schema default") @@ -63417,5114 +63609,5159 @@ fn default_877() -> Option { fn default_878() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_879() -> Option> { +fn default_879() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_880() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_881() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_882() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_883() -> ConflictSourceCounts { + serde_json::from_str("{\"plugin_captured\":0,\"caller_written\":0,\"unknown\":0}") + .expect("schema default") +} +fn default_884() -> ConflictSourceCounts { + serde_json::from_str("{\"plugin_captured\":0,\"caller_written\":0,\"unknown\":0}") + .expect("schema default") +} +fn default_885() -> ConflictSourceCounts { + serde_json::from_str("{\"plugin_captured\":0,\"caller_written\":0,\"unknown\":0}") + .expect("schema default") +} +fn default_886() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_880() -> Vec { +fn default_887() -> Option> { + serde_json::from_str("null").expect("schema default") +} +fn default_888() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_881() -> String { +fn default_889() -> String { serde_json::from_str("\"conflicts.resolve\"").expect("schema default") } -fn default_882() -> Vec { +fn default_890() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_883() -> String { +fn default_891() -> String { serde_json::from_str("\"No changes were applied.\"").expect("schema default") } -fn default_884() -> Option { +fn default_892() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_885() -> Option { +fn default_893() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_886() -> bool { +fn default_894() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_887() -> bool { +fn default_895() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_888() -> Option { +fn default_896() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_889() -> Vec { +fn default_897() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_890() -> String { +fn default_898() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_891() -> String { +fn default_899() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_892() -> String { +fn default_900() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_893() -> Integer { +fn default_901() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_894() -> Integer { +fn default_902() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_895() -> Integer { +fn default_903() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_896() -> Integer { +fn default_904() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_897() -> Integer { +fn default_905() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_898() -> Option { +fn default_906() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_899() -> bool { +fn default_907() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_900() -> ConversationAppendOutputReason { +fn default_908() -> ConversationAppendOutputReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_901() -> String { +fn default_909() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_902() -> Integer { +fn default_910() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_903() -> Integer { +fn default_911() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_904() -> String { +fn default_912() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_905() -> String { +fn default_913() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_906() -> std::collections::HashMap { +fn default_914() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_907() -> String { +fn default_915() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_908() -> String { +fn default_916() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_909() -> String { +fn default_917() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_910() -> Option { +fn default_918() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_911() -> Option { +fn default_919() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_912() -> Integer { +fn default_920() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_913() -> String { +fn default_921() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_914() -> Vec { +fn default_922() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_915() -> Option { +fn default_923() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_916() -> Option { +fn default_924() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_917() -> Option { +fn default_925() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_918() -> ConversationSaveMessageOutputReason { +fn default_926() -> ConversationSaveMessageOutputReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_919() -> String { +fn default_927() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_920() -> Vec { +fn default_928() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_921() -> bool { +fn default_929() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_922() -> Option { +fn default_930() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_923() -> Option { +fn default_931() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_924() -> Option { +fn default_932() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_925() -> Option { +fn default_933() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_926() -> Option { +fn default_934() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_927() -> Option { +fn default_935() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_928() -> Option { +fn default_936() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_929() -> Option { +fn default_937() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_930() -> Option { +fn default_938() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_931() -> Option { +fn default_939() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_932() -> Integer { +fn default_940() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_933() -> Vec { +fn default_941() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_934() -> f64 { +fn default_942() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_935() -> Integer { +fn default_943() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_936() -> Option { +fn default_944() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_937() -> Option { +fn default_945() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_938() -> Option { +fn default_946() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_939() -> Option { +fn default_947() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_940() -> Option { +fn default_948() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_941() -> Option { +fn default_949() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_942() -> Option { +fn default_950() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_943() -> Option { +fn default_951() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_944() -> Option { +fn default_952() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_945() -> Option { +fn default_953() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_946() -> Integer { +fn default_954() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_947() -> f64 { +fn default_955() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_948() -> Integer { +fn default_956() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_949() -> f64 { +fn default_957() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_950() -> String { +fn default_958() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_951() -> String { +fn default_959() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_952() -> String { +fn default_960() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_953() -> String { +fn default_961() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_954() -> Vec { +fn default_962() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_955() -> Option { +fn default_963() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_956() -> String { +fn default_964() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_957() -> String { +fn default_965() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_958() -> String { +fn default_966() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_959() -> Option { +fn default_967() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_960() -> String { +fn default_968() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_961() -> DecisionRowStage { +fn default_969() -> DecisionRowStage { serde_json::from_str("\"decided\"").expect("schema default") } -fn default_962() -> f64 { +fn default_970() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_963() -> Option { +fn default_971() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_964() -> Option { +fn default_972() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_965() -> Integer { +fn default_973() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_966() -> String { +fn default_974() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_967() -> bool { +fn default_975() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_968() -> Integer { +fn default_976() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_969() -> String { +fn default_977() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_970() -> bool { +fn default_978() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_971() -> Option { +fn default_979() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_972() -> String { +fn default_980() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_973() -> Integer { +fn default_981() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_974() -> Integer { +fn default_982() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_975() -> Integer { +fn default_983() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_976() -> Option { +fn default_984() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_977() -> String { +fn default_985() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_978() -> Option { +fn default_986() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_979() -> Integer { +fn default_987() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_980() -> std::collections::HashMap { +fn default_988() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_981() -> Option { +fn default_989() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_982() -> Option> { +fn default_990() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_983() -> bool { +fn default_991() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_984() -> String { +fn default_992() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_985() -> Vec { +fn default_993() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_986() -> Option { +fn default_994() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_987() -> Option { +fn default_995() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_988() -> Option { +fn default_996() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_989() -> Option { +fn default_997() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_990() -> Option { +fn default_998() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_991() -> Option { +fn default_999() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_992() -> Option { +fn default_1000() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_993() -> Option { +fn default_1001() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_994() -> Option { +fn default_1002() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_995() -> Integer { +fn default_1003() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_996() -> std::collections::HashMap { +fn default_1004() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_997() -> Option { +fn default_1005() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_998() -> Option> { +fn default_1006() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_999() -> bool { +fn default_1007() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1000() -> String { +fn default_1008() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1001() -> String { +fn default_1009() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1002() -> String { +fn default_1010() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1003() -> Option { +fn default_1011() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1004() -> String { +fn default_1012() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1005() -> String { +fn default_1013() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1006() -> Option { +fn default_1014() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1007() -> Vec { +fn default_1015() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1008() -> String { +fn default_1016() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1009() -> Vec { +fn default_1017() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1010() -> Vec { +fn default_1018() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1011() -> bool { +fn default_1019() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1012() -> bool { +fn default_1020() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1013() -> String { +fn default_1021() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1014() -> String { +fn default_1022() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1015() -> Option { +fn default_1023() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1016() -> Option { +fn default_1024() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1017() -> Option { +fn default_1025() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1018() -> bool { +fn default_1026() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1019() -> Integer { +fn default_1027() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1020() -> String { +fn default_1028() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1021() -> String { +fn default_1029() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1022() -> String { +fn default_1030() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1023() -> String { +fn default_1031() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1024() -> String { +fn default_1032() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1025() -> Option { +fn default_1033() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1026() -> Vec { +fn default_1034() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1027() -> bool { +fn default_1035() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1028() -> Vec { +fn default_1036() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1029() -> Option { +fn default_1037() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1030() -> Option { +fn default_1038() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1031() -> bool { +fn default_1039() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1032() -> String { +fn default_1040() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_1033() -> Option { +fn default_1041() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1034() -> Option { +fn default_1042() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1035() -> Option { +fn default_1043() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1036() -> String { +fn default_1044() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1037() -> String { +fn default_1045() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1038() -> String { +fn default_1046() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1039() -> HelpGetOutputAudience { +fn default_1047() -> HelpGetOutputAudience { serde_json::from_str("\"user\"").expect("schema default") } -fn default_1040() -> String { +fn default_1048() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1041() -> bool { +fn default_1049() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1042() -> Integer { +fn default_1050() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1043() -> String { +fn default_1051() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1044() -> Vec { +fn default_1052() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1045() -> String { +fn default_1053() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1046() -> Vec { +fn default_1054() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1047() -> Vec { +fn default_1055() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1048() -> String { +fn default_1056() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1049() -> String { +fn default_1057() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1050() -> String { +fn default_1058() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1051() -> Vec { +fn default_1059() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1052() -> String { +fn default_1060() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1053() -> bool { +fn default_1061() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1054() -> Vec { +fn default_1062() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1055() -> Vec { +fn default_1063() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1056() -> Option { +fn default_1064() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1057() -> bool { +fn default_1065() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1058() -> bool { +fn default_1066() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1059() -> Vec { +fn default_1067() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1060() -> Vec> { +fn default_1068() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1061() -> Integer { +fn default_1069() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1062() -> bool { +fn default_1070() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1063() -> String { +fn default_1071() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1064() -> String { +fn default_1072() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1065() -> Integer { +fn default_1073() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1066() -> Integer { +fn default_1074() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1067() -> Vec { +fn default_1075() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1068() -> Integer { +fn default_1076() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1069() -> Vec { +fn default_1077() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1070() -> bool { +fn default_1078() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1071() -> String { +fn default_1079() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1072() -> Option { +fn default_1080() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1073() -> Option { +fn default_1081() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1074() -> Vec> { +fn default_1082() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1075() -> Option { +fn default_1083() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1076() -> bool { +fn default_1084() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1077() -> Integer { +fn default_1085() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1078() -> Vec { +fn default_1086() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1079() -> Vec> { +fn default_1087() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1080() -> Vec { +fn default_1088() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1081() -> Vec> { +fn default_1089() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1082() -> Vec { +fn default_1090() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1083() -> String { +fn default_1091() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1084() -> Vec { +fn default_1092() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1085() -> Vec { +fn default_1093() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1086() -> Option { +fn default_1094() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1087() -> Vec { +fn default_1095() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1088() -> Integer { +fn default_1096() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1089() -> Vec { +fn default_1097() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1090() -> String { +fn default_1098() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1091() -> Vec { +fn default_1099() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1092() -> Vec { +fn default_1100() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1093() -> Option { +fn default_1101() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1094() -> Option { +fn default_1102() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1095() -> bool { +fn default_1103() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1096() -> String { +fn default_1104() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1097() -> String { +fn default_1105() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1098() -> bool { +fn default_1106() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1099() -> String { +fn default_1107() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1100() -> String { +fn default_1108() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1101() -> String { +fn default_1109() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1102() -> Integer { +fn default_1110() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1103() -> String { +fn default_1111() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1104() -> String { +fn default_1112() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1105() -> String { +fn default_1113() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1106() -> Option> { +fn default_1114() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_1107() -> Vec { +fn default_1115() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1108() -> Integer { +fn default_1116() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1109() -> Integer { +fn default_1117() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1110() -> Option { +fn default_1118() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1111() -> String { +fn default_1119() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1112() -> String { +fn default_1120() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1113() -> bool { +fn default_1121() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1114() -> Option { +fn default_1122() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1115() -> Option { +fn default_1123() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1116() -> Option { +fn default_1124() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1117() -> Option { +fn default_1125() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1118() -> Option { +fn default_1126() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1119() -> Vec { +fn default_1127() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1120() -> Vec { +fn default_1128() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1121() -> Option { +fn default_1129() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1122() -> Option { +fn default_1130() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1123() -> Option { +fn default_1131() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1124() -> String { +fn default_1132() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1125() -> Option { +fn default_1133() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1126() -> Option { +fn default_1134() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1127() -> Option { +fn default_1135() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1128() -> Vec { +fn default_1136() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1129() -> Vec { +fn default_1137() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1130() -> Option { +fn default_1138() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1131() -> String { +fn default_1139() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1132() -> Option { +fn default_1140() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1133() -> Vec { +fn default_1141() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1134() -> Option { +fn default_1142() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1135() -> Option { +fn default_1143() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1136() -> Option { +fn default_1144() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1137() -> String { +fn default_1145() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1138() -> Option { +fn default_1146() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1139() -> Option { +fn default_1147() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1140() -> bool { +fn default_1148() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1141() -> bool { +fn default_1149() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1142() -> Option { +fn default_1150() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1143() -> Vec { +fn default_1151() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1144() -> bool { +fn default_1152() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1145() -> Option { +fn default_1153() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1146() -> Option { +fn default_1154() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1147() -> Vec { +fn default_1155() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1148() -> String { +fn default_1156() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1149() -> String { +fn default_1157() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1150() -> Vec { +fn default_1158() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1151() -> Integer { +fn default_1159() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1152() -> Vec { +fn default_1160() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1153() -> Vec { +fn default_1161() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1154() -> Vec { +fn default_1162() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1155() -> Vec { +fn default_1163() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1156() -> Vec { +fn default_1164() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1157() -> Option { +fn default_1165() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1158() -> Option { +fn default_1166() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1159() -> Option { +fn default_1167() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1160() -> Option { +fn default_1168() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1161() -> Option { +fn default_1169() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1162() -> Option { +fn default_1170() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1163() -> Option { +fn default_1171() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1164() -> Option { +fn default_1172() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1165() -> Option { +fn default_1173() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1166() -> Option { +fn default_1174() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1167() -> Option { +fn default_1175() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1168() -> Option { +fn default_1176() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1169() -> Vec { +fn default_1177() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1170() -> Option { +fn default_1178() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1171() -> Option { +fn default_1179() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1172() -> Vec { +fn default_1180() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1173() -> Option { +fn default_1181() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1174() -> Option { +fn default_1182() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1175() -> Vec { +fn default_1183() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1176() -> String { +fn default_1184() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1177() -> String { +fn default_1185() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1178() -> Vec { +fn default_1186() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1179() -> Vec { +fn default_1187() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1180() -> Integer { +fn default_1188() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1181() -> Vec { +fn default_1189() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1182() -> Vec { +fn default_1190() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1183() -> Vec { +fn default_1191() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1184() -> Vec { +fn default_1192() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1185() -> Option { +fn default_1193() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1186() -> String { +fn default_1194() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1187() -> bool { +fn default_1195() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1188() -> KnowledgeMoveResultReason { +fn default_1196() -> KnowledgeMoveResultReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_1189() -> Vec { +fn default_1197() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1190() -> String { +fn default_1198() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1191() -> bool { +fn default_1199() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1192() -> Integer { +fn default_1200() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1193() -> Vec { +fn default_1201() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1194() -> Option { +fn default_1202() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1195() -> Vec { +fn default_1203() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1196() -> Vec> { +fn default_1204() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1197() -> bool { +fn default_1205() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1198() -> Vec { +fn default_1206() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1199() -> bool { +fn default_1207() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1200() -> Vec { +fn default_1208() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1201() -> Vec> { +fn default_1209() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1202() -> KnowledgeRestoreOutputReason { +fn default_1210() -> KnowledgeRestoreOutputReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_1203() -> String { +fn default_1211() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1204() -> Option { +fn default_1212() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1205() -> Integer { +fn default_1213() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1206() -> KnowledgeRestoreOutputOriginal { +fn default_1214() -> KnowledgeRestoreOutputOriginal { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1207() -> Option { +fn default_1215() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1208() -> Vec> { +fn default_1216() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1209() -> Vec { +fn default_1217() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1210() -> std::collections::HashMap { +fn default_1218() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1211() -> Integer { +fn default_1219() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1212() -> bool { +fn default_1220() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1213() -> Vec { +fn default_1221() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1214() -> Integer { +fn default_1222() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1215() -> bool { +fn default_1223() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1216() -> KnowledgeSourceProbe { +fn default_1224() -> KnowledgeSourceProbe { serde_json::from_str( "{\"documents\":0,\"more\":false,\"sample\":[],\"checked\":0,\"sampled\":false}", ) .expect("schema default") } -fn default_1217() -> bool { +fn default_1225() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1218() -> bool { +fn default_1226() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1219() -> Integer { +fn default_1227() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1220() -> bool { +fn default_1228() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1221() -> Vec { +fn default_1229() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1222() -> Integer { +fn default_1230() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1223() -> bool { +fn default_1231() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1224() -> String { +fn default_1232() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1225() -> String { +fn default_1233() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1226() -> String { +fn default_1234() -> String { serde_json::from_str("\"shared\"").expect("schema default") } -fn default_1227() -> bool { +fn default_1235() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1228() -> String { +fn default_1236() -> String { serde_json::from_str("\"namespace\"").expect("schema default") } -fn default_1229() -> std::collections::HashMap { +fn default_1237() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1230() -> String { +fn default_1238() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1231() -> Vec> { +fn default_1239() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1232() -> Vec { +fn default_1240() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1233() -> std::collections::HashMap { +fn default_1241() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1234() -> String { +fn default_1242() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1235() -> String { +fn default_1243() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1236() -> String { +fn default_1244() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1237() -> String { +fn default_1245() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1238() -> String { +fn default_1246() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1239() -> Integer { +fn default_1247() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1240() -> Integer { +fn default_1248() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1241() -> Integer { +fn default_1249() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1242() -> Integer { +fn default_1250() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1243() -> std::collections::HashMap { +fn default_1251() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1244() -> Integer { +fn default_1252() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1245() -> String { +fn default_1253() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1246() -> Integer { +fn default_1254() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1247() -> String { +fn default_1255() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1248() -> Integer { +fn default_1256() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1249() -> Integer { +fn default_1257() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1250() -> Integer { +fn default_1258() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1251() -> String { +fn default_1259() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1252() -> KnowledgeSourceSync { +fn default_1260() -> KnowledgeSourceSync { serde_json::from_str("{\"requested_at\":\"\",\"last_synced_at\":\"\",\"status\":\"\",\"documents_seen\":0,\"changed\":0,\"removed\":0,\"unconverted\":0,\"unconverted_reasons\":{},\"skipped\":0,\"error\":\"\",\"pending_extract\":0,\"last_extracted_at\":\"\",\"extracted\":0,\"flagged_pinned\":0,\"unextracted\":0,\"extract_error\":\"\"}").expect("schema default") } -fn default_1253() -> String { +fn default_1261() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1254() -> String { +fn default_1262() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1255() -> String { +fn default_1263() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1256() -> Vec { +fn default_1264() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1257() -> String { +fn default_1265() -> String { serde_json::from_str("\"shared\"").expect("schema default") } -fn default_1258() -> bool { +fn default_1266() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1259() -> String { +fn default_1267() -> String { serde_json::from_str("\"namespace\"").expect("schema default") } -fn default_1260() -> std::collections::HashMap { +fn default_1268() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1261() -> String { +fn default_1269() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1262() -> Vec> { +fn default_1270() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1263() -> Vec { +fn default_1271() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1264() -> std::collections::HashMap { +fn default_1272() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1265() -> String { +fn default_1273() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1266() -> String { +fn default_1274() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1267() -> KnowledgeSourceSync { +fn default_1275() -> KnowledgeSourceSync { serde_json::from_str("{\"requested_at\":\"\",\"last_synced_at\":\"\",\"status\":\"\",\"documents_seen\":0,\"changed\":0,\"removed\":0,\"unconverted\":0,\"unconverted_reasons\":{},\"skipped\":0,\"error\":\"\",\"pending_extract\":0,\"last_extracted_at\":\"\",\"extracted\":0,\"flagged_pinned\":0,\"unextracted\":0,\"extract_error\":\"\"}").expect("schema default") } -fn default_1268() -> Vec { +fn default_1276() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1269() -> bool { +fn default_1277() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1270() -> bool { +fn default_1278() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1271() -> bool { +fn default_1279() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1272() -> String { +fn default_1280() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1273() -> std::collections::HashMap { +fn default_1281() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1274() -> String { +fn default_1282() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1275() -> Vec { +fn default_1283() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1276() -> bool { +fn default_1284() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1277() -> String { +fn default_1285() -> String { serde_json::from_str("\"disabled\"").expect("schema default") } -fn default_1278() -> String { +fn default_1286() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1279() -> String { +fn default_1287() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1280() -> String { +fn default_1288() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1281() -> String { +fn default_1289() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1282() -> String { +fn default_1290() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1283() -> String { +fn default_1291() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1284() -> Integer { +fn default_1292() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1285() -> f64 { +fn default_1293() -> f64 { serde_json::from_str("0").expect("schema default") } -fn default_1286() -> Integer { +fn default_1294() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1287() -> Option { +fn default_1295() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1288() -> KnowledgeSourceProbe { +fn default_1296() -> KnowledgeSourceProbe { serde_json::from_str( "{\"documents\":0,\"more\":false,\"sample\":[],\"checked\":0,\"sampled\":false}", ) .expect("schema default") } -fn default_1289() -> String { +fn default_1297() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1290() -> bool { +fn default_1298() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1291() -> Option { +fn default_1299() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1292() -> Vec> { +fn default_1300() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1293() -> Vec { +fn default_1301() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1294() -> std::collections::HashMap { +fn default_1302() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1295() -> Vec> { +fn default_1303() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1296() -> Vec> { +fn default_1304() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1297() -> KnowledgeSourceProbe { +fn default_1305() -> KnowledgeSourceProbe { serde_json::from_str( "{\"documents\":0,\"more\":false,\"sample\":[],\"checked\":0,\"sampled\":false}", ) .expect("schema default") } -fn default_1298() -> Vec { +fn default_1306() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1299() -> Integer { +fn default_1307() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1300() -> Option> { +fn default_1308() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_1301() -> Vec { +fn default_1309() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1302() -> Vec { +fn default_1310() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1303() -> bool { +fn default_1311() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1304() -> bool { +fn default_1312() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1305() -> String { +fn default_1313() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1306() -> String { +fn default_1314() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1307() -> Vec> { +fn default_1315() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1308() -> bool { +fn default_1316() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1309() -> Vec { +fn default_1317() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1310() -> Vec { +fn default_1318() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1311() -> String { +fn default_1319() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1312() -> String { +fn default_1320() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1313() -> String { +fn default_1321() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1314() -> Vec { +fn default_1322() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1315() -> Integer { +fn default_1323() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1316() -> String { +fn default_1324() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1317() -> Integer { +fn default_1325() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1318() -> String { +fn default_1326() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1319() -> String { +fn default_1327() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1320() -> Integer { +fn default_1328() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1321() -> Integer { +fn default_1329() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1322() -> String { +fn default_1330() -> String { serde_json::from_str("\"memory_supporters\"").expect("schema default") } -fn default_1323() -> String { +fn default_1331() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1324() -> String { +fn default_1332() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1325() -> Option { +fn default_1333() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1326() -> String { +fn default_1334() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1327() -> String { +fn default_1335() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1328() -> bool { +fn default_1336() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1329() -> bool { +fn default_1337() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1330() -> String { +fn default_1338() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1331() -> std::collections::HashMap { +fn default_1339() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1332() -> Vec { +fn default_1340() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1333() -> String { +fn default_1341() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1334() -> String { +fn default_1342() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1335() -> String { +fn default_1343() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1336() -> Vec { +fn default_1344() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1337() -> String { +fn default_1345() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1338() -> String { +fn default_1346() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1339() -> Vec { +fn default_1347() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1340() -> Vec { +fn default_1348() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1341() -> Vec { +fn default_1349() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1342() -> Vec { +fn default_1350() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1343() -> Integer { +fn default_1351() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1344() -> Vec { +fn default_1352() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1345() -> Vec { +fn default_1353() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1346() -> Vec { +fn default_1354() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1347() -> Integer { +fn default_1355() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1348() -> Vec { +fn default_1356() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1349() -> std::collections::HashMap { +fn default_1357() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1350() -> std::collections::HashMap { +fn default_1358() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1351() -> Integer { +fn default_1359() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1352() -> Integer { +fn default_1360() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1353() -> Integer { +fn default_1361() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1354() -> Integer { +fn default_1362() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1355() -> Integer { +fn default_1363() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1356() -> Integer { +fn default_1364() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1357() -> bool { +fn default_1365() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1358() -> String { +fn default_1366() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1359() -> String { +fn default_1367() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1360() -> String { +fn default_1368() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1361() -> String { +fn default_1369() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1362() -> Option { +fn default_1370() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1363() -> String { +fn default_1371() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1364() -> Vec { +fn default_1372() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1365() -> String { +fn default_1373() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1366() -> MemoryAskOutputSource { +fn default_1374() -> MemoryAskOutputSource { serde_json::from_str("\"synthesized\"").expect("schema default") } -fn default_1367() -> bool { +fn default_1375() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1368() -> String { +fn default_1376() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1369() -> Vec { +fn default_1377() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1370() -> Vec { +fn default_1378() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1371() -> Vec { +fn default_1379() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1372() -> String { +fn default_1380() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1373() -> String { +fn default_1381() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1374() -> MemoryAskOutputRouteTier { +fn default_1382() -> MemoryAskOutputRouteTier { serde_json::from_str("\"\"").expect("schema default") } -fn default_1375() -> String { +fn default_1383() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1376() -> Integer { +fn default_1384() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1377() -> Integer { +fn default_1385() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1378() -> bool { +fn default_1386() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1379() -> f64 { +fn default_1387() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1380() -> Option { +fn default_1388() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1381() -> Option { +fn default_1389() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1382() -> bool { +fn default_1390() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1383() -> String { +fn default_1391() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1384() -> Integer { +fn default_1392() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1385() -> Integer { +fn default_1393() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1386() -> Integer { +fn default_1394() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1387() -> Integer { +fn default_1395() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1388() -> String { +fn default_1396() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1389() -> Vec { +fn default_1397() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1390() -> Integer { +fn default_1398() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1391() -> MemoryAskOutputConsistency { +fn default_1399() -> MemoryAskOutputConsistency { serde_json::from_str("\"\"").expect("schema default") } -fn default_1392() -> f64 { +fn default_1400() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1393() -> String { +fn default_1401() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1394() -> Integer { +fn default_1402() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1395() -> Integer { +fn default_1403() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1396() -> String { +fn default_1404() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1397() -> String { +fn default_1405() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1398() -> String { +fn default_1406() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1399() -> String { +fn default_1407() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1400() -> MemoryAskOutputDepth { +fn default_1408() -> MemoryAskOutputDepth { serde_json::from_str("\"\"").expect("schema default") } -fn default_1401() -> bool { +fn default_1409() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1402() -> Vec { +fn default_1410() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1403() -> Integer { +fn default_1411() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1404() -> Integer { +fn default_1412() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1405() -> Integer { +fn default_1413() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1406() -> Vec { +fn default_1414() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1407() -> Integer { +fn default_1415() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1408() -> Integer { +fn default_1416() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1409() -> Integer { +fn default_1417() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1410() -> MemoryAskOutputGrounding { +fn default_1418() -> MemoryAskOutputGrounding { serde_json::from_str("\"\"").expect("schema default") } -fn default_1411() -> String { +fn default_1419() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1412() -> Vec { +fn default_1420() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1413() -> Integer { +fn default_1421() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1414() -> Integer { +fn default_1422() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1415() -> Integer { +fn default_1423() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1416() -> Integer { +fn default_1424() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1417() -> std::collections::HashMap { +fn default_1425() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1418() -> MemoryAskOutputDeepSelector { +fn default_1426() -> MemoryAskOutputDeepSelector { serde_json::from_str("\"\"").expect("schema default") } -fn default_1419() -> MemoryAskOutputDeepFirst { +fn default_1427() -> MemoryAskOutputDeepFirst { serde_json::from_str("\"\"").expect("schema default") } -fn default_1420() -> Integer { +fn default_1428() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1421() -> Integer { +fn default_1429() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1422() -> Integer { +fn default_1430() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1423() -> Integer { +fn default_1431() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1424() -> f64 { +fn default_1432() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1425() -> Integer { +fn default_1433() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1426() -> Integer { +fn default_1434() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1427() -> Integer { +fn default_1435() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1428() -> Integer { +fn default_1436() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1429() -> Integer { +fn default_1437() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1430() -> bool { +fn default_1438() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1431() -> String { +fn default_1439() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1432() -> String { +fn default_1440() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1433() -> String { +fn default_1441() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1434() -> String { +fn default_1442() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1435() -> String { +fn default_1443() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1436() -> String { +fn default_1444() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1437() -> bool { +fn default_1445() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1438() -> String { +fn default_1446() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1439() -> Option { +fn default_1447() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1440() -> String { +fn default_1448() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1441() -> String { +fn default_1449() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1442() -> Vec { +fn default_1450() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1451() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1452() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1453() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1443() -> Option { +fn default_1454() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1444() -> bool { +fn default_1455() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1445() -> String { +fn default_1456() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1446() -> String { +fn default_1457() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1447() -> Vec { +fn default_1458() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1448() -> String { +fn default_1459() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1449() -> Vec { +fn default_1460() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1450() -> String { +fn default_1461() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1451() -> String { +fn default_1462() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1452() -> Vec { +fn default_1463() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1453() -> Vec { +fn default_1464() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1454() -> Integer { +fn default_1465() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1455() -> Vec { +fn default_1466() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1456() -> Vec { +fn default_1467() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1457() -> String { +fn default_1468() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1458() -> String { +fn default_1469() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1459() -> bool { +fn default_1470() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1460() -> String { +fn default_1471() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1461() -> String { +fn default_1472() -> String { serde_json::from_str("\"fact\"").expect("schema default") } -fn default_1462() -> String { +fn default_1473() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1463() -> bool { +fn default_1474() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1464() -> String { +fn default_1475() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1465() -> String { +fn default_1476() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1466() -> String { +fn default_1477() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1467() -> Vec { +fn default_1478() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1468() -> Vec { +fn default_1479() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1469() -> Vec { +fn default_1480() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1470() -> std::collections::HashMap { +fn default_1481() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1471() -> Vec { +fn default_1482() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1472() -> Integer { +fn default_1483() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1473() -> Vec { +fn default_1484() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1474() -> Integer { +fn default_1485() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1475() -> Integer { +fn default_1486() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1476() -> Integer { +fn default_1487() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1477() -> Integer { +fn default_1488() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1478() -> Integer { +fn default_1489() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1479() -> Integer { +fn default_1490() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1480() -> Integer { +fn default_1491() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1481() -> String { +fn default_1492() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1482() -> String { +fn default_1493() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1483() -> String { +fn default_1494() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1484() -> String { +fn default_1495() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1485() -> bool { +fn default_1496() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1486() -> Integer { +fn default_1497() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1487() -> Integer { +fn default_1498() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1488() -> Integer { +fn default_1499() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1489() -> Integer { +fn default_1500() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1490() -> Integer { +fn default_1501() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1491() -> bool { +fn default_1502() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1492() -> Vec { +fn default_1503() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1493() -> String { +fn default_1504() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1494() -> String { +fn default_1505() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1495() -> Option { +fn default_1506() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1496() -> Vec { +fn default_1507() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1497() -> bool { +fn default_1508() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1498() -> bool { +fn default_1509() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1499() -> Vec { +fn default_1510() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1500() -> bool { +fn default_1511() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1501() -> Option { +fn default_1512() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1502() -> Vec { +fn default_1513() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1503() -> Option { +fn default_1514() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1504() -> Option { +fn default_1515() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1505() -> Vec { +fn default_1516() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1506() -> Integer { +fn default_1517() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1507() -> bool { +fn default_1518() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1508() -> String { +fn default_1519() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1509() -> Integer { +fn default_1520() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1510() -> Integer { +fn default_1521() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1511() -> std::collections::HashMap { +fn default_1522() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1512() -> String { +fn default_1523() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1513() -> f64 { +fn default_1524() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1514() -> bool { +fn default_1525() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1515() -> String { +fn default_1526() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1516() -> String { +fn default_1527() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1517() -> Integer { +fn default_1528() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1518() -> Integer { +fn default_1529() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1519() -> Option { +fn default_1530() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1520() -> Vec { +fn default_1531() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1521() -> Vec { +fn default_1532() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1522() -> Option { +fn default_1533() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1523() -> Option { +fn default_1534() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1524() -> Integer { +fn default_1535() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1525() -> bool { +fn default_1536() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1526() -> String { +fn default_1537() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1527() -> String { +fn default_1538() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1528() -> String { +fn default_1539() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1529() -> String { +fn default_1540() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1530() -> Option { +fn default_1541() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1531() -> String { +fn default_1542() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1532() -> Integer { +fn default_1543() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1533() -> Integer { +fn default_1544() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1534() -> String { +fn default_1545() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1535() -> Vec { +fn default_1546() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1536() -> bool { +fn default_1547() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1537() -> Integer { +fn default_1548() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1538() -> Integer { +fn default_1549() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1539() -> Integer { +fn default_1550() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1540() -> Integer { +fn default_1551() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1541() -> Integer { +fn default_1552() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1542() -> String { +fn default_1553() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1543() -> String { +fn default_1554() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1544() -> String { +fn default_1555() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1545() -> String { +fn default_1556() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1546() -> Vec { +fn default_1557() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1547() -> Integer { +fn default_1558() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1548() -> Integer { +fn default_1559() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1549() -> String { +fn default_1560() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1550() -> String { +fn default_1561() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1551() -> Vec { +fn default_1562() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1552() -> String { +fn default_1563() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1553() -> String { +fn default_1564() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1554() -> Vec { +fn default_1565() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1555() -> Vec { +fn default_1566() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1556() -> String { +fn default_1567() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1557() -> String { +fn default_1568() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1558() -> Vec { +fn default_1569() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1559() -> f64 { +fn default_1570() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1560() -> String { +fn default_1571() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1561() -> String { +fn default_1572() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1562() -> Vec { +fn default_1573() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1563() -> bool { +fn default_1574() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1564() -> String { +fn default_1575() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1565() -> Integer { +fn default_1576() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1566() -> Vec { +fn default_1577() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1567() -> Vec { +fn default_1578() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1568() -> Vec { +fn default_1579() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1569() -> Vec { +fn default_1580() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1570() -> Vec { +fn default_1581() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1571() -> Option { +fn default_1582() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1572() -> Option { +fn default_1583() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1573() -> Vec { +fn default_1584() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1574() -> Integer { +fn default_1585() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1575() -> Integer { +fn default_1586() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1576() -> Vec { +fn default_1587() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1577() -> Vec { +fn default_1588() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1578() -> Integer { +fn default_1589() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1579() -> Integer { +fn default_1590() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1580() -> bool { +fn default_1591() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1581() -> Vec { +fn default_1592() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1582() -> f64 { +fn default_1593() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1583() -> bool { +fn default_1594() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1584() -> String { +fn default_1595() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1585() -> String { +fn default_1596() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1586() -> Option { +fn default_1597() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1587() -> String { +fn default_1598() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1588() -> String { +fn default_1599() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1589() -> String { +fn default_1600() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1590() -> String { +fn default_1601() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1591() -> MemoryForFileHitSupersedesKind { +fn default_1602() -> MemoryForFileHitSupersedesKind { serde_json::from_str("\"\"").expect("schema default") } -fn default_1592() -> Vec { +fn default_1603() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1593() -> String { +fn default_1604() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1594() -> MemoryForFileHitVerification { +fn default_1605() -> MemoryForFileHitVerification { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1595() -> MemoryForFileHitCodeState { +fn default_1606() -> MemoryForFileHitCodeState { serde_json::from_str("\"\"").expect("schema default") } -fn default_1596() -> Vec { +fn default_1607() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1597() -> String { +fn default_1608() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1598() -> Integer { +fn default_1609() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1599() -> bool { +fn default_1610() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1600() -> bool { +fn default_1611() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1601() -> Vec { +fn default_1612() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1602() -> String { +fn default_1613() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1603() -> String { +fn default_1614() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1604() -> String { +fn default_1615() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1605() -> String { +fn default_1616() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1606() -> String { +fn default_1617() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1607() -> String { +fn default_1618() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1608() -> Option { +fn default_1619() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1609() -> Value { +fn default_1620() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1610() -> Option { +fn default_1621() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1611() -> Option { +fn default_1622() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1612() -> Option { +fn default_1623() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1613() -> Option { +fn default_1624() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1614() -> Option { +fn default_1625() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1615() -> Option { +fn default_1626() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1616() -> bool { +fn default_1627() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1617() -> String { +fn default_1628() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1618() -> String { +fn default_1629() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1619() -> Option { +fn default_1630() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1620() -> String { +fn default_1631() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1621() -> String { +fn default_1632() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1622() -> String { +fn default_1633() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1623() -> String { +fn default_1634() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1624() -> String { +fn default_1635() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1625() -> String { +fn default_1636() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1626() -> Option { +fn default_1637() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1627() -> String { +fn default_1638() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1628() -> String { +fn default_1639() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1629() -> String { +fn default_1640() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1630() -> Integer { +fn default_1641() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1631() -> Vec { +fn default_1642() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1632() -> Integer { +fn default_1643() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1633() -> Option { +fn default_1644() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1634() -> Vec { +fn default_1645() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1635() -> std::collections::HashMap { +fn default_1646() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1636() -> Integer { +fn default_1647() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1637() -> f64 { +fn default_1648() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1638() -> Integer { +fn default_1649() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1639() -> Integer { +fn default_1650() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1640() -> Integer { +fn default_1651() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1641() -> Integer { +fn default_1652() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1642() -> Integer { +fn default_1653() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1643() -> MemoryHealthStaleness { +fn default_1654() -> MemoryHealthStaleness { serde_json::from_str("{\"by_age\":{},\"with_validity_end\":0,\"with_validity_end_share\":0.0,\"with_expiry\":0,\"expiring_7d\":0,\"pinned\":0,\"days_since_reinforced_p50\":0,\"days_since_reinforced_p90\":0}").expect("schema default") } -fn default_1644() -> Integer { +fn default_1655() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1645() -> Integer { +fn default_1656() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1646() -> f64 { +fn default_1657() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1647() -> MemoryHealthFootprint { +fn default_1658() -> MemoryHealthFootprint { serde_json::from_str("{\"value_chars\":0,\"value_tokens_est\":0,\"tokens_per_row_est\":0.0}") .expect("schema default") } -fn default_1648() -> String { +fn default_1659() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1649() -> Value { +fn default_1660() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1650() -> String { +fn default_1661() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1651() -> bool { +fn default_1662() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1652() -> Option { +fn default_1663() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1653() -> Option { +fn default_1664() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1654() -> Option { +fn default_1665() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1655() -> String { +fn default_1666() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1656() -> String { +fn default_1667() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1657() -> String { +fn default_1668() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1658() -> String { +fn default_1669() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1659() -> String { +fn default_1670() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1660() -> Option { +fn default_1671() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1661() -> String { +fn default_1672() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1662() -> Vec { +fn default_1673() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1663() -> Vec { +fn default_1674() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1664() -> Option { +fn default_1675() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1665() -> String { +fn default_1676() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1666() -> String { +fn default_1677() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1667() -> String { +fn default_1678() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1668() -> String { +fn default_1679() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1669() -> Option { +fn default_1680() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1670() -> Integer { +fn default_1681() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1671() -> Integer { +fn default_1682() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1672() -> Integer { +fn default_1683() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1673() -> Integer { +fn default_1684() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1674() -> MemoryImportResultReason { +fn default_1685() -> MemoryImportResultReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_1675() -> String { +fn default_1686() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1676() -> MemoryImportResultNote { +fn default_1687() -> MemoryImportResultNote { serde_json::from_str("\"\"").expect("schema default") } -fn default_1677() -> bool { +fn default_1688() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1678() -> String { +fn default_1689() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1679() -> Option { +fn default_1690() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1680() -> Integer { +fn default_1691() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1681() -> Integer { +fn default_1692() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1682() -> Integer { +fn default_1693() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1683() -> String { +fn default_1694() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1684() -> Integer { +fn default_1695() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1685() -> Vec { +fn default_1696() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1686() -> Integer { +fn default_1697() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1687() -> Integer { +fn default_1698() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1688() -> Vec { +fn default_1699() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1689() -> Integer { +fn default_1700() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1690() -> Vec { +fn default_1701() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1691() -> Vec { +fn default_1702() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1692() -> Vec { +fn default_1703() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1693() -> Vec { +fn default_1704() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1694() -> Vec { +fn default_1705() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1695() -> Option { +fn default_1706() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1696() -> Option { +fn default_1707() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1697() -> String { +fn default_1708() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1698() -> Integer { +fn default_1709() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1699() -> String { +fn default_1710() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1700() -> Vec { +fn default_1711() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1701() -> bool { +fn default_1712() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1702() -> Vec { +fn default_1713() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1703() -> Option { +fn default_1714() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1704() -> Option { +fn default_1715() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1705() -> String { +fn default_1716() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1706() -> Integer { +fn default_1717() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1707() -> String { +fn default_1718() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1708() -> Integer { +fn default_1719() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1709() -> Option { +fn default_1720() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1710() -> String { +fn default_1721() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1711() -> String { +fn default_1722() -> String { serde_json::from_str("\"Each request that extracts memories from messages may send extraction instructions; no user, agent or session setting stores them.\"").expect("schema default") } -fn default_1712() -> Vec { +fn default_1723() -> Vec { serde_json::from_str("[\"memory.set_from_messages\",\"extraction_instructions\"]") .expect("schema default") } -fn default_1713() -> Vec { +fn default_1724() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1714() -> bool { +fn default_1725() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1715() -> String { +fn default_1726() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1716() -> String { +fn default_1727() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1717() -> Option { +fn default_1728() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1718() -> String { +fn default_1729() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1719() -> String { +fn default_1730() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1720() -> String { +fn default_1731() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1721() -> MemoryLineageOutputMechanism { +fn default_1732() -> MemoryLineageOutputMechanism { serde_json::from_str("\"unknown\"").expect("schema default") } -fn default_1722() -> Vec { +fn default_1733() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1723() -> String { +fn default_1734() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1724() -> String { +fn default_1735() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1725() -> Option { +fn default_1736() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1726() -> Vec { +fn default_1737() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1727() -> f64 { +fn default_1738() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1728() -> bool { +fn default_1739() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1729() -> bool { +fn default_1740() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1730() -> Integer { +fn default_1741() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1731() -> Integer { +fn default_1742() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1732() -> String { +fn default_1743() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1733() -> bool { +fn default_1744() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1734() -> Integer { +fn default_1745() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1735() -> String { +fn default_1746() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1736() -> String { +fn default_1747() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1737() -> String { +fn default_1748() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1738() -> Option { +fn default_1749() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1739() -> String { +fn default_1750() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1740() -> Option { +fn default_1751() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1741() -> String { +fn default_1752() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1742() -> String { +fn default_1753() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1743() -> String { +fn default_1754() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1744() -> Integer { +fn default_1755() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1745() -> String { +fn default_1756() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1746() -> Vec { +fn default_1757() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1747() -> bool { +fn default_1758() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1748() -> String { +fn default_1759() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1749() -> String { +fn default_1760() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1750() -> String { +fn default_1761() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1751() -> bool { +fn default_1762() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1752() -> std::collections::HashMap { +fn default_1763() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1753() -> String { +fn default_1764() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1754() -> String { +fn default_1765() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1755() -> Integer { +fn default_1766() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1756() -> Integer { +fn default_1767() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1757() -> Vec { +fn default_1768() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1758() -> Integer { +fn default_1769() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1759() -> Integer { +fn default_1770() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1760() -> Vec { +fn default_1771() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1761() -> String { +fn default_1772() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1762() -> Integer { +fn default_1773() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1763() -> String { +fn default_1774() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1764() -> Vec { +fn default_1775() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1765() -> Integer { +fn default_1776() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1766() -> Option { +fn default_1777() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1767() -> Vec { +fn default_1778() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1768() -> Integer { +fn default_1779() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1769() -> String { +fn default_1780() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1770() -> String { +fn default_1781() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1771() -> Vec { +fn default_1782() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1772() -> String { +fn default_1783() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1773() -> String { +fn default_1784() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1774() -> String { +fn default_1785() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1775() -> String { +fn default_1786() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1776() -> String { +fn default_1787() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1777() -> Vec { +fn default_1788() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1778() -> String { +fn default_1789() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1779() -> Integer { +fn default_1790() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1780() -> Integer { +fn default_1791() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1781() -> String { +fn default_1792() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1782() -> Integer { +fn default_1793() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1783() -> Integer { +fn default_1794() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1784() -> MemoryProposalReady { +fn default_1795() -> MemoryProposalReady { serde_json::from_str("\"\"").expect("schema default") } -fn default_1785() -> Vec { +fn default_1796() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1786() -> Vec { +fn default_1797() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1787() -> Integer { +fn default_1798() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1788() -> ProposalPolicyMode { +fn default_1799() -> ProposalPolicyMode { serde_json::from_str("\"manual\"").expect("schema default") } -fn default_1789() -> Integer { +fn default_1800() -> Integer { serde_json::from_str("2").expect("schema default") } -fn default_1790() -> Integer { +fn default_1801() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1791() -> Integer { +fn default_1802() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1792() -> ProposalPolicy { +fn default_1803() -> ProposalPolicy { serde_json::from_str( "{\"mode\":\"manual\",\"min_passes\":2,\"max_fails\":0,\"reject_after_fails\":0}", ) .expect("schema default") } -fn default_1793() -> String { +fn default_1804() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1794() -> String { +fn default_1805() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1795() -> String { +fn default_1806() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1796() -> String { +fn default_1807() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1797() -> String { +fn default_1808() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1798() -> String { +fn default_1809() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1799() -> bool { +fn default_1810() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1800() -> String { +fn default_1811() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1801() -> String { +fn default_1812() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1802() -> String { +fn default_1813() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1803() -> String { +fn default_1814() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1804() -> String { +fn default_1815() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1805() -> String { +fn default_1816() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1806() -> String { +fn default_1817() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1807() -> String { +fn default_1818() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1808() -> String { +fn default_1819() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1809() -> Vec { +fn default_1820() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1810() -> f64 { +fn default_1821() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1811() -> String { +fn default_1822() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1812() -> String { +fn default_1823() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1813() -> Vec { +fn default_1824() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1814() -> String { +fn default_1825() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1815() -> String { +fn default_1826() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1816() -> String { +fn default_1827() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1817() -> String { +fn default_1828() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1818() -> bool { +fn default_1829() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1819() -> Integer { +fn default_1830() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1820() -> Integer { +fn default_1831() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1821() -> Integer { +fn default_1832() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1822() -> bool { +fn default_1833() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1823() -> String { +fn default_1834() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1824() -> Integer { +fn default_1835() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_1825() -> MemoryRecallOutputOrder { +fn default_1836() -> MemoryRecallOutputOrder { serde_json::from_str("\"recent\"").expect("schema default") } -fn default_1826() -> Vec { +fn default_1837() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1827() -> Integer { +fn default_1838() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1828() -> Value { +fn default_1839() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1829() -> Value { +fn default_1840() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1830() -> String { +fn default_1841() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1831() -> String { +fn default_1842() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1832() -> Option { +fn default_1843() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1833() -> Option { +fn default_1844() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1834() -> bool { +fn default_1845() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1835() -> String { +fn default_1846() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1836() -> String { +fn default_1847() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1837() -> std::collections::HashMap { +fn default_1848() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1838() -> std::collections::HashMap { +fn default_1849() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1839() -> MemoryRecordRowStatus { +fn default_1850() -> MemoryRecordRowStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1840() -> Option { +fn default_1851() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1841() -> Option { +fn default_1852() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1842() -> bool { +fn default_1853() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1843() -> String { +fn default_1854() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1844() -> MemoryRecordWriteOutputKeySource { +fn default_1855() -> MemoryRecordWriteOutputKeySource { serde_json::from_str("\"anonymous\"").expect("schema default") } -fn default_1845() -> std::collections::HashMap { +fn default_1856() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1846() -> String { +fn default_1857() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1847() -> Integer { +fn default_1858() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1848() -> bool { +fn default_1859() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1849() -> Option { +fn default_1860() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1850() -> Integer { +fn default_1861() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1851() -> Integer { +fn default_1862() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1852() -> Option { +fn default_1863() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1853() -> String { +fn default_1864() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1854() -> Integer { +fn default_1865() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1855() -> Integer { +fn default_1866() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1856() -> bool { +fn default_1867() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1857() -> Vec { +fn default_1868() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1858() -> Option { +fn default_1869() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1859() -> Option { +fn default_1870() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1860() -> bool { +fn default_1871() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1861() -> bool { +fn default_1872() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1862() -> String { +fn default_1873() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1863() -> f64 { +fn default_1874() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1864() -> String { +fn default_1875() -> String { serde_json::from_str("\"fact\"").expect("schema default") } -fn default_1865() -> String { +fn default_1876() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1866() -> std::collections::HashMap { +fn default_1877() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1867() -> bool { +fn default_1878() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1868() -> Integer { +fn default_1879() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1869() -> String { +fn default_1880() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1870() -> Vec { +fn default_1881() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1871() -> Vec { +fn default_1882() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1872() -> Integer { +fn default_1883() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1873() -> Integer { +fn default_1884() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1874() -> String { +fn default_1885() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1875() -> String { +fn default_1886() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1876() -> Integer { +fn default_1887() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_1877() -> Integer { +fn default_1888() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1878() -> Integer { +fn default_1889() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1879() -> Vec { +fn default_1890() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1880() -> Integer { +fn default_1891() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1881() -> Integer { +fn default_1892() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1882() -> Integer { +fn default_1893() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1883() -> Integer { +fn default_1894() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1884() -> Vec { +fn default_1895() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1885() -> String { +fn default_1896() -> String { serde_json::from_str("\"whole\"").expect("schema default") } -fn default_1886() -> Integer { +fn default_1897() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1887() -> Vec { +fn default_1898() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1888() -> Vec { +fn default_1899() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1889() -> Integer { +fn default_1900() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1890() -> Vec { +fn default_1901() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1891() -> Integer { +fn default_1902() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1892() -> Vec { +fn default_1903() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1893() -> Vec { +fn default_1904() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1894() -> bool { +fn default_1905() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1895() -> String { +fn default_1906() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1896() -> String { +fn default_1907() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1897() -> std::collections::HashMap { +fn default_1908() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1898() -> String { +fn default_1909() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1899() -> bool { +fn default_1910() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1900() -> Vec { +fn default_1911() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1901() -> Integer { +fn default_1912() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1902() -> Integer { +fn default_1913() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1903() -> String { +fn default_1914() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1904() -> String { +fn default_1915() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1905() -> String { +fn default_1916() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1906() -> bool { +fn default_1917() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1907() -> Integer { +fn default_1918() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1908() -> Option { +fn default_1919() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1909() -> String { +fn default_1920() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1910() -> String { +fn default_1921() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1911() -> String { +fn default_1922() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1912() -> Vec { +fn default_1923() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1913() -> Integer { +fn default_1924() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1914() -> Integer { +fn default_1925() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1915() -> Integer { +fn default_1926() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1916() -> Integer { +fn default_1927() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1917() -> Integer { +fn default_1928() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1918() -> Integer { +fn default_1929() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1919() -> bool { +fn default_1930() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1920() -> Vec> { +fn default_1931() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1921() -> Vec { +fn default_1932() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1922() -> Option { +fn default_1933() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1923() -> String { +fn default_1934() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1924() -> Integer { +fn default_1935() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1925() -> Option { +fn default_1936() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1926() -> Option { +fn default_1937() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1927() -> Option { +fn default_1938() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1928() -> Option { +fn default_1939() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1929() -> Vec { +fn default_1940() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1930() -> Integer { +fn default_1941() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1931() -> String { +fn default_1942() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1932() -> String { +fn default_1943() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1933() -> Option { +fn default_1944() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1934() -> String { +fn default_1945() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1935() -> String { +fn default_1946() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1936() -> String { +fn default_1947() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1937() -> String { +fn default_1948() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1938() -> Option { +fn default_1949() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1939() -> String { +fn default_1950() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1940() -> String { +fn default_1951() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1941() -> Integer { +fn default_1952() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1942() -> String { +fn default_1953() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1943() -> String { +fn default_1954() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1944() -> String { +fn default_1955() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1945() -> String { +fn default_1956() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1946() -> String { +fn default_1957() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1947() -> Integer { +fn default_1958() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1948() -> String { +fn default_1959() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1949() -> Vec { +fn default_1960() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1950() -> String { +fn default_1961() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1951() -> Integer { +fn default_1962() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1952() -> String { +fn default_1963() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1953() -> Integer { +fn default_1964() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1954() -> String { +fn default_1965() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1955() -> String { +fn default_1966() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1956() -> Integer { +fn default_1967() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1957() -> String { +fn default_1968() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1958() -> bool { +fn default_1969() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1959() -> String { +fn default_1970() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1960() -> String { +fn default_1971() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1961() -> String { +fn default_1972() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1962() -> String { +fn default_1973() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1963() -> Option { +fn default_1974() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1964() -> String { +fn default_1975() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1965() -> Integer { +fn default_1976() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1966() -> String { +fn default_1977() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1967() -> String { +fn default_1978() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1968() -> String { +fn default_1979() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1969() -> bool { +fn default_1980() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1970() -> Vec { +fn default_1981() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1971() -> std::collections::HashMap { +fn default_1982() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1972() -> String { +fn default_1983() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1973() -> Vec { +fn default_1984() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1974() -> std::collections::HashMap { +fn default_1985() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1975() -> Integer { +fn default_1986() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1976() -> Option { +fn default_1987() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1977() -> String { +fn default_1988() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1978() -> bool { +fn default_1989() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1979() -> Vec { +fn default_1990() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1980() -> Vec { +fn default_1991() -> std::collections::HashMap> { + serde_json::from_str("{}").expect("schema default") +} +fn default_1992() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1981() -> std::collections::HashMap { +fn default_1993() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1982() -> Option { +fn default_1994() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1983() -> Vec { +fn default_1995() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1984() -> Integer { +fn default_1996() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1985() -> Integer { +fn default_1997() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1986() -> Vec { +fn default_1998() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1987() -> Option { +fn default_1999() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1988() -> Vec { +fn default_2000() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1989() -> Option { +fn default_2001() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1990() -> Option { +fn default_2002() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1991() -> Vec { +fn default_2003() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1992() -> bool { +fn default_2004() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1993() -> Vec { +fn default_2005() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1994() -> bool { +fn default_2006() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1995() -> Integer { +fn default_2007() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1996() -> Integer { +fn default_2008() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1997() -> Integer { +fn default_2009() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1998() -> Integer { +fn default_2010() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1999() -> Integer { +fn default_2011() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2000() -> Integer { +fn default_2012() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2001() -> Integer { +fn default_2013() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2002() -> Integer { +fn default_2014() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2003() -> Integer { +fn default_2015() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2004() -> f64 { +fn default_2016() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2005() -> Integer { +fn default_2017() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2006() -> Integer { +fn default_2018() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2007() -> Integer { +fn default_2019() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2008() -> Integer { +fn default_2020() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2009() -> Option { +fn default_2021() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2010() -> Option { +fn default_2022() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2011() -> Vec { +fn default_2023() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2012() -> String { +fn default_2024() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2013() -> String { +fn default_2025() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2014() -> Integer { +fn default_2026() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2015() -> Vec> { +fn default_2027() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2016() -> Vec { +fn default_2028() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2017() -> String { +fn default_2029() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2018() -> bool { +fn default_2030() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2019() -> String { +fn default_2031() -> String { serde_json::from_str("\"approval\"").expect("schema default") } -fn default_2020() -> String { +fn default_2032() -> String { serde_json::from_str("\"public\"").expect("schema default") } -fn default_2021() -> BrowseEntryMyStatus { +fn default_2033() -> BrowseEntryMyStatus { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2022() -> String { +fn default_2034() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2023() -> String { +fn default_2035() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2024() -> String { +fn default_2036() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2025() -> Integer { +fn default_2037() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2026() -> String { +fn default_2038() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2027() -> Option { +fn default_2039() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2028() -> Option { +fn default_2040() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2029() -> Vec { +fn default_2041() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2030() -> Option { +fn default_2042() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2031() -> Option { +fn default_2043() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2032() -> Option { +fn default_2044() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2033() -> Option> { +fn default_2045() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2034() -> Option { +fn default_2046() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2035() -> Option { +fn default_2047() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2036() -> Option { +fn default_2048() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2037() -> Option { +fn default_2049() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2038() -> Option { +fn default_2050() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2039() -> Option { +fn default_2051() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2040() -> Option { +fn default_2052() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2041() -> Option { +fn default_2053() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2042() -> Option { +fn default_2054() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2043() -> Option { +fn default_2055() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2044() -> Option { +fn default_2056() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2045() -> Option { +fn default_2057() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2046() -> Option { +fn default_2058() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2047() -> Option { +fn default_2059() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2048() -> Option { +fn default_2060() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2049() -> Option> { +fn default_2061() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2050() -> Option { +fn default_2062() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2051() -> Option { +fn default_2063() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2052() -> Option { +fn default_2064() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2053() -> Option { +fn default_2065() -> String { + serde_json::from_str("\"manual_review\"").expect("schema default") +} +fn default_2066() -> f64 { + serde_json::from_str("0.98").expect("schema default") +} +fn default_2067() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2054() -> Option { +fn default_2068() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2055() -> Option>> { +fn default_2069() -> Option>> { serde_json::from_str("null").expect("schema default") } -fn default_2056() -> Option { +fn default_2070() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2057() -> Option { +fn default_2071() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2058() -> Option { +fn default_2072() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2059() -> Option { +fn default_2073() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2060() -> Option { +fn default_2074() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2061() -> Integer { +fn default_2075() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2062() -> String { +fn default_2076() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2063() -> String { +fn default_2077() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2064() -> String { +fn default_2078() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2065() -> String { +fn default_2079() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2066() -> Option { +fn default_2080() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2067() -> bool { +fn default_2081() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2068() -> Integer { +fn default_2082() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2069() -> String { +fn default_2083() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2070() -> String { +fn default_2084() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2071() -> String { +fn default_2085() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2072() -> String { +fn default_2086() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2073() -> Option { +fn default_2087() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2074() -> Option { +fn default_2088() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2075() -> String { +fn default_2089() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2076() -> Vec { +fn default_2090() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2077() -> String { +fn default_2091() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2078() -> String { +fn default_2092() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2079() -> Option { +fn default_2093() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2080() -> Vec { +fn default_2094() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2081() -> Option { +fn default_2095() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2082() -> String { +fn default_2096() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2083() -> bool { +fn default_2097() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2084() -> f64 { +fn default_2098() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2085() -> f64 { +fn default_2099() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2086() -> String { +fn default_2100() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2087() -> Option { +fn default_2101() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2088() -> Integer { +fn default_2102() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2089() -> Integer { +fn default_2103() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2090() -> NamespaceEntryVisibility { +fn default_2104() -> NamespaceEntryVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2091() -> String { +fn default_2105() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2092() -> Option { +fn default_2106() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2093() -> Option { +fn default_2107() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2094() -> Vec { +fn default_2108() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2095() -> MineEntryVisibility { +fn default_2109() -> MineEntryVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2096() -> String { +fn default_2110() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2097() -> String { +fn default_2111() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2098() -> String { +fn default_2112() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2099() -> Option { +fn default_2113() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2100() -> bool { +fn default_2114() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2101() -> bool { +fn default_2115() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2102() -> String { +fn default_2116() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2103() -> NamespaceRegisterOutputVisibility { +fn default_2117() -> NamespaceRegisterOutputVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2104() -> bool { +fn default_2118() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2105() -> Integer { +fn default_2119() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2106() -> Integer { +fn default_2120() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2107() -> bool { +fn default_2121() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2108() -> Vec> { +fn default_2122() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2109() -> Option { +fn default_2123() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2110() -> Option { +fn default_2124() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2111() -> Vec { +fn default_2125() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2112() -> Integer { +fn default_2126() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2113() -> String { +fn default_2127() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2114() -> String { +fn default_2128() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2115() -> String { +fn default_2129() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2116() -> String { +fn default_2130() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2117() -> String { +fn default_2131() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2118() -> Option { +fn default_2132() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2119() -> String { +fn default_2133() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2120() -> String { +fn default_2134() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2121() -> String { +fn default_2135() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2122() -> Vec { +fn default_2136() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2123() -> Option { +fn default_2137() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2124() -> Option { +fn default_2138() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2125() -> Option { +fn default_2139() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2126() -> Option { +fn default_2140() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2127() -> String { +fn default_2141() -> String { serde_json::from_str("\"{}\"").expect("schema default") } -fn default_2128() -> NamespaceSnapshotOutputSnapshotMemoryRowStatus { +fn default_2142() -> NamespaceSnapshotOutputSnapshotMemoryRowStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2129() -> Option { +fn default_2143() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2130() -> Vec { +fn default_2144() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2131() -> String { +fn default_2145() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2132() -> Integer { +fn default_2146() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2133() -> Integer { +fn default_2147() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2134() -> Option { +fn default_2148() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2135() -> String { +fn default_2149() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2136() -> String { +fn default_2150() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2137() -> String { +fn default_2151() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2138() -> String { +fn default_2152() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2139() -> Option { +fn default_2153() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2140() -> f64 { +fn default_2154() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2141() -> Option { +fn default_2155() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2142() -> Option { +fn default_2156() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2143() -> Integer { +fn default_2157() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2144() -> Option { +fn default_2158() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2145() -> Option { +fn default_2159() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2146() -> String { +fn default_2160() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2147() -> Option { +fn default_2161() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2148() -> String { +fn default_2162() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2149() -> String { +fn default_2163() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2150() -> String { +fn default_2164() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2151() -> Option { +fn default_2165() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2152() -> String { +fn default_2166() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2153() -> Option { +fn default_2167() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2154() -> String { +fn default_2168() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2155() -> String { +fn default_2169() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2156() -> Vec { +fn default_2170() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2157() -> Vec { +fn default_2171() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2158() -> Option { +fn default_2172() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2159() -> Integer { +fn default_2173() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2160() -> String { +fn default_2174() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2161() -> Vec { +fn default_2175() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2162() -> Vec { +fn default_2176() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2163() -> String { +fn default_2177() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2164() -> Option { +fn default_2178() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2165() -> Vec { +fn default_2179() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2166() -> Integer { +fn default_2180() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2167() -> Vec { +fn default_2181() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2168() -> Option { +fn default_2182() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2169() -> Vec { +fn default_2183() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2170() -> Vec { +fn default_2184() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2171() -> Option { +fn default_2185() -> Option { serde_json::from_str("0").expect("schema default") } -fn default_2172() -> TuneProposalEffect { +fn default_2186() -> TuneProposalEffect { serde_json::from_str("\"future\"").expect("schema default") } -fn default_2173() -> TuneApplyVia { +fn default_2187() -> TuneApplyVia { serde_json::from_str("\"op\"").expect("schema default") } -fn default_2174() -> bool { +fn default_2188() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2175() -> Vec { +fn default_2189() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2176() -> Option { +fn default_2190() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2177() -> Option { +fn default_2191() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2178() -> String { +fn default_2192() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2179() -> Vec { +fn default_2193() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2180() -> Vec { +fn default_2194() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2181() -> Option { +fn default_2195() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2182() -> Option { +fn default_2196() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2183() -> Option { +fn default_2197() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2184() -> String { +fn default_2198() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2185() -> Option { +fn default_2199() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2186() -> Option { +fn default_2200() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2187() -> Option { +fn default_2201() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2188() -> Vec { +fn default_2202() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2189() -> bool { +fn default_2203() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2190() -> Option { +fn default_2204() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2191() -> Option { +fn default_2205() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2192() -> Vec { +fn default_2206() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2193() -> String { +fn default_2207() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2194() -> String { +fn default_2208() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2195() -> Vec> { +fn default_2209() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2196() -> std::collections::HashMap { +fn default_2210() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2197() -> Vec { +fn default_2211() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2198() -> Integer { +fn default_2212() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2199() -> Integer { +fn default_2213() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2200() -> String { +fn default_2214() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2201() -> String { +fn default_2215() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2202() -> String { +fn default_2216() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2203() -> Vec { +fn default_2217() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2204() -> Vec { +fn default_2218() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2205() -> String { +fn default_2219() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2206() -> String { +fn default_2220() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2207() -> bool { +fn default_2221() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2208() -> Integer { +fn default_2222() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2209() -> String { +fn default_2223() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2210() -> String { +fn default_2224() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2211() -> String { +fn default_2225() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2212() -> String { +fn default_2226() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2213() -> Vec { +fn default_2227() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2214() -> String { +fn default_2228() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2215() -> String { +fn default_2229() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2216() -> std::collections::HashMap { +fn default_2230() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2217() -> String { +fn default_2231() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2218() -> Option { +fn default_2232() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2219() -> Option { +fn default_2233() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2220() -> bool { +fn default_2234() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2221() -> String { +fn default_2235() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2222() -> String { +fn default_2236() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2223() -> Vec { +fn default_2237() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2224() -> Integer { +fn default_2238() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2225() -> String { +fn default_2239() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2226() -> String { +fn default_2240() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2227() -> Option { +fn default_2241() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2228() -> bool { +fn default_2242() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2229() -> String { +fn default_2243() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2230() -> bool { +fn default_2244() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2231() -> String { +fn default_2245() -> String { serde_json::from_str("\"inherit\"").expect("schema default") } -fn default_2232() -> Option { +fn default_2246() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2233() -> Option { +fn default_2247() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2234() -> bool { +fn default_2248() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2235() -> Vec { +fn default_2249() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2236() -> Integer { +fn default_2250() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2237() -> ProcedureEvolveOutputGate { +fn default_2251() -> ProcedureEvolveOutputGate { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2238() -> String { +fn default_2252() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2239() -> f64 { +fn default_2253() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2240() -> std::collections::HashMap { +fn default_2254() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2241() -> std::collections::HashMap { +fn default_2255() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2242() -> std::collections::HashMap { +fn default_2256() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2243() -> std::collections::HashMap { +fn default_2257() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2244() -> String { +fn default_2258() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2245() -> Vec { +fn default_2259() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2246() -> Vec { +fn default_2260() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2247() -> Vec { +fn default_2261() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2248() -> std::collections::HashMap { +fn default_2262() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2249() -> Integer { +fn default_2263() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2250() -> bool { +fn default_2264() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2251() -> std::collections::HashMap { +fn default_2265() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2252() -> Vec { +fn default_2266() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2253() -> std::collections::HashMap { +fn default_2267() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2254() -> String { +fn default_2268() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2255() -> ProcedureLocateOutputStatus { +fn default_2269() -> ProcedureLocateOutputStatus { serde_json::from_str("\"authored\"").expect("schema default") } -fn default_2256() -> Option> { +fn default_2270() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2257() -> Vec>> { +fn default_2271() -> Vec>> { serde_json::from_str("[]").expect("schema default") } -fn default_2258() -> Vec { +fn default_2272() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2259() -> Vec { +fn default_2273() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2260() -> std::collections::HashMap { +fn default_2274() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2261() -> bool { +fn default_2275() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2262() -> Vec { +fn default_2276() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2263() -> Vec> { +fn default_2277() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2264() -> String { +fn default_2278() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2265() -> std::collections::HashMap { +fn default_2279() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2266() -> std::collections::HashMap { +fn default_2280() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2267() -> Vec { +fn default_2281() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2268() -> std::collections::HashMap { +fn default_2282() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2269() -> Option> { +fn default_2283() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2270() -> bool { +fn default_2284() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2271() -> std::collections::HashMap { +fn default_2285() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2272() -> ProcedureMatchStatus { +fn default_2286() -> ProcedureMatchStatus { serde_json::from_str("\"authored\"").expect("schema default") } -fn default_2273() -> Option> { +fn default_2287() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2274() -> Vec { +fn default_2288() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2275() -> Integer { +fn default_2289() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2276() -> Vec> { +fn default_2290() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2277() -> f64 { +fn default_2291() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2278() -> f64 { +fn default_2292() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2279() -> f64 { +fn default_2293() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2280() -> Option { +fn default_2294() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2281() -> std::collections::HashMap { +fn default_2295() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2282() -> std::collections::HashMap> { +fn default_2296() -> std::collections::HashMap> { serde_json::from_str("{}").expect("schema default") } -fn default_2283() -> String { +fn default_2297() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2284() -> Integer { +fn default_2298() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2285() -> String { +fn default_2299() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2286() -> f64 { +fn default_2300() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2287() -> Vec { +fn default_2301() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2288() -> ProcedureReviseOutputOutcome { +fn default_2302() -> ProcedureReviseOutputOutcome { serde_json::from_str("\"opened\"").expect("schema default") } -fn default_2289() -> Vec { +fn default_2303() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2290() -> Vec { +fn default_2304() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2291() -> String { +fn default_2305() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2292() -> String { +fn default_2306() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2293() -> String { +fn default_2307() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2294() -> String { +fn default_2308() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2295() -> Option { +fn default_2309() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2296() -> Integer { +fn default_2310() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2297() -> Vec { +fn default_2311() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2298() -> std::collections::HashMap { +fn default_2312() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2299() -> Option { +fn default_2313() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2300() -> String { +fn default_2314() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2301() -> Integer { +fn default_2315() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2302() -> String { +fn default_2316() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2303() -> String { +fn default_2317() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2304() -> std::collections::HashMap { +fn default_2318() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2305() -> String { +fn default_2319() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2306() -> String { +fn default_2320() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2307() -> Option { +fn default_2321() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2308() -> RunBeginOutputStatus { +fn default_2322() -> RunBeginOutputStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2309() -> String { +fn default_2323() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2310() -> Integer { +fn default_2324() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2311() -> Integer { +fn default_2325() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2312() -> Integer { +fn default_2326() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2313() -> Vec { +fn default_2327() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2314() -> Integer { +fn default_2328() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_2315() -> Integer { +fn default_2329() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2316() -> Integer { +fn default_2330() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2317() -> String { +fn default_2331() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2318() -> String { +fn default_2332() -> String { serde_json::from_str("\"keep\"").expect("schema default") } -fn default_2319() -> Integer { +fn default_2333() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2320() -> Integer { +fn default_2334() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2321() -> Integer { +fn default_2335() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2322() -> Option { +fn default_2336() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2323() -> Integer { +fn default_2337() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_2324() -> Vec { +fn default_2338() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2325() -> Vec { +fn default_2339() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2326() -> Integer { +fn default_2340() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2327() -> Integer { +fn default_2341() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2328() -> Integer { +fn default_2342() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2329() -> f64 { +fn default_2343() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2330() -> Integer { +fn default_2344() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2331() -> Vec { +fn default_2345() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2332() -> Integer { +fn default_2346() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2333() -> Vec { +fn default_2347() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2334() -> Integer { +fn default_2348() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2335() -> Integer { +fn default_2349() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2336() -> Integer { +fn default_2350() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2337() -> Vec { +fn default_2351() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2338() -> Option { +fn default_2352() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2339() -> Option> { +fn default_2353() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2340() -> LiveSearchResultsLive { +fn default_2354() -> LiveSearchResultsLive { serde_json::from_str("true").expect("schema default") } -fn default_2341() -> String { +fn default_2355() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2342() -> LiveSearchHitLive { +fn default_2356() -> LiveSearchHitLive { serde_json::from_str("true").expect("schema default") } -fn default_2343() -> Vec { +fn default_2357() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2344() -> Option { +fn default_2358() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2345() -> std::collections::HashMap { +fn default_2359() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2346() -> std::collections::HashMap { +fn default_2360() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2347() -> std::collections::HashMap { +fn default_2361() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2348() -> std::collections::HashMap { +fn default_2362() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2349() -> Option> { +fn default_2363() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2350() -> Vec { +fn default_2364() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2351() -> Integer { +fn default_2365() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2352() -> String { +fn default_2366() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2353() -> Integer { +fn default_2367() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2354() -> String { +fn default_2368() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2355() -> String { +fn default_2369() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2356() -> String { +fn default_2370() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2357() -> String { +fn default_2371() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2358() -> String { +fn default_2372() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2359() -> String { +fn default_2373() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2360() -> String { +fn default_2374() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2361() -> String { +fn default_2375() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2362() -> Vec { +fn default_2376() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2363() -> String { +fn default_2377() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2364() -> String { +fn default_2378() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2365() -> Vec { +fn default_2379() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2366() -> String { +fn default_2380() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2367() -> String { +fn default_2381() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2368() -> Vec { +fn default_2382() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2369() -> Vec { +fn default_2383() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2370() -> Vec { +fn default_2384() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2371() -> String { +fn default_2385() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2372() -> String { +fn default_2386() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2373() -> Vec { +fn default_2387() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2374() -> Vec { +fn default_2388() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2375() -> Vec { +fn default_2389() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2376() -> String { +fn default_2390() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2377() -> String { +fn default_2391() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2378() -> Option { +fn default_2392() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2379() -> String { +fn default_2393() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2380() -> String { +fn default_2394() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2381() -> String { +fn default_2395() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2382() -> String { +fn default_2396() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2383() -> String { +fn default_2397() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2384() -> String { +fn default_2398() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2385() -> Vec { +fn default_2399() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2386() -> Option { +fn default_2400() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2387() -> Integer { +fn default_2401() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2388() -> Integer { +fn default_2402() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2389() -> Integer { +fn default_2403() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2390() -> Integer { +fn default_2404() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2391() -> Integer { +fn default_2405() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2392() -> bool { +fn default_2406() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2393() -> String { +fn default_2407() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2394() -> String { +fn default_2408() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2395() -> String { +fn default_2409() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2396() -> String { +fn default_2410() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2397() -> String { +fn default_2411() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2398() -> String { +fn default_2412() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2399() -> String { +fn default_2413() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2400() -> Option { +fn default_2414() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2401() -> Integer { +fn default_2415() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2402() -> Integer { +fn default_2416() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2403() -> Vec { +fn default_2417() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2404() -> String { +fn default_2418() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2405() -> String { +fn default_2419() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2406() -> String { +fn default_2420() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2407() -> String { +fn default_2421() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2408() -> Integer { +fn default_2422() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2409() -> Integer { +fn default_2423() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2410() -> Integer { +fn default_2424() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2411() -> Integer { +fn default_2425() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2412() -> Integer { +fn default_2426() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2413() -> f64 { +fn default_2427() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2414() -> Integer { +fn default_2428() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2415() -> Integer { +fn default_2429() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2416() -> Integer { +fn default_2430() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2417() -> String { +fn default_2431() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2418() -> SessionBriefStats { +fn default_2432() -> SessionBriefStats { serde_json::from_str("{\"events_in\":0,\"windows\":0,\"events_total\":0,\"source_chars\":0,\"brief_chars\":0,\"compression_ratio\":0.0,\"dropped_ungrounded\":0,\"tokens_in\":0,\"tokens_out\":0,\"llm_model\":\"\"}").expect("schema default") } -fn default_2419() -> String { +fn default_2433() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2420() -> String { +fn default_2434() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2421() -> Option { +fn default_2435() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2422() -> Option { +fn default_2436() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2423() -> Option { +fn default_2437() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2424() -> Integer { +fn default_2438() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2425() -> std::collections::HashMap { +fn default_2439() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2426() -> String { +fn default_2440() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2427() -> String { +fn default_2441() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2428() -> Option { +fn default_2442() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2429() -> String { +fn default_2443() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2430() -> Integer { +fn default_2444() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2431() -> Integer { +fn default_2445() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2432() -> Option { +fn default_2446() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2433() -> std::collections::HashMap { +fn default_2447() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2434() -> String { +fn default_2448() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2435() -> Integer { +fn default_2449() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2436() -> String { +fn default_2450() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2437() -> Option { +fn default_2451() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2438() -> String { +fn default_2452() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2439() -> Option { +fn default_2453() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2440() -> String { +fn default_2454() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2441() -> String { +fn default_2455() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2442() -> String { +fn default_2456() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2443() -> String { +fn default_2457() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2444() -> Integer { +fn default_2458() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2445() -> Integer { +fn default_2459() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2446() -> String { +fn default_2460() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2447() -> std::collections::HashMap { +fn default_2461() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2448() -> String { +fn default_2462() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2449() -> String { +fn default_2463() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2450() -> bool { +fn default_2464() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2451() -> String { +fn default_2465() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2452() -> std::collections::HashMap { +fn default_2466() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2453() -> Vec> { +fn default_2467() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2454() -> Vec { +fn default_2468() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2455() -> Vec { +fn default_2469() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2456() -> bool { +fn default_2470() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2457() -> String { +fn default_2471() -> String { serde_json::from_str("\"unknown\"").expect("schema default") } -fn default_2458() -> String { +fn default_2472() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2459() -> Vec { +fn default_2473() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2460() -> bool { +fn default_2474() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2461() -> String { +fn default_2475() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2462() -> bool { +fn default_2476() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2463() -> Vec { +fn default_2477() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2464() -> std::collections::HashMap { +fn default_2478() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2465() -> Vec> { +fn default_2479() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2466() -> bool { +fn default_2480() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2467() -> bool { +fn default_2481() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2468() -> Vec> { +fn default_2482() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2469() -> std::collections::HashMap { +fn default_2483() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2470() -> String { +fn default_2484() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2471() -> Vec> { +fn default_2485() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2472() -> bool { +fn default_2486() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2473() -> String { +fn default_2487() -> String { serde_json::from_str("\"calibrated\"").expect("schema default") } -fn default_2474() -> std::collections::HashMap { +fn default_2488() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2475() -> std::collections::HashMap { +fn default_2489() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2476() -> String { +fn default_2490() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2477() -> std::collections::HashMap { +fn default_2491() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2478() -> std::collections::HashMap { +fn default_2492() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2479() -> std::collections::HashMap { +fn default_2493() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2480() -> String { +fn default_2494() -> String { serde_json::from_str("\"ok\"").expect("schema default") } -fn default_2481() -> String { +fn default_2495() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2482() -> String { +fn default_2496() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2483() -> bool { +fn default_2497() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2484() -> Integer { +fn default_2498() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2485() -> String { +fn default_2499() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2486() -> String { +fn default_2500() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2487() -> Vec { +fn default_2501() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2488() -> bool { +fn default_2502() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2489() -> Vec { +fn default_2503() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2490() -> std::collections::HashMap> { +fn default_2504() -> std::collections::HashMap> { serde_json::from_str("{}").expect("schema default") } -fn default_2491() -> Vec> { +fn default_2505() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2492() -> Vec> { +fn default_2506() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2493() -> String { +fn default_2507() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2494() -> Vec> { +fn default_2508() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2495() -> std::collections::HashMap { +fn default_2509() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2496() -> String { +fn default_2510() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2497() -> Vec> { +fn default_2511() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2498() -> bool { +fn default_2512() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2499() -> Integer { +fn default_2513() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2500() -> Vec> { +fn default_2514() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2501() -> String { +fn default_2515() -> String { serde_json::from_str("\"no_flaky_signal\"").expect("schema default") } -fn default_2502() -> bool { +fn default_2516() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2503() -> Option> { +fn default_2517() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2504() -> Vec { +fn default_2518() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2505() -> bool { +fn default_2519() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2506() -> std::collections::HashMap { +fn default_2520() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2507() -> String { +fn default_2521() -> String { serde_json::from_str("\"not_computed\"").expect("schema default") } -fn default_2508() -> Vec> { +fn default_2522() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2509() -> String { +fn default_2523() -> String { serde_json::from_str("\"candidate\"").expect("schema default") } -fn default_2510() -> std::collections::HashMap { +fn default_2524() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2511() -> String { +fn default_2525() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2512() -> bool { +fn default_2526() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2513() -> Integer { +fn default_2527() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2514() -> std::collections::HashMap { +fn default_2528() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2515() -> bool { +fn default_2529() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2516() -> Vec> { +fn default_2530() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2517() -> std::collections::HashMap { +fn default_2531() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2518() -> std::collections::HashMap { +fn default_2532() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2519() -> String { +fn default_2533() -> String { serde_json::from_str("\"lower_bound\"").expect("schema default") } -fn default_2520() -> bool { +fn default_2534() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2521() -> Vec { +fn default_2535() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2522() -> Vec> { +fn default_2536() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2523() -> std::collections::HashMap { +fn default_2537() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2524() -> Vec { +fn default_2538() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2525() -> String { +fn default_2539() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2526() -> bool { +fn default_2540() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2527() -> bool { +fn default_2541() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2528() -> std::collections::HashMap { +fn default_2542() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2529() -> String { +fn default_2543() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2530() -> bool { +fn default_2544() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2531() -> std::collections::HashMap { +fn default_2545() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2532() -> std::collections::HashMap { +fn default_2546() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2533() -> Vec> { +fn default_2547() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2534() -> Vec { +fn default_2548() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2535() -> std::collections::HashMap { +fn default_2549() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2536() -> Vec> { +fn default_2550() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2537() -> bool { +fn default_2551() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2538() -> bool { +fn default_2552() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2539() -> Vec { +fn default_2553() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2540() -> std::collections::HashMap { +fn default_2554() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2541() -> String { +fn default_2555() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2542() -> std::collections::HashMap { +fn default_2556() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2543() -> bool { +fn default_2557() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2544() -> bool { +fn default_2558() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2545() -> String { +fn default_2559() -> String { serde_json::from_str("\"no_signal\"").expect("schema default") } -fn default_2546() -> Vec { +fn default_2560() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2547() -> f64 { +fn default_2561() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2548() -> Integer { +fn default_2562() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2549() -> String { +fn default_2563() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2550() -> std::collections::HashMap { +fn default_2564() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2551() -> std::collections::HashMap { +fn default_2565() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2552() -> std::collections::HashMap { +fn default_2566() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2553() -> std::collections::HashMap { +fn default_2567() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2554() -> String { +fn default_2568() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2555() -> std::collections::HashMap { +fn default_2569() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2556() -> bool { +fn default_2570() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2557() -> std::collections::HashMap { +fn default_2571() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2558() -> std::collections::HashMap { +fn default_2572() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2559() -> std::collections::HashMap { +fn default_2573() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2560() -> std::collections::HashMap { +fn default_2574() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2561() -> String { +fn default_2575() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2562() -> Vec> { +fn default_2576() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2563() -> Integer { +fn default_2577() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2564() -> String { +fn default_2578() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2565() -> bool { +fn default_2579() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2566() -> String { +fn default_2580() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2567() -> Vec { +fn default_2581() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2568() -> bool { +fn default_2582() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2569() -> Vec { +fn default_2583() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2570() -> f64 { +fn default_2584() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2571() -> String { +fn default_2585() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2572() -> Integer { +fn default_2586() -> Integer { serde_json::from_str("4096").expect("schema default") } -fn default_2573() -> Integer { +fn default_2587() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2574() -> Option { +fn default_2588() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2575() -> f64 { +fn default_2589() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2576() -> Option { +fn default_2590() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2577() -> Vec { +fn default_2591() -> Vec { serde_json::from_str("[]").expect("schema default") } diff --git a/sdk/rust/tests/registry_contracts.rs b/sdk/rust/tests/registry_contracts.rs index 78c3e6fcbaa..a93b9e15f76 100644 --- a/sdk/rust/tests/registry_contracts.rs +++ b/sdk/rust/tests/registry_contracts.rs @@ -5464,6 +5464,11 @@ fn conflicts_list() { serde_json::from_str::("null").unwrap(), "conflicts.list:proposals" ); + assert_eq!( + encoded["backlog"], + serde_json::from_str::("null").unwrap(), + "conflicts.list:backlog" + ); assert_eq!( encoded["keys"], serde_json::from_str::("null").unwrap(), @@ -5521,6 +5526,19 @@ fn conflicts_resolve() { ); } #[test] +fn conflicts_bulk_accept() { + let value: clickhouse_loom::ConflictsBulkAcceptInput = + serde_json::from_str("{\"org\":\"sample\",\"namespace\":\"sample\",\"items\":[]}").unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); + let value: clickhouse_loom::ConflictsBulkAcceptOutput = serde_json::from_str( + "{\"results\":[],\"requested\":1,\"resolved\":1,\"stale\":1,\"failed\":1}", + ) + .unwrap(); + let encoded = serde_json::to_value(value).unwrap(); + assert!(encoded.is_object()); +} +#[test] fn conflicts_allowlist_list() { let value: clickhouse_loom::ConflictsAllowlistListInput = serde_json::from_str("{\"org\":\"sample\",\"namespace\":\"sample\"}").unwrap(); @@ -6179,6 +6197,16 @@ fn namespace_get() { serde_json::from_str::("null").unwrap(), "namespace.get:default_conflict_policy" ); + assert_eq!( + encoded["captured_conflict_policy"], + serde_json::from_str::("\"manual_review\"").unwrap(), + "namespace.get:captured_conflict_policy" + ); + assert_eq!( + encoded["captured_conflict_confidence"], + serde_json::from_str::("0.98").unwrap(), + "namespace.get:captured_conflict_confidence" + ); assert_eq!( encoded["proposal_policy"], serde_json::from_str::("null").unwrap(), @@ -6677,6 +6705,11 @@ fn mentor_brief() { serde_json::from_str::("[]").unwrap(), "mentor.brief:planes" ); + assert_eq!( + encoded["conflict_backlog"], + serde_json::from_str::("{}").unwrap(), + "mentor.brief:conflict_backlog" + ); assert_eq!( encoded["hints"], serde_json::from_str::("[]").unwrap(), diff --git a/sdk/typescript/src/generated/ops.ts b/sdk/typescript/src/generated/ops.ts index 799a2581b40..6acfe8c2d5a 100644 --- a/sdk/typescript/src/generated/ops.ts +++ b/sdk/typescript/src/generated/ops.ts @@ -2200,6 +2200,35 @@ export interface ConflictsAllowlistRemoveOutput { removed: boolean; } +export interface ConflictsResolverAcceptItem { + memory_id: string; + peer_id: string; + memory_sha256: string; + peer_sha256: string; + suggestion_hash: string; +} + +export interface ConflictsBulkAcceptInput { + org: string; + namespace: string; + items: ConflictsResolverAcceptItem[]; +} + +export interface ConflictBulkResult { + memory_id: string; + peer_id: string; + status: "resolved" | "stale" | "failed"; + reason?: string; +} + +export interface ConflictsBulkAcceptOutput { + results: ConflictBulkResult[]; + requested: number; + resolved: number; + stale: number; + failed: number; +} + export interface ConflictsListInput { org: string; namespace: string; @@ -2222,6 +2251,19 @@ export interface ConflictRow { conflict_with: string[]; content_sha256?: string; sensitivity?: string; + capture_origin?: string; +} + +export interface ConflictBacklog { + pending_judgement?: ConflictSourceCounts; + resolver_judged?: ConflictSourceCounts; + cosine_only?: ConflictSourceCounts; +} + +export interface ConflictSourceCounts { + plugin_captured?: number; + caller_written?: number; + unknown?: number; } export interface ConflictsListOutput { @@ -2229,6 +2271,7 @@ export interface ConflictsListOutput { next_before_version?: number | null; total?: number | null; proposals?: number | null; + backlog?: ConflictBacklog | null; keys?: string[] | null; } @@ -5390,6 +5433,9 @@ export interface MemoryAutoRetirement { judge_confidence?: number | null; judge_model?: string; judge_prompt_version?: string; + applied_policy?: string; + winner_capture_origin?: string; + retired_capture_origin?: string; } export interface MemoryAutoRetirementsOutput { @@ -7957,6 +8003,7 @@ export interface MentorBriefOutput { sessions: number; usage?: Record; planes?: MentorPlane[]; + conflict_backlog?: Record>; hints?: MentorHint[]; adoption?: MentorAdoption[]; usage_evidence?: UsageRung[]; @@ -8125,6 +8172,8 @@ export interface NamespaceGetOutput { rerank_endpoint?: string | null; classify_endpoint?: string | null; default_conflict_policy?: string | null; + captured_conflict_policy?: string; + captured_conflict_confidence?: number; proposal_policy?: ProposalPolicy | null; code_change_policy?: "retire_removed" | "flag" | "revise" | null; tag_registry?: Array> | null; @@ -8423,6 +8472,8 @@ export interface NamespaceRegisterInput { classify_prompt_template?: string | null; tag_registry?: NamespaceTypeConfig[]; default_conflict_policy?: "auto_reinforce" | "manual_review" | "newest_wins" | "append_only" | null; + captured_conflict_policy?: "manual_review" | "resolver_update" | null; + captured_conflict_confidence?: number | null; proposal_policy?: ProposalPolicy | null; code_change_policy?: "retire_removed" | "flag" | "revise" | null; } @@ -10843,6 +10894,7 @@ export type OpName = | "collection.move" | "conflicts.allowlist_list" | "conflicts.allowlist_remove" + | "conflicts.bulk_accept" | "conflicts.list" | "conflicts.propose_revision" | "conflicts.resolve" @@ -11225,6 +11277,7 @@ export interface OpMap { "collection.move": { input: CollectionMoveInput; output: CollectionMoveOutput }; "conflicts.allowlist_list": { input: ConflictsAllowlistListInput; output: ConflictsAllowlistListOutput }; "conflicts.allowlist_remove": { input: ConflictsAllowlistRemoveInput; output: ConflictsAllowlistRemoveOutput }; + "conflicts.bulk_accept": { input: ConflictsBulkAcceptInput; output: ConflictsBulkAcceptOutput }; "conflicts.list": { input: ConflictsListInput; output: ConflictsListOutput }; "conflicts.propose_revision": { input: ConflictsProposeRevisionInput; output: ConflictsProposeRevisionOutput }; "conflicts.resolve": { input: ConflictsResolveInput; output: ConflictsResolveOutput }; @@ -11607,6 +11660,7 @@ export const OPS: readonly OpSpec[] = [ { name: "collection.move", group: "collection", method: "move", idempotent: true, role: "admin", maturity: "experimental", budgetP99Ms: 80, audit: true, readOnly: false }, { name: "conflicts.allowlist_list", group: "conflicts", method: "allowlistList", idempotent: true, role: "viewer", maturity: "experimental", budgetP99Ms: 80, audit: false, readOnly: true }, { name: "conflicts.allowlist_remove", group: "conflicts", method: "allowlistRemove", idempotent: true, role: "admin", maturity: "experimental", budgetP99Ms: 80, audit: true, readOnly: false }, + { name: "conflicts.bulk_accept", group: "conflicts", method: "bulkAccept", idempotent: true, role: "admin", maturity: "experimental", budgetP99Ms: 5000, audit: true, readOnly: false }, { name: "conflicts.list", group: "conflicts", method: "list", idempotent: true, role: "viewer", maturity: "stable", budgetP99Ms: 80, audit: false, readOnly: true }, { name: "conflicts.propose_revision", group: "conflicts", method: "proposeRevision", idempotent: true, role: "viewer", maturity: "experimental", budgetP99Ms: 120, audit: false, readOnly: true }, { name: "conflicts.resolve", group: "conflicts", method: "resolve", idempotent: true, role: "admin", maturity: "stable", budgetP99Ms: 500, audit: true, readOnly: false }, @@ -11922,4 +11976,4 @@ export const OP_BY_NAME: Readonly> = Object.fromEntries( OPS.map((o) => [o.name, o]), ) as Readonly>; -export const GENERATED_OP_COUNT = 379; +export const GENERATED_OP_COUNT = 380; diff --git a/server/auth/delegation.py b/server/auth/delegation.py index 24e6a0b4ff6..0a1ee46d24f 100644 --- a/server/auth/delegation.py +++ b/server/auth/delegation.py @@ -75,6 +75,7 @@ def mint( *, jti: str | None = None, consumer: str | None = None, + capture_origin: str | None = None, reads_as_creator: bool = False, session_protection: bool = False, answer_mirrors: bool = False, @@ -91,6 +92,7 @@ def mint( read_scope=self.read_scope or None, read_user_id=self.read_user_id or None, consumer=consumer, + capture_origin=capture_origin, jti=jti, parents=self.parents, parent_subjects=self.parent_subjects, diff --git a/server/auth/jwt.py b/server/auth/jwt.py index aac4397106c..6de175d905c 100644 --- a/server/auth/jwt.py +++ b/server/auth/jwt.py @@ -176,6 +176,9 @@ class AuthorizationClaims: # first); rows it stamps read `consumer_source = claimed`. '' = the # request's field, else the subject class, and the row reads self-reported. consumer: str = "" + # A server-issued, signed integration capture capability. It is deliberately + # absent from request models and delegated tokens. + capture_origin: str = "" # `traffic_class` claim: the operator's override of the # class every request under this token runs as — production | # interactive | bench. '' = the namespace row (then the request's hint, @@ -303,6 +306,7 @@ def mint_token( read_user_id: str | None = None, traffic_class: str | None = None, consumer: str | None = None, + capture_origin: str | None = None, jti: str | None = None, session_id: str | None = None, first_party: bool = False, @@ -387,6 +391,7 @@ def mint_token( if not c: raise TokenError(f"consumer must be a printable name, got {consumer!r}") payload["consumer"] = c + _add_capture_origin_claim(payload, capture_origin) if parents: payload["parents"] = list(parents) if parent_subjects: @@ -480,23 +485,9 @@ def verify_token(token: str, *, secret: str | None = None) -> AuthInfo: _check_not_revoked(decoded) - roles: list[Role] = [] - for name in _str_list(decoded, "roles"): - try: - roles.append(Role[name.upper()]) - except KeyError as e: - raise TokenError(f"unknown role in token: {name!r}") from e + roles = _roles_claim(decoded) - ns_roles_claim = decoded.get("ns_roles") or {} - if not isinstance(ns_roles_claim, dict): - raise TokenError("claim 'ns_roles' must be an object") - org = decoded.get("org", "") - if not isinstance(org, str): - raise TokenError("claim 'org' must be a string") - if "\x00" in str(decoded["sub"]): - raise TokenError("claim 'sub' may not contain a NUL character") - if is_reserved_subject(str(decoded["sub"])): - raise TokenError(f"claim 'sub': {RESERVED_SUBJECT}") + ns_roles_claim, org = _identity_claims(decoded) exp = decoded.get("exp") return AuthInfo( @@ -512,6 +503,7 @@ def verify_token(token: str, *, secret: str | None = None) -> AuthInfo: token_id=token_id_of(token, decoded.get("jti")), traffic_class=_traffic_class_claim(decoded.get("traffic_class")), consumer=_consumer_claim(decoded.get("consumer")), + capture_origin=_capture_origin_claim(decoded.get("capture_origin")), parents=tuple(_str_list(decoded, "parents")), parent_subjects=tuple(_str_list(decoded, "parent_subjects")), parent_iats=tuple(_parent_iats(decoded)), @@ -666,6 +658,7 @@ def _verify_end_user(token: str, issuer: str, spec: EndUserIssuer, public_key: A agent_principal=agent, token_id=token_id_of(token, decoded.get("jti")), consumer=_consumer_claim(decoded.get("consumer")), + capture_origin=_capture_origin_claim(decoded.get("capture_origin")), issued_at=iat, expires_at=int(exp), ) @@ -771,6 +764,31 @@ def _str_list(decoded: dict[str, Any], claim: str) -> list[str]: return value +def _roles_claim(decoded: dict[str, Any]) -> list[Role]: + roles: list[Role] = [] + for name in _str_list(decoded, "roles"): + try: + roles.append(Role[name.upper()]) + except KeyError as e: + raise TokenError(f"unknown role in token: {name!r}") from e + return roles + + +def _identity_claims(decoded: dict[str, Any]) -> tuple[dict[str, Any], str]: + ns_roles_claim = decoded.get("ns_roles") or {} + if not isinstance(ns_roles_claim, dict): + raise TokenError("claim 'ns_roles' must be an object") + org = decoded.get("org", "") + if not isinstance(org, str): + raise TokenError("claim 'org' must be a string") + subject = str(decoded["sub"]) + if "\x00" in subject: + raise TokenError("claim 'sub' may not contain a NUL character") + if is_reserved_subject(subject): + raise TokenError(f"claim 'sub': {RESERVED_SUBJECT}") + return ns_roles_claim, org + + def _parent_iats(decoded: dict[str, Any]) -> list[int]: """The `parent_iats` claim, one int per `parent_subjects` entry. A missing or misaligned list is refused: without it an ancestor's cutoff would be @@ -820,6 +838,20 @@ def _consumer_claim(raw: Any) -> str: return claim_consumer(raw) +def _capture_origin_claim(raw: Any) -> str: + """Only recognized signed claims establish captured plugin provenance.""" + return raw if isinstance(raw, str) and raw in {"claude-code", "codex"} else "" + + +def _add_capture_origin_claim(payload: dict[str, Any], raw: str | None) -> None: + if not raw: + return + origin = str(raw).strip() + if origin not in {"claude-code", "codex"}: + raise TokenError("capture_origin must be claude-code or codex") + payload["capture_origin"] = origin + + def _traffic_class_claim(raw: Any) -> str: """The `traffic_class` claim normalised; an unknown value is ignored ('' — the namespace decides) rather than refused, so a token minted by diff --git a/server/identity/api/models.py b/server/identity/api/models.py index 894e97bfc42..5bfd20d6d71 100644 --- a/server/identity/api/models.py +++ b/server/identity/api/models.py @@ -189,6 +189,10 @@ class NamespaceRegisterInput(BaseModel): # Empty ⇒ namespace-level defaults apply uniformly. tag_registry: list[NamespaceTypeConfig] = Field(default_factory=list) default_conflict_policy: ConflictPolicyStr | None = None # fresh: auto_reinforce + # Captured integration conflicts stay human-reviewable unless the owner opts in. + captured_conflict_policy: Literal["manual_review", "resolver_update"] | None = None + # Minimum resolver confidence for an opted-in captured-to-captured update. + captured_conflict_confidence: float | None = Field(default=None, ge=0.5, le=1.0) # How proposals (facts written with memory.set # proposed=true) are decided. None keeps the stored policy; the default # ({"mode": "manual"}) clears it. Only an owner-set `auto` lets loom accept @@ -303,6 +307,8 @@ class NamespaceGetOutput(BaseModel): # How close writes are settled: `auto_reinforce` (the default when unset), # `manual_review`, `newest_wins` or `append_only`. default_conflict_policy: str | None = None + captured_conflict_policy: str = "manual_review" + captured_conflict_confidence: float = 0.98 # How proposals (`memory.set proposed=true`) are decided; the manual default when unset. proposal_policy: ProposalPolicy | None = None # How reads treat the namespace's code-linked memories when their code changes: diff --git a/server/identity/app/me_service_accounts.py b/server/identity/app/me_service_accounts.py index 43bb29811a2..feb75fe5b38 100644 --- a/server/identity/app/me_service_accounts.py +++ b/server/identity/app/me_service_accounts.py @@ -202,6 +202,7 @@ async def save_token( created_by: str, now: datetime, personal: bool = False, + client: str = "", ) -> None: """List the token in its owner's token list (`loom.service_accounts`). Called under the name's claim.""" @@ -238,7 +239,7 @@ async def save_token( "revoked_by": "", "version": version, "kind": "personal_agent" if personal else "service_account", - "client": "", + "client": client, # The gate and the namespace listings read this flag: a token # reads through its creator's live grants (server/auth/service_accounts.py). "inherit_creator_grants": True, @@ -350,6 +351,7 @@ async def _create_token( # otherwise); null: the parent token's when it may # write there, else the first such entry. Not with "*". ttl_days: int|null # default and null: 90 days; 0: never expires + capture_origin?: "claude-code" | "codex" # namespace-admin-issued capture credential Each namespace's role is delegated from the caller's token (`server.auth.delegation.delegate`): at most the caller's live grant on @@ -375,6 +377,29 @@ async def _create_token( name = token_name(payload.get("name"), default=generated_name(naive_utc_now_seconds())) requested_role = _requested_roles(payload) + capture_origin = str(payload.get("capture_origin") or "").strip() + if capture_origin: + if capture_origin not in {"claude-code", "codex"}: + raise _invalid("capture_origin must be claude-code or codex") + explicit_names = [ns for ns in requested_role if ns != "*"] + if ( + personal + or not settings.auth_actually_required() + or "*" in requested_role + or len(explicit_names) != 1 + or requested_role.get(explicit_names[0]) != "writer" + ): + raise _invalid( + "captured credentials require auth, one named namespace and the writer role" + ) + if not await me_callers.caller_admin_of(org, explicit_names[0], subject): + raise HTTPException( + status_code=403, + detail={ + "code": "AUTH_INSUFFICIENT", + "message": "only a namespace admin may issue a captured credential", + }, + ) ttl_seconds = parse_ttl_days(payload.get("ttl_days")) everything = "*" in requested_role asked = asked_saves_to(payload.get("saves_to"), everything=everything) @@ -408,11 +433,21 @@ async def _create_token( ) is_code = await token_grants.code_namespace_predicate(org, list(restricted_roles)) sa_subject = new_token_subject(org, name, subject) - minted = delegated.mint(sa_subject, reads_as_creator=personal) + minted = delegated.mint( + sa_subject, + reads_as_creator=personal, + capture_origin=capture_origin or None, + ) now = naive_utc_now_seconds() # after the mint: the row is never older than the token's iat expires_at = delegated.expires_at(now) await save_token( - name, sa_subject, delegated, created_by=subject, now=now, personal=personal + name, + sa_subject, + delegated, + created_by=subject, + now=now, + personal=personal, + client=capture_origin, ) # A restricted namespace named here is read only when the token's own subject holds a # direct grant: write it now, capped, revoked with the token; a name in the claim alone @@ -456,6 +491,7 @@ async def _create_token( "created_at": now.isoformat(), "expires_at": expires_at.isoformat() if expires_at else None, "restricted_namespaces": restricted_granted, + "capture_origin": capture_origin or None, "mcp_url": mcp_url, "clients": client_configs(mcp_url, minted), } diff --git a/server/identity/app/namespace.py b/server/identity/app/namespace.py index 36acbeabd6f..02d8591076b 100644 --- a/server/identity/app/namespace.py +++ b/server/identity/app/namespace.py @@ -242,6 +242,18 @@ def registry_row( "default_conflict_policy": _set_or_stored( input.default_conflict_policy, existing, "default_conflict_policy", "auto_reinforce" ), + "captured_conflict_policy": _set_or_stored( + input.captured_conflict_policy, + existing, + "captured_conflict_policy", + "manual_review", + ), + "captured_conflict_confidence": _set_or_stored( + input.captured_conflict_confidence, + existing, + "captured_conflict_confidence", + 0.98, + ), "auto_promote_gate": str((existing or {}).get("auto_promote_gate") or "k_supporters"), "evidence_threshold": int((existing or {}).get("evidence_threshold") or 5), # Preserved unless the form set it. @@ -560,6 +572,8 @@ async def handle_namespace_get(input: NamespaceGetInput) -> NamespaceGetOutput: ifNull(rerank_endpoint, '') AS rerank_endpoint, ifNull(classify_endpoint, '') AS classify_endpoint, ifNull(default_conflict_policy, '') AS default_conflict_policy, + ifNull(captured_conflict_policy, 'manual_review') AS captured_conflict_policy, + ifNull(captured_conflict_confidence, 0.98) AS captured_conflict_confidence, proposal_policy, code_change_policy, toString(classification) AS classification, @@ -624,6 +638,8 @@ async def handle_namespace_get(input: NamespaceGetInput) -> NamespaceGetOutput: rerank_endpoint=row.get("rerank_endpoint") or "", classify_endpoint=row.get("classify_endpoint") or "", default_conflict_policy=row.get("default_conflict_policy") or "auto_reinforce", + captured_conflict_policy=row.get("captured_conflict_policy") or "manual_review", + captured_conflict_confidence=float(row.get("captured_conflict_confidence") or 0.98), proposal_policy=_parse_proposal_policy(row.get("proposal_policy")), code_change_policy=code_change.policy_of(str(row.get("code_change_policy") or "")), tag_registry=tag_registry, diff --git a/server/insights/api/models_mentor.py b/server/insights/api/models_mentor.py index 75eddb9019c..0531c7f48ca 100644 --- a/server/insights/api/models_mentor.py +++ b/server/insights/api/models_mentor.py @@ -107,6 +107,9 @@ class MentorBriefOutput(BaseModel): usage: dict[str, int] = Field(default_factory=dict) # Every plane the mentor knows, with this agent's calls to it and whether it is available. planes: list[MentorPlane] = Field(default_factory=list) + # Conflicted memory rows in this namespace, grouped by resolver state and + # trustworthy provenance. These are rows, not distinct conflict pairs. + conflict_backlog: dict[str, dict[str, int]] = Field(default_factory=dict) # The rules that fired for this agent, each with the counts that fired it; empty when none. hints: list[MentorHint] = Field(default_factory=list) # Per hint code, sessions it was shown in and followed in, most shown first; empty when diff --git a/server/insights/app/mentor.py b/server/insights/app/mentor.py index e5f6c656cb2..68aef350e54 100644 --- a/server/insights/app/mentor.py +++ b/server/insights/app/mentor.py @@ -263,6 +263,7 @@ async def namespace_ledger(self) -> None: async def namespace_rows(self) -> None: self.facts.update(await self.store.namespace_rows()) + self.facts["conflict_backlog"] = await self.store.conflict_backlog() async def documents(self) -> None: self.facts["documents"] = await self.store.live_documents() diff --git a/server/insights/app/mentor_brief.py b/server/insights/app/mentor_brief.py index 7ca3564e650..2ff17d99f95 100644 --- a/server/insights/app/mentor_brief.py +++ b/server/insights/app/mentor_brief.py @@ -310,6 +310,7 @@ async def handle_mentor_brief(inp: MentorBriefInput) -> MentorBriefOutput: sessions=profile.sessions, usage=dict(sorted(profile.usage.items(), key=lambda kv: (-kv[1], kv[0]))), planes=_planes(profile), + conflict_backlog=dict(profile.facts.get("conflict_backlog") or {}), hints=hints, adoption=await _adoption(profile), usage_evidence=ladder.rungs, diff --git a/server/insights/app/mentor_rules.py b/server/insights/app/mentor_rules.py index a8d725e2d99..3d691247b6a 100644 --- a/server/insights/app/mentor_rules.py +++ b/server/insights/app/mentor_rules.py @@ -660,17 +660,6 @@ def _rules_shapes(c: _Ctx) -> None: duplicate_sets=dup, sets=sets, ) - conflicted = c.fact("conflicted_rows") - if conflicted > 0 and c.fact("ns_conflict_ops") == 0: - c.add( - "conflicts_pending", - "info", - f"{conflicted} facts in this namespace disagree with another and nobody has looked: " - f"conflicts.list shows the pairs, conflicts.resolve settles one; " - "search penalises them until then.", - ("conflicts.list", "conflicts.resolve"), - conflicted_rows=conflicted, - ) def _coordination_sentence(c: _Ctx, hot_set: bool, hot_get: bool) -> tuple[str, str]: diff --git a/server/insights/store/mentor.py b/server/insights/store/mentor.py index e0508e102b4..a1034248f1f 100644 --- a/server/insights/store/mentor.py +++ b/server/insights/store/mentor.py @@ -314,6 +314,61 @@ async def namespace_rows(self) -> dict[str, int]: for k in ("live_rows", "entity_rows", "conflicted_rows", "coord_keys") } + async def conflict_backlog(self) -> dict[str, dict[str, int]]: + """Namespace-scoped conflicted rows by resolver state and trusted source. + + Capture provenance is unknown unless a server-authenticated source exists; + operation traces identify a code path, not the client that invoked it. + """ + rows = await self.ch.query_all( + """ + SELECT judgement, provenance, count() AS n + FROM ( + SELECT + multiIf( + e.embedding_model = '', 'cosine_only', + e.conflict_checked_at < toDateTime(2, 'UTC') + AND (toUnixTimestamp(e.conflict_checked_at) = 1 + OR (toUnixTimestamp(e.conflict_checked_at) = 0 + AND m.created_at < now() - INTERVAL 60 SECOND)), + 'pending_judgement', + toUnixTimestamp(e.conflict_checked_at) = 2, 'resolver_judged', + 'cosine_only' + ) AS judgement, + if(m.source_class = 'asserted' AND startsWith(m.actor, 'human:'), + 'caller_written', 'unknown') AS provenance + FROM ( + SELECT org, namespace, agent, user_id, session_id, memory_key, version, + created_at, source_class, actor + FROM loom.memory FINAL + WHERE org = {org:String} AND namespace = {ns:String} + AND status = 'conflicted' AND tombstoned_at IS NULL + ) AS m + LEFT JOIN ( + SELECT org, namespace, agent, user_id, session_id, memory_key, version, + max(conflict_checked_at) AS conflict_checked_at, + any(embedding_model) AS embedding_model + FROM loom.memory_embeddings FINAL + WHERE org = {org:String} AND namespace = {ns:String} + AND scope = 'private' AND status = 'conflicted' + GROUP BY org, namespace, agent, user_id, session_id, memory_key, version + ) AS e + USING (org, namespace, agent, user_id, session_id, memory_key, version) + ) + GROUP BY judgement, provenance + """, + params={"org": self.params["org"], "ns": self.params["ns"]}, + ) + result = { + state: {source: 0 for source in ("plugin_captured", "caller_written", "unknown")} + for state in ("pending_judgement", "resolver_judged", "cosine_only") + } + for row in rows: + state, source = str(row.get("judgement") or ""), str(row.get("provenance") or "") + if state in result and source in result[state]: + result[state][source] = int(row.get("n") or 0) + return result + async def live_documents(self) -> int: r = await self._one( f"SELECT count() AS n FROM loom.documents WHERE {_SCOPE} AND superseded_at IS NULL" diff --git a/server/memory/api/models_conflicts.py b/server/memory/api/models_conflicts.py index d6ed65eb73a..9c22b4e8098 100644 --- a/server/memory/api/models_conflicts.py +++ b/server/memory/api/models_conflicts.py @@ -55,6 +55,24 @@ class _ConflictRow(ProjectedRow): content_sha256: str = "" # "" for a high row # Sensitivity tier ('' | low | medium | high); a high row comes without its value. sensitivity: str = "" + # Server-stamped capture provenance; blank means caller-written or legacy/unknown. + capture_origin: str = "" + + +class ConflictSourceCounts(BaseModel): + """Conflicted row counts for one resolver state, not pair counts.""" + + plugin_captured: int = 0 + caller_written: int = 0 + unknown: int = 0 + + +class ConflictBacklog(BaseModel): + """Conflicted rows split by resolver state and conservative provenance.""" + + pending_judgement: ConflictSourceCounts = Field(default_factory=ConflictSourceCounts) + resolver_judged: ConflictSourceCounts = Field(default_factory=ConflictSourceCounts) + cosine_only: ConflictSourceCounts = Field(default_factory=ConflictSourceCounts) class ConflictsListOutput(BaseModel): @@ -67,6 +85,8 @@ class ConflictsListOutput(BaseModel): total: int | None = None # The pending proposals in the same scope, from the same read; set on a count_only call. proposals: int | None = None + # Row-based backlog split, present on `count_only`; reciprocal links are not pairs. + backlog: ConflictBacklog | None = None # The conflicted memory keys of the namespace; set on a keys_only call. keys: list[str] | None = None @@ -107,6 +127,39 @@ class ConflictsResolveOutput(BaseModel): total: int | None = None +class ConflictsResolverAcceptItem(BaseModel): + # The row the resolver judged (the suggested winner) and its current peer. + memory_id: str + peer_id: str + # Current revisions observed with the resolver suggestion. + memory_sha256: str = Field(min_length=64, max_length=64) + peer_sha256: str = Field(min_length=64, max_length=64) + # The hash of the resolver audit row that supplied the suggestion. + suggestion_hash: str = Field(min_length=64, max_length=64) + + +class ConflictsBulkAcceptInput(BaseModel): + org: str + namespace: str + # Bounded so a request cannot monopolize the resolver or audit store. + items: list[ConflictsResolverAcceptItem] = Field(min_length=1, max_length=100) + + +class _ConflictBulkResult(BaseModel): + memory_id: str + peer_id: str + status: Literal["resolved", "stale", "failed"] + reason: str = "" + + +class ConflictsBulkAcceptOutput(BaseModel): + results: list[_ConflictBulkResult] + requested: int + resolved: int + stale: int + failed: int + + class ConflictsProposeRevisionInput(BaseModel): org: str namespace: str diff --git a/server/memory/api/models_crud.py b/server/memory/api/models_crud.py index ce3e6ef8353..bf25ce5da1b 100644 --- a/server/memory/api/models_crud.py +++ b/server/memory/api/models_crud.py @@ -676,6 +676,10 @@ class MemoryAutoRetirement(BaseModel): judge_confidence: float | None = None judge_model: str = "" judge_prompt_version: str = "" + # Captured-memory settlement metadata; empty on other automatic paths. + applied_policy: str = "" + winner_capture_origin: str = "" + retired_capture_origin: str = "" class MemoryAutoRetirementsOutput(BaseModel): diff --git a/server/memory/api/ops_conflicts.py b/server/memory/api/ops_conflicts.py index 15d33fc7cd8..e199d01b1c7 100644 --- a/server/memory/api/ops_conflicts.py +++ b/server/memory/api/ops_conflicts.py @@ -7,6 +7,8 @@ ConflictsAllowlistListOutput, ConflictsAllowlistRemoveInput, ConflictsAllowlistRemoveOutput, + ConflictsBulkAcceptInput, + ConflictsBulkAcceptOutput, ConflictsListInput, ConflictsListOutput, ConflictsProposeRevisionInput, @@ -17,6 +19,7 @@ from server.memory.app.conflicts_ops import ( handle_conflicts_allowlist_list, handle_conflicts_allowlist_remove, + handle_conflicts_bulk_accept, handle_conflicts_list, handle_conflicts_propose_revision, handle_conflicts_resolve, @@ -43,6 +46,17 @@ audit=True, ) +conflicts_bulk_accept = Operation( + name="conflicts.bulk_accept", + maturity="experimental", + input_model=ConflictsBulkAcceptInput, + output_model=ConflictsBulkAcceptOutput, + handler=handle_conflicts_bulk_accept, + idempotent=True, + required_role=Role.ADMIN, + audit=True, +) + conflicts_propose_revision = Operation( name="conflicts.propose_revision", @@ -83,6 +97,7 @@ conflicts_list, conflicts_propose_revision, conflicts_resolve, + conflicts_bulk_accept, conflicts_allowlist_list, conflicts_allowlist_remove, ] diff --git a/server/memory/app/auto_resolution.py b/server/memory/app/auto_resolution.py index 0d6fa7d25d4..8b547310b86 100644 --- a/server/memory/app/auto_resolution.py +++ b/server/memory/app/auto_resolution.py @@ -65,6 +65,9 @@ "judge_confidence", "judge_model", "judge_prompt_version", + "applied_policy", + "winner_capture_origin", + "retired_capture_origin", ) diff --git a/server/memory/app/conflict_resolver.py b/server/memory/app/conflict_resolver.py index 5b81f810acd..e7a9b6276b2 100644 --- a/server/memory/app/conflict_resolver.py +++ b/server/memory/app/conflict_resolver.py @@ -522,6 +522,38 @@ async def _settle_locked_pair( str(head.memory_id) in row.conflict_with or str(row.memory_id) in head.conflict_with ): return None, None # nothing flagged between them: nothing to clear + captured_update = bool( + action in (cr.FLAG, cr.RETIRE) + and cr.captured_update_eligible( + policy=why.get("captured_conflict_policy", ""), + verdict=why.get("judge_verdict", ""), + confidence=float(why.get("judge_confidence", "0")), + threshold=float(why.get("captured_conflict_confidence", "1")), + same_entity=why.get("judge_same_entity") == "true", + same_attribute=why.get("judge_same_attribute") == "true", + winner_origin=str(getattr(row, "capture_origin", "")), + retired_origin=str(getattr(head, "capture_origin", "")), + winner_agent=str(row.agent), + retired_agent=str(head.agent), + winner_user_id=str(row.user_id), + retired_user_id=str(head.user_id), + cross_session=_cross_session( + row, + {"agent": str(head.agent), "session_id": str(head.session_id)}, + ), + ) + ) + if captured_update: + action = cr.RETIRE + why = dict(why) | { + "applied_policy": "captured_resolver_update", + "winner_capture_origin": str(getattr(row, "capture_origin", "")), + "retired_capture_origin": str(getattr(head, "capture_origin", "")), + } + elif action == cr.RETIRE and (_capture_origin(row) or _capture_origin(head)): + # A captured row never auto-settles against a human or unknown row, and + # the owner’s manual-review setting overrides the general namespace policy. + action = cr.FLAG if action in (cr.RETIRE, cr.FLAG): # Read under the locks: a valid_at corrected during the call moves the order. # If this read fails the row stays unstamped and the next pass judges it again @@ -558,6 +590,9 @@ async def _settle_locked_pair( else: counts.cleared += 1 taken: dict[str, Any] = {"action": action} + if captured_update and action == cr.RETIRE: + taken["applied_policy"] = "captured_resolver_update" + taken["retired_capture_origin"] = str(getattr(head, "capture_origin", "")) if outranked: taken["reason"] = await _record_outranked(org, namespace, row, head) if action == cr.RETIRE and str(head.memory_id) in row.conflict_with: @@ -567,6 +602,10 @@ async def _settle_locked_pair( return taken, retired +def _capture_origin(row: Any) -> str: + return str(getattr(row, "capture_origin", "") or "") + + async def _outranked(org: str, namespace: str, row: Any, peer: Any) -> bool: """Whether `peer`'s standing is above the judged row's, which would retire it (`server.memory.domain.standing`).""" @@ -654,6 +693,8 @@ async def resolve_row( policy: str, counts: Counts, shown: frozenset[str] = frozenset(), + captured_policy: str = "manual_review", + captured_confidence: float = 0.98, ) -> frozenset[str] | None: """Judge one queue row, act on its pairs and stamp it judged; a provider failure raises and the row stays owed. Returns None once stamped (or skipped), else the ids @@ -699,7 +740,16 @@ async def resolve_row( if peers: row, peers = await _still_unprotected(org, row, peers) if row is not None and peers: - unanswered = await _judge_and_act(org, namespace, row, peers, policy=policy, counts=counts) + unanswered = await _judge_and_act( + org, + namespace, + row, + peers, + policy=policy, + counts=counts, + captured_policy=captured_policy, + captured_confidence=captured_confidence, + ) judged_ids = frozenset(str(p["memory_id"]) for p in peers) if unanswered & {str(x) for x in row.conflict_with} or cluster.flags_left: # A flagged peer the answer left out, or one past the cluster's places: stamped, @@ -817,6 +867,8 @@ async def _judge_and_act( *, policy: str, counts: Counts, + captured_policy: str = "manual_review", + captured_confidence: float = 0.98, ) -> set[str]: """Judge the row and act on the answer; the ids of the peers it gave no verdict.""" found = await _assertion_order(org, namespace, [row, *peers]) @@ -837,7 +889,20 @@ async def _judge_and_act( verdicts, model = await judge(new, notes) counts.judged += 1 acting = asyncio.ensure_future( - _act_on_verdicts(org, namespace, row, peers, verdicts, policy, counts, model, new, notes) + _act_on_verdicts( + org, + namespace, + row, + peers, + verdicts, + policy, + counts, + model, + new, + notes, + captured_policy=captured_policy, + captured_confidence=captured_confidence, + ) ) try: await asyncio.shield(acting) @@ -868,6 +933,9 @@ async def _act_on_verdicts( model: str, new: cr.Note, notes: list[cr.Note], + *, + captured_policy: str = "manual_review", + captured_confidence: float = 0.98, ) -> None: """Settle each pair the answer acts on, then one audit row for the row, written even when a later pair fails, for the pairs done. `new` and `notes`: the row and its @@ -885,6 +953,19 @@ async def _act_on_verdicts( if v is None else _action(v, policy, cross_session=cross, same_written=same) ) + if ( + v is not None + and captured_policy == "resolver_update" + and v.verdict == cr.UPDATE + and v.same_entity + and v.same_attribute + and v.confidence >= captured_confidence + and action == cr.NOTHING + and not cross + ): + # The owner lowered the floor; the locked re-read must still + # prove that both rows carry trusted capture provenance. + action = cr.FLAG if v is None or action == cr.NOTHING: # Unsure, self-contradicting, or a peer the answer left out: the pair # stays as it is. @@ -893,14 +974,26 @@ async def _act_on_verdicts( why = { "judge_verdict": v.verdict, "judge_confidence": str(v.confidence), + "judge_same_entity": str(v.same_entity).lower(), + "judge_same_attribute": str(v.same_attribute).lower(), "judge_model": model, "judge_prompt_version": cr.PROMPT_VERSION, + "captured_conflict_policy": captured_policy, + "captured_conflict_confidence": str(captured_confidence), + "captured_origin": str(getattr(row, "capture_origin", "") or ""), } taken = await _settle_pair(org, namespace, row, peer, action, counts, why=why) if taken is not None: acted.append( {"peer_id": str(peer["memory_id"]), **taken} - | {"verdict": v.verdict, "confidence": v.confidence} + | { + "verdict": v.verdict, + "confidence": v.confidence, + "same_entity": v.same_entity, + "same_attribute": v.same_attribute, + "memory_sha256": str(row.content_sha256 or ""), + "peer_sha256": str(peer.get("content_sha256") or ""), + } ) except BaseException: # The pairs done still get their audit row, and the error raised is the one that diff --git a/server/memory/app/conflicts_ops.py b/server/memory/app/conflicts_ops.py index 855fb5cf76b..7883293c59d 100644 --- a/server/memory/app/conflicts_ops.py +++ b/server/memory/app/conflicts_ops.py @@ -2,12 +2,13 @@ from __future__ import annotations +import asyncio import itertools import logging import time -from contextlib import nullcontext +from contextlib import AsyncExitStack, nullcontext from datetime import datetime -from typing import Any +from typing import Any, Literal from server.core.ch import sequential_reads from server.core.datetimes import naive_utc_now @@ -15,10 +16,13 @@ from server.identity.app.request_scope import request_scope from server.identity.domain.read_scope import WHOLE_NAMESPACE, ReadFilters, scope_and from server.memory.api.models_conflicts import ( + ConflictBacklog, ConflictsAllowlistListInput, ConflictsAllowlistListOutput, ConflictsAllowlistRemoveInput, ConflictsAllowlistRemoveOutput, + ConflictsBulkAcceptInput, + ConflictsBulkAcceptOutput, ConflictsListInput, ConflictsListOutput, ConflictsProposeRevisionInput, @@ -26,6 +30,7 @@ ConflictsResolveInput, ConflictsResolveOutput, _AllowlistRow, + _ConflictBulkResult, _ConflictCandidateMemory, _ConflictRevisionSuggestion, _ConflictRow, @@ -38,7 +43,9 @@ # Each count read takes the next ticket when it starts; a cached entry keeps its read's ticket. _count_tickets = itertools.count(1) -_count_cache: dict[tuple[str, str, ReadFilters], tuple[float, int, tuple[int, int]]] = {} +_count_cache: dict[ + tuple[str, str, ReadFilters], tuple[float, int, tuple[int, int, dict[str, dict[str, int]]]] +] = {} # A read whose ticket is at or below its namespace's drop, or the last full reset, caches nothing. _counts_dropped_at: dict[tuple[str, str], int] = {} _counts_reset_at = 0 @@ -64,10 +71,8 @@ def forget_review_counts(org: str, namespace: str) -> None: async def _review_counts_cached( repo: Any, org: str, namespace: str, scope: ReadFilters, *, fresh: bool = False -) -> tuple[int, int]: - """The conflicted and pending counts, from this replica's cache unless `fresh`. A fresh - count reads with sequential consistency, so a replica that has yet to apply a decision - cannot serve it, and refreshes the cache.""" +) -> tuple[int, int, dict[str, dict[str, int]]]: + """Review counts and the row backlog split, cached together per read scope.""" key = (org, namespace, scope) hit = _count_cache.get(key) now = time.monotonic() @@ -76,7 +81,8 @@ async def _review_counts_cached( ticket = next(_count_tickets) with sequential_reads() if fresh else nullcontext(): conflicted, proposed = await repo.count_review(org, namespace, scope=scope) - counts = (int(conflicted), int(proposed)) + backlog = await repo.count_conflict_backlog(org, namespace, scope=scope) + counts = (int(conflicted), int(proposed), backlog) hit = _count_cache.get(key) dropped = max(_counts_reset_at, _counts_dropped_at.get((org, namespace), 0)) if ticket <= dropped or (hit is not None and hit[1] > ticket): @@ -103,10 +109,15 @@ async def handle_conflicts_list( # (org, namespace) per `memory_conflicts_count_ttl_s` serves them all, and the count # reads no value column — reading the rows costs ~33 MB per tick on a large namespace. # The same read counts the pending proposals, so the Review queue badge is one request. - total, proposals = await _review_counts_cached( + total, proposals, backlog = await _review_counts_cached( conflicts_repo, input.org, input.namespace, scope, fresh=input.fresh ) - return ConflictsListOutput(rows=[], total=total, proposals=proposals) + return ConflictsListOutput( + rows=[], + total=total, + proposals=proposals, + backlog=ConflictBacklog.model_validate(backlog), + ) rows = await conflicts_repo.list_conflicted( input.org, input.namespace, @@ -360,7 +371,7 @@ async def handle_conflicts_resolve( total: int | None = None try: # fresh reads with sequential consistency, so the count sees the writes above - total, _ = await _review_counts_cached( + total, _, _ = await _review_counts_cached( conflicts_repo, input.org, input.namespace, request_scope(), fresh=True ) except Exception as e: # noqa: BLE001 — the count never fails an applied resolve @@ -374,6 +385,197 @@ async def handle_conflicts_resolve( ) +async def handle_conflicts_bulk_accept( + input: ConflictsBulkAcceptInput, +) -> ConflictsBulkAcceptOutput: + """Accept current hash-only resolver update suggestions independently. + + The transport requires ADMIN and authorizes the named namespace. Each item is + checked against the latest pair judgement, current row hashes, flags, pins and Undo + records before delegating the actual state change to the existing resolve handler. + """ + results: list[_ConflictBulkResult] = [] + seen: set[tuple[str, str]] = set() + for item in input.items: + pair = (item.memory_id, item.peer_id) + if pair in seen: + results.append(_bulk_accept_result(item, "failed", "Duplicate item")) + continue + seen.add(pair) + try: + results.append(await _accept_bulk_item(input, item)) + except Exception as e: # noqa: BLE001 — one item failure must not stop independent selections + log.warning("conflicts.bulk_accept: item failed for %s: %s", item.memory_id, e) + results.append(_bulk_accept_result(item, "failed", "Item could not be resolved")) + return ConflictsBulkAcceptOutput( + results=results, + requested=len(results), + resolved=sum(r.status == "resolved" for r in results), + stale=sum(r.status == "stale" for r in results), + failed=sum(r.status == "failed" for r in results), + ) + + +def _bulk_accept_result( + item: Any, status: Literal["resolved", "stale", "failed"], reason: str = "" +) -> _ConflictBulkResult: + return _ConflictBulkResult( + memory_id=item.memory_id, peer_id=item.peer_id, status=status, reason=reason + ) + + +async def _accept_bulk_item(input: ConflictsBulkAcceptInput, item: Any) -> _ConflictBulkResult: + from server.memory.app.provenance import writer_actor + from server.observability import audit + + stale_reason = await _bulk_suggestion_stale_reason(input, item) + if stale_reason: + return _bulk_accept_result(item, "stale", stale_reason) + applied = await _resolve_current_bulk_pair(input, item) + if isinstance(applied, _ConflictBulkResult): + return applied + if not applied.resolved: + return _bulk_accept_result(item, "stale", "Conflict is no longer open") + await audit.emit( + "memory.conflict_suggestion_accepted", + org=input.org, + namespace=input.namespace, + actor=writer_actor("process:loom"), + subject={ + "memory_id": item.memory_id, + "peer_id": item.peer_id, + "memory_sha256": item.memory_sha256, + "peer_sha256": item.peer_sha256, + "suggestion_hash": item.suggestion_hash, + "decision": "revise", + }, + ) + return _bulk_accept_result(item, "resolved") + + +async def _bulk_suggestion_stale_reason(input: ConflictsBulkAcceptInput, item: Any) -> str | None: + import json + + from server.memory.store import conflicts as conflicts_repo + from server.observability import audit + + event = await conflicts_repo.latest_resolver_pair_audit( + input.org, input.namespace, item.memory_id, item.peer_id + ) + stored_hash = event.get("row_hash", "") if event else "" + if isinstance(stored_hash, bytes): + stored_hash = stored_hash.decode("utf-8") + if event is None or str(stored_hash).rstrip("\x00") != item.suggestion_hash: + return "Resolver suggestion changed" + if not audit.row_matches_hash(event): + return "Resolver audit record failed verification" + subject = json.loads(str(event["subject"])) + pair_record = ( + next( + (p for p in subject.get("pairs", []) if str(p.get("peer_id")) == item.peer_id), + None, + ) + if str(subject.get("memory_id")) == item.memory_id + else None + ) + eligible = bool( + pair_record + and pair_record.get("action") == "flag" + and pair_record.get("verdict") == "update" + and pair_record.get("same_entity") is True + and pair_record.get("same_attribute") is True + and str(subject.get("content_sha256") or "") == item.memory_sha256 + and str(pair_record.get("memory_sha256") or "") == item.memory_sha256 + and str(pair_record.get("peer_sha256") or "") == item.peer_sha256 + ) + return None if eligible else "Suggestion is not an eligible update" + + +async def _resolve_current_bulk_pair( + input: ConflictsBulkAcceptInput, item: Any +) -> ConflictsResolveOutput | _ConflictBulkResult: + import server.memory.store as memory_repo + from server.memory.app import conflict_resolver as resolver + from server.memory.app.provenance import writer_actor + from server.memory.store import conflict_resolver as resolver_queue + from server.memory.store.key_write_lock import key_write_locks, lock_name + + rows = await _bulk_memory_pair(memory_repo, input, item) + winner, loser = rows + if winner is None or loser is None or winner.tombstoned_at or loser.tombstoned_at: + return _bulk_accept_result(item, "stale", "A memory is no longer live") + names = sorted( + {resolver_queue.key_identity(winner), resolver_queue.key_identity(loser)}, + key=lambda key: lock_name(input.org, input.namespace, *key), + ) + async with AsyncExitStack() as stack: + for identity in names: + await stack.enter_async_context( + key_write_locks.hold(input.org, input.namespace, *identity) + ) + winner, loser = await _bulk_memory_pair(memory_repo, input, item) + if not _bulk_pair_is_current(winner, loser, item): + return _bulk_accept_result(item, "stale", "Memory revision or conflict changed") + if _bulk_pair_is_protected(winner, loser): + return _bulk_accept_result(item, "failed", "A memory is protected from bulk acceptance") + order = await resolver._assertion_order(input.org, input.namespace, [winner, loser]) + if resolver._undone(winner, loser, order.when, order.undos): + return _bulk_accept_result(item, "failed", "An Undo or erasure protects this pair") + if await resolver_queue.under_erasure(input.org): + return _bulk_accept_result(item, "failed", "An Undo or erasure protects this pair") + return await handle_conflicts_resolve( + ConflictsResolveInput( + org=input.org, + namespace=input.namespace, + memory_id=item.memory_id, + peer_id=item.peer_id, + decision="revise", + reason="resolver suggestion accepted", + resolved_by=writer_actor(), + ) + ) + + +async def _bulk_memory_pair( + repo: Any, input: ConflictsBulkAcceptInput, item: Any +) -> tuple[Any, Any]: + return await asyncio.gather( + repo.get_by_id( + item.memory_id, + org=input.org, + namespace=input.namespace, + scope=WHOLE_NAMESPACE, + fresh=True, + strong=True, + ), + repo.get_by_id( + item.peer_id, + org=input.org, + namespace=input.namespace, + scope=WHOLE_NAMESPACE, + fresh=True, + strong=True, + ), + ) + + +def _bulk_pair_is_current(winner: Any, loser: Any, item: Any) -> bool: + return ( + winner is not None + and loser is not None + and str(winner.content_sha256 or "") == item.memory_sha256 + and str(loser.content_sha256 or "") == item.peer_sha256 + and str(winner.status) == "conflicted" + and str(loser.status) == "conflicted" + and item.peer_id in {str(peer) for peer in winner.conflict_with} + and item.memory_id in {str(peer) for peer in loser.conflict_with} + ) + + +def _bulk_pair_is_protected(winner: Any, loser: Any) -> bool: + return any(row.pinned or str(row.sensitivity or "") == "high" for row in (winner, loser)) + + async def _allow_pairs( input: ConflictsResolveInput, peers: list[str], *, now: datetime, by: str, reason: str ) -> None: diff --git a/server/memory/app/provenance.py b/server/memory/app/provenance.py index 992321bf0ad..458fabc321c 100644 --- a/server/memory/app/provenance.py +++ b/server/memory/app/provenance.py @@ -23,3 +23,12 @@ def writer_actor(fallback: str = "") -> str: if not subject: return pipeline_actor_var.get() or fallback or "" return trust.actor_for(subject, is_service_account=bool(auth.is_service_account)) + + +def capture_origin() -> str: + """The integration origin bound to the verified token; request fields never set it.""" + from server.auth.context import current_auth + + auth = current_auth() + origin = str(getattr(auth, "capture_origin", "") or "") if auth is not None else "" + return origin if origin in {"claude-code", "codex"} else "" diff --git a/server/memory/domain/conflict_resolution.py b/server/memory/domain/conflict_resolution.py index e1f143b5432..318d048dd3f 100644 --- a/server/memory/domain/conflict_resolution.py +++ b/server/memory/domain/conflict_resolution.py @@ -321,6 +321,41 @@ def action_for( return CLEAR +def captured_update_eligible( + *, + policy: str, + verdict: str, + confidence: float, + threshold: float, + same_entity: bool, + same_attribute: bool, + winner_origin: str, + retired_origin: str, + winner_agent: str, + retired_agent: str, + winner_user_id: str, + retired_user_id: str, + cross_session: bool, +) -> bool: + """Whether an owner-approved resolver update may settle captured rows. + + All provenance arguments come from the signed capture claim persisted on each + row; caller supplied actor, source_class and source_trace are not evidence. + """ + return ( + policy == "resolver_update" + and verdict == UPDATE + and same_entity + and same_attribute + and confidence >= threshold + and winner_origin in {"claude-code", "codex"} + and retired_origin in {"claude-code", "codex"} + and winner_agent == retired_agent + and winner_user_id == retired_user_id + and not cross_session + ) + + def later_close_siblings(vectors: list[list[float]], types: list[str], floor: float) -> set[int]: """The indexes of a batch's rows that have an EARLIER row of the same type at cosine >= `floor`. The verdicts compare each row with the store only, so an diff --git a/server/memory/store/conflicts.py b/server/memory/store/conflicts.py index 82cda654ae0..dac889ac92d 100644 --- a/server/memory/store/conflicts.py +++ b/server/memory/store/conflicts.py @@ -64,7 +64,7 @@ async def list_conflicted( located = await ch.query_all( f""" SELECT memory_id, memory_key, memory_type, version, - pinned, created_at, conflict_with, sensitivity + pinned, created_at, conflict_with, sensitivity, capture_origin FROM loom.memory FINAL WHERE {" AND ".join(where)} ORDER BY version DESC @@ -109,6 +109,35 @@ async def list_conflicted( return out +async def latest_resolver_pair_audit( + org: str, namespace: str, memory_id: str, peer_id: str, *, ch: _CHClient | None = None +) -> dict[str, Any] | None: + """Latest resolver audit row that judged this exact pair in either direction.""" + ch = ch or _default_client() + rows = await ch.query_all( + """ + SELECT ts, event_type, org, namespace, actor, subject, request_id, row_hash + FROM loom.audit_log + WHERE org = {org:String} + AND namespace = {ns:String} + AND event_type = 'memory.conflict_resolver' + AND ( + (JSONExtractString(subject, 'memory_id') = {mid:String} + AND arrayExists(p -> JSONExtractString(p, 'peer_id') = {peer:String}, + JSONExtractArrayRaw(subject, 'pairs'))) + OR + (JSONExtractString(subject, 'memory_id') = {peer:String} + AND arrayExists(p -> JSONExtractString(p, 'peer_id') = {mid:String}, + JSONExtractArrayRaw(subject, 'pairs'))) + ) + ORDER BY ts DESC, row_hash DESC + LIMIT 1 + """, + params={"org": org, "ns": namespace, "mid": memory_id, "peer": peer_id}, + ) + return dict(rows[0]) if rows else None + + async def _ids_in_scope( ch: _CHClient, org: str, namespace: str, memory_ids: list[str], scope: ReadFilters ) -> set[str]: @@ -157,6 +186,77 @@ async def count_review( return int(row.get("conflicted") or 0), int(row.get("proposed") or 0) +async def count_conflict_backlog( + org: str, + namespace: str, + *, + scope: ReadFilters, + ch: _CHClient | None = None, +) -> dict[str, dict[str, int]]: + """Count conflicted rows by resolver mark and conservative source evidence. + + Counts are rows, not independent pairs: links can be reciprocal and a cluster can + connect more than two rows. Unknown provenance stays visible as its own bucket. + """ + ch = ch or _default_client() + params: dict[str, Any] = {"org": org, "ns": namespace} + scope_filters = "".join(f" AND {part}" for part in scope_where(scope, params)) + rows = await ch.query_all( + f""" + SELECT judgement, provenance, count() AS n + FROM ( + SELECT + multiIf( + e.embedding_model = '', 'cosine_only', + e.conflict_checked_at < toDateTime(2, 'UTC') + AND (toUnixTimestamp(e.conflict_checked_at) = 1 + OR (toUnixTimestamp(e.conflict_checked_at) = 0 + AND m.created_at < now() - INTERVAL 60 SECOND)), + 'pending_judgement', + toUnixTimestamp(e.conflict_checked_at) = 2, 'resolver_judged', + 'cosine_only' + ) AS judgement, + multiIf( + m.capture_origin IN ('claude-code', 'codex'), 'plugin_captured', + m.source_class = 'asserted' AND startsWith(m.actor, 'human:'), + 'caller_written', + 'unknown' + ) AS provenance + FROM ( + SELECT org, namespace, agent, user_id, session_id, memory_key, version, + created_at, source_class, actor, capture_origin + FROM loom.memory FINAL + WHERE org = {{org:String}} AND namespace = {{ns:String}} + AND status = 'conflicted' AND tombstoned_at IS NULL + {scope_filters} + ) AS m + LEFT JOIN ( + SELECT org, namespace, agent, user_id, session_id, memory_key, version, + max(conflict_checked_at) AS conflict_checked_at, + any(embedding_model) AS embedding_model + FROM loom.memory_embeddings FINAL + WHERE org = {{org:String}} AND namespace = {{ns:String}} + AND scope = 'private' AND status = 'conflicted' + GROUP BY org, namespace, agent, user_id, session_id, memory_key, version + ) AS e + USING (org, namespace, agent, user_id, session_id, memory_key, version) + ) + GROUP BY judgement, provenance + """, + params=params, + ) + result = { + judgement: {source: 0 for source in ("plugin_captured", "caller_written", "unknown")} + for judgement in ("pending_judgement", "resolver_judged", "cosine_only") + } + for row in rows: + judgement = str(row.get("judgement") or "") + provenance = str(row.get("provenance") or "") + if judgement in result and provenance in result[judgement]: + result[judgement][provenance] = int(row.get("n") or 0) + return result + + async def conflicted_keys( org: str, namespace: str, @@ -411,7 +511,8 @@ async def namespace_write_row( namespace has no row).""" ch = ch or _default_client() row = await ch.query_one( - "SELECT conflict_threshold, duplicate_threshold, default_conflict_policy " + "SELECT conflict_threshold, duplicate_threshold, default_conflict_policy, " + "captured_conflict_policy, captured_conflict_confidence " "FROM loom.namespaces FINAL " "WHERE org = {org:String} AND namespace = {ns:String} LIMIT 1", params={"org": org, "ns": namespace}, diff --git a/server/memory/store/rows.py b/server/memory/store/rows.py index e248f69a74a..3d3c45ec150 100644 --- a/server/memory/store/rows.py +++ b/server/memory/store/rows.py @@ -165,6 +165,7 @@ class MemoryRow(BaseModel): # observed | derived | imported | external). actor: str = "" source_class: str = "" + capture_origin: str = "" # Write-time lock. '' = unlocked; a past lock_until means # the lock lapsed. Read through # server/memory/domain/lock.effective_mode, never the raw column. @@ -315,6 +316,7 @@ def memory_head_state(row: MemoryRow | None) -> dict[str, Any] | None: "locked_at", "on_expire", "expire_reason", + "capture_origin", ) @@ -340,6 +342,7 @@ def memory_head_state(row: MemoryRow | None) -> dict[str, Any] | None: "locked_by", "on_expire", "expire_reason", + "capture_origin", } ) @@ -551,6 +554,11 @@ def build_first_version_row(new: Mapping[str, Any], *, now: datetime) -> dict[st row.setdefault("last_reinforced_at", now) row.setdefault("created_at", now) row.update(new) + # A write's capture origin comes only from the verified token claim, never + # from memory.set input. Existing row updates use build_memory_version_row. + from server.memory.app.provenance import capture_origin + + row["capture_origin"] = capture_origin() row["requires_review"] = int( bool(row.get("requires_review")) or row.get("status") in {"proposed"} ) @@ -914,6 +922,7 @@ def _hydrate(row: dict[str, Any]) -> MemoryRow: grounding=row.get("grounding", "") or "", actor=row.get("actor", "") or "", source_class=row.get("source_class", "") or "", + capture_origin=row.get("capture_origin", "") or "", evidence=row.get("evidence", "") or "", sensitivity=str(row.get("sensitivity", "") or ""), lock_mode=row.get("lock_mode", "") or "", diff --git a/server/memory/workers/conflict_resolver.py b/server/memory/workers/conflict_resolver.py index ce1dc14c4c0..5218d9cebda 100644 --- a/server/memory/workers/conflict_resolver.py +++ b/server/memory/workers/conflict_resolver.py @@ -143,7 +143,13 @@ async def _queued(p: _Pass) -> tuple[dict[tuple[str, str], list[dict[str, Any]]] return groups, full -async def _resolve_one(p: _Pass, r: dict[str, Any], policy: str) -> None: +async def _resolve_one( + p: _Pass, + r: dict[str, Any], + policy: str, + captured_policy: str = "manual_review", + captured_confidence: float = 0.98, +) -> None: from server.observability import cost_accumulator from server.observability.budget import namespace_over_cap from server.observability.events import get_emitter @@ -165,7 +171,9 @@ async def _resolve_one(p: _Pass, r: dict[str, Any], policy: str) -> None: if await namespace_over_cap(org, namespace, **_cap_share()): counts.skipped_budget += 1 return - await _judge_row(p, r, org, namespace, policy, counts) + await _judge_row( + p, r, org, namespace, policy, counts, captured_policy, captured_confidence + ) except customer.GROUP_HOLDS as e: _HELD.hold([_identity(r)], hold_seconds(e)) except resolver.PeerBehind: @@ -212,11 +220,20 @@ async def _judge_row( namespace: str, policy: str, counts: resolver.Counts, + captured_policy: str = "manual_review", + captured_confidence: float = 0.98, ) -> None: """Judge one row; a row it leaves owed after a call counts an attempt.""" key = _attempt_key(r) shown = _state.attempts.get(key, (0, frozenset()))[1] - judged = await resolver.resolve_row(r, policy=policy, counts=counts, shown=shown) + judged = await resolver.resolve_row( + r, + policy=policy, + counts=counts, + shown=shown, + captured_policy=captured_policy, + captured_confidence=captured_confidence, + ) _after_row(p, org, namespace, key, counts, judged) if judged is not None and await _out_of_attempts(r, judged): counts.errored += 1 @@ -318,12 +335,15 @@ async def _stamp_refused(p: _Pass) -> None: async def _resolve_all(p: _Pass, groups: dict[tuple[str, str], list[dict[str, Any]]]) -> None: """Every row of the pass, `memory_conflict_resolver_concurrency` at a time.""" from server.core.ch import get_client - from server.memory.app.conflicts import namespace_conflict_policy + from server.memory.store import conflicts as conflicts_repo jobs = [] for (org, namespace), rows in groups.items(): - policy = await namespace_conflict_policy(org, namespace, ch=get_client()) - jobs += [_resolve_one(p, r, policy) for r in rows] + ns = await conflicts_repo.namespace_write_row(org, namespace, ch=get_client()) + policy = str(ns.get("default_conflict_policy") or "auto_reinforce") + captured_policy = str(ns.get("captured_conflict_policy") or "manual_review") + captured_confidence = float(ns.get("captured_conflict_confidence") or 0.98) + jobs += [_resolve_one(p, r, policy, captured_policy, captured_confidence) for r in rows] # A task group: whatever escapes a row cancels the others and waits for them, so # the pass never ends while a row still writes. async with asyncio.TaskGroup() as group: diff --git a/server/operations/reach_manifest.py b/server/operations/reach_manifest.py index df5e640e8f2..7ccc919f4d4 100644 --- a/server/operations/reach_manifest.py +++ b/server/operations/reach_manifest.py @@ -216,8 +216,13 @@ "sdk_method", "dashboard", ), + "conflicts.bulk_accept": ( + "sdk_method", + "dashboard", + ), "conflicts.list": ( "sdk_method", + "plugin_hook", "dashboard", ), "conflicts.propose_revision": ( diff --git a/server/operations/toolsets.py b/server/operations/toolsets.py index 719bfc86385..3931d0b7074 100644 --- a/server/operations/toolsets.py +++ b/server/operations/toolsets.py @@ -41,6 +41,8 @@ "memory.dedup_collapse", "memory.outcome", "memory.touch", + # Bulk conflict decisions are an administrator UI workflow and stay HTTP-only. + "conflicts.bulk_accept", # Admin-only lifecycle ops: loosening a lock and forcing an expiry # pass are operator actions, not agent ones. "memory.unlock", diff --git a/server/settings/catalog.py b/server/settings/catalog.py index 2ba5237d875..84f3e17dd7f 100644 --- a/server/settings/catalog.py +++ b/server/settings/catalog.py @@ -6479,6 +6479,8 @@ class TrackerSettings(BaseModel): "conflicts.propose_revision": 120, # Fans ALTER UPDATE across all peers. "conflicts.resolve": 500, + # Per-item current-revision and audit checks, bounded to 100 suggestions. + "conflicts.bulk_accept": 5000, "consolidations.list": 200, "context.fetch": 150, "context.offload": 300, diff --git a/tests/integration/test_conflict_resolver_ch.py b/tests/integration/test_conflict_resolver_ch.py index 5d81235b56d..a466cb4023a 100644 --- a/tests/integration/test_conflict_resolver_ch.py +++ b/tests/integration/test_conflict_resolver_ch.py @@ -207,11 +207,19 @@ async def _drop_vectors(ch: Any, org: str, namespace: str, key_prefix: str) -> N def _policy(monkeypatch: pytest.MonkeyPatch, name: str) -> None: from server.memory.app import conflicts + from server.memory.store import conflicts as conflicts_repo async def policy(org: str, namespace: str, ch: Any = None) -> str: return name + namespace_row = conflicts_repo.namespace_write_row + + async def write_row(org: str, namespace: str, *, ch: Any = None) -> dict[str, Any]: + row = await namespace_row(org, namespace, ch=ch) + return {**row, "default_conflict_policy": name} + monkeypatch.setattr(conflicts, "namespace_conflict_policy", policy) + monkeypatch.setattr(conflicts_repo, "namespace_write_row", write_row) async def _later() -> None: @@ -603,6 +611,102 @@ async def clear(**kw: Any) -> ConflictResult: await _place(ch, org, "s2", new, _vec((axis, 0.8), (axis + 1, 0.6)), owed=True) +async def test_bulk_accept_uses_current_resolver_audit_and_is_retry_safe(ch: Any) -> None: + import server.memory.store as memory_repo + from server.identity.domain.read_scope import WHOLE_NAMESPACE + from server.memory.api.models_conflicts import ( + ConflictsBulkAcceptInput, + ConflictsResolverAcceptItem, + ) + from server.memory.app import conflicts as conflict_app + from server.memory.app.conflicts_ops import handle_conflicts_bulk_accept + from server.observability import audit + + org = unique_org("resolver-bulk-accept") + await _pair(ch, org, "city_old", "city_new", 150, gap=False) + rows = await _rows(ch, org) + old, new = rows["city_old"], rows["city_new"] + old_row, new_row = await asyncio.gather( + memory_repo.get_by_id( + old["id"], org=org, namespace=NS, scope=WHOLE_NAMESPACE, fresh=True, strong=True + ), + memory_repo.get_by_id( + new["id"], org=org, namespace=NS, scope=WHOLE_NAMESPACE, fresh=True, strong=True + ), + ) + assert old_row is not None and new_row is not None + assert ( + await conflict_app.mark_peers_conflicted( + org=org, + namespace=NS, + new_memory_id=new["id"], + peer_ids=[old["id"]], + expected_sha256=str(new_row.content_sha256), + peer_sha256={old["id"]: str(old_row.content_sha256)}, + ) + == "conflict" + ) + suggestion_hash = await audit.emit( + "memory.conflict_resolver", + org=org, + namespace=NS, + actor="process:loom", + subject={ + "memory_id": new["id"], + "content_sha256": str(new_row.content_sha256), + "model": "scripted", + "prompt_version": PROMPT_VERSION, + "pairs": [ + { + "peer_id": old["id"], + "action": "flag", + "verdict": "update", + "confidence": 0.99, + "same_entity": True, + "same_attribute": True, + "memory_sha256": str(new_row.content_sha256), + "peer_sha256": str(old_row.content_sha256), + } + ], + }, + ) + request = ConflictsBulkAcceptInput( + org=org, + namespace=NS, + items=[ + ConflictsResolverAcceptItem( + memory_id=new["id"], + peer_id=old["id"], + memory_sha256=str(new_row.content_sha256), + peer_sha256=str(old_row.content_sha256), + suggestion_hash=suggestion_hash, + ) + ], + ) + + accepted = await handle_conflicts_bulk_accept(request) + retry = await handle_conflicts_bulk_accept(request) + after = await _rows(ch, org) + tombstone = await ch.query_all( + "SELECT status, tombstoned_at FROM loom.memory FINAL WHERE org = {org:String}" + " AND namespace = {ns:String} AND memory_id = {id:UUID}" + " SETTINGS select_sequential_consistency = 1", + params={"org": org, "ns": NS, "id": old["id"]}, + ) + + assert (accepted.resolved, accepted.stale, accepted.failed) == (1, 0, 0) + assert retry.results[0].status == "stale" + assert tombstone and tombstone[0]["status"] == "tombstoned" + assert tombstone[0]["tombstoned_at"] is not None + assert after["city_new"]["status"] == "active" + audit_rows = await ch.query_all( + "SELECT count() AS n FROM loom.audit_log WHERE org = {org:String} " + "AND namespace = {ns:String} AND event_type = 'memory.conflict_suggestion_accepted'", + params={"org": org, "ns": NS}, + ) + assert int(audit_rows[0]["n"]) == 1 + + async def test_a_row_the_provider_refuses_does_not_stop_another_orgs_update( ch, wired, monkeypatch ) -> None: diff --git a/tests/unit/test_badge_reads.py b/tests/unit/test_badge_reads.py index 709206a785a..2429aa56d97 100644 --- a/tests/unit/test_badge_reads.py +++ b/tests/unit/test_badge_reads.py @@ -20,12 +20,23 @@ class _FakeConflictsRepo: def __init__(self) -> None: self.counts = 0 + self.backlog_reads = 0 self.lists = 0 async def count_review(self, org: str, namespace: str, scope: Any = None) -> tuple[int, int]: self.counts += 1 return 4, 2 + async def count_conflict_backlog( + self, org: str, namespace: str, scope: Any = None + ) -> dict[str, dict[str, int]]: + self.backlog_reads += 1 + return { + "pending_judgement": {"plugin_captured": 1, "caller_written": 0, "unknown": 0}, + "resolver_judged": {"plugin_captured": 0, "caller_written": 1, "unknown": 0}, + "cosine_only": {"plugin_captured": 0, "caller_written": 0, "unknown": 1}, + } + async def list_conflicted(self, org: str, namespace: str, **_: Any) -> list[dict[str, Any]]: self.lists += 1 return [] @@ -49,6 +60,7 @@ async def test_count_only_answers_the_number_from_one_cached_count( fake = _FakeConflictsRepo() monkeypatch.setattr(conflicts_repo, "count_review", fake.count_review) + monkeypatch.setattr(conflicts_repo, "count_conflict_backlog", fake.count_conflict_backlog) monkeypatch.setattr(conflicts_repo, "list_conflicted", fake.list_conflicted) out1 = await conflicts_mod.handle_conflicts_list( @@ -58,8 +70,12 @@ async def test_count_only_answers_the_number_from_one_cached_count( ConflictsListInput(org="acme", namespace="team", count_only=True) ) assert (out1.total, out1.proposals) == (out2.total, out2.proposals) == (4, 2) + assert out1.backlog.pending_judgement.plugin_captured == 1 + assert out1.backlog.resolver_judged.caller_written == 1 + assert out1.backlog.cosine_only.unknown == 1 assert out1.rows == [] and out1.next_before_version is None assert fake.counts == 1, "one count per namespace per minute serves every badge tick" + assert fake.backlog_reads == 1 assert fake.lists == 0, "no row (and no value column) is read for a number" # another namespace is its own count; a decision drops the cached one @@ -83,12 +99,14 @@ async def test_a_fresh_count_skips_the_cache_and_refills_it( fake = _FakeConflictsRepo() monkeypatch.setattr(conflicts_repo, "count_review", fake.count_review) + monkeypatch.setattr(conflicts_repo, "count_conflict_backlog", fake.count_conflict_backlog) cached = ConflictsListInput(org="acme", namespace="team", count_only=True) fresh = ConflictsListInput(org="acme", namespace="team", count_only=True, fresh=True) await conflicts_mod.handle_conflicts_list(cached) # The review queue asks fresh: another replica's resolve may have made the cache stale. await conflicts_mod.handle_conflicts_list(fresh) assert fake.counts == 2 + assert fake.backlog_reads == 2 # The badge's next tick takes the count the fresh read stored. await conflicts_mod.handle_conflicts_list(cached) assert fake.counts == 2 @@ -116,6 +134,13 @@ async def count_review(org: str, namespace: str, scope: Any = None) -> tuple[int return 0, seen monkeypatch.setattr(conflicts_repo, "count_review", count_review) + + async def count_conflict_backlog( + org: str, namespace: str, scope: Any = None + ) -> dict[str, dict[str, int]]: + return {} + + monkeypatch.setattr(conflicts_repo, "count_conflict_backlog", count_conflict_backlog) badge = ConflictsListInput(org="acme", namespace="team", count_only=True) held = asyncio.create_task(conflicts_mod.handle_conflicts_list(badge)) await held_read.wait() @@ -151,6 +176,13 @@ async def count_review(org: str, namespace: str, scope: Any = None) -> tuple[int return 0, seen monkeypatch.setattr(conflicts_repo, "count_review", count_review) + + async def count_conflict_backlog( + org: str, namespace: str, scope: Any = None + ) -> dict[str, dict[str, int]]: + return {} + + monkeypatch.setattr(conflicts_repo, "count_conflict_backlog", count_conflict_backlog) badge = ConflictsListInput(org="acme", namespace="b", count_only=True) assert (await conflicts_mod.handle_conflicts_list(badge)).proposals == 1 pending = 0 # another replica rejects the proposal @@ -186,6 +218,11 @@ async def count_review(org: str, namespace: str, scope: Any = None) -> tuple[int return 0, 0 monkeypatch.setattr(conflicts_repo, "count_review", count_review) + + async def count_conflict_backlog(*_: Any, **__: Any) -> dict[str, dict[str, int]]: + return {} + + monkeypatch.setattr(conflicts_repo, "count_conflict_backlog", count_conflict_backlog) badge = ConflictsListInput(org="acme", namespace="team", count_only=True) # A replica that has yet to apply a decision must not serve the count the queue asks for. await conflicts_mod.handle_conflicts_list(badge.model_copy(update={"fresh": True})) @@ -203,6 +240,7 @@ async def test_the_listing_path_is_unchanged_without_count_only( fake = _FakeConflictsRepo() monkeypatch.setattr(conflicts_repo, "count_review", fake.count_review) + monkeypatch.setattr(conflicts_repo, "count_conflict_backlog", fake.count_conflict_backlog) monkeypatch.setattr(conflicts_repo, "list_conflicted", fake.list_conflicted) out = await conflicts_mod.handle_conflicts_list( ConflictsListInput(org="acme", namespace="team") @@ -223,6 +261,7 @@ async def test_a_proposal_decision_drops_the_namespaces_cached_counts( fake = _FakeConflictsRepo() monkeypatch.setattr(conflicts_repo, "count_review", fake.count_review) + monkeypatch.setattr(conflicts_repo, "count_conflict_backlog", fake.count_conflict_backlog) async def _decide(*_: Any, **__: Any) -> list[Any]: return [] diff --git a/tests/unit/test_captured_conflict_simulation.py b/tests/unit/test_captured_conflict_simulation.py new file mode 100644 index 00000000000..5b0234d0dd9 --- /dev/null +++ b/tests/unit/test_captured_conflict_simulation.py @@ -0,0 +1,20 @@ +from __future__ import annotations + +from scripts.ops.simulate_captured_conflicts import run + + +def test_seven_day_simulation_is_reproducible_and_checks_policy_invariants() -> None: + first = run(seed=2077, review_capacity_per_sitting=2000) + second = run(seed=2077, review_capacity_per_sitting=2000) + + assert first == second + assert first["days"] == 7 + assert all(first["checks"].values()) + defaults = first["default_policy"] + opted_in = first["opt_in_capture_policy"] + assert len(defaults) == len(opted_in) == 3 + for baseline, enabled in zip(defaults, opted_in, strict=True): + assert enabled["policy_automatically_settled"] > 0 + assert enabled["human_reviewable_pairs"] < baseline["human_reviewable_pairs"] + assert enabled["genuine_contradictions_settled"] == 0 + assert enabled["backlog_growth"] == 0 diff --git a/tests/unit/test_conflict_resolver.py b/tests/unit/test_conflict_resolver.py index ae01a4aef2e..e88cf1c97c3 100644 --- a/tests/unit/test_conflict_resolver.py +++ b/tests/unit/test_conflict_resolver.py @@ -1483,7 +1483,17 @@ def pass_env(monkeypatch: pytest.MonkeyPatch) -> NS: from server.memory.workers import conflict_resolver as worker from server.observability import budget - e = NS(owed=[], recheck=[], resolved=[], over=set(), raise_for={}, slow=0.0, stamped=[]) + e = NS( + owed=[], + recheck=[], + resolved=[], + over=set(), + raise_for={}, + slow=0.0, + stamped=[], + policy_rows={}, + captured_options=[], + ) e.left_owed = set() monkeypatch.setattr(worker, "_state", worker._State()) e.in_flight = e.most_in_flight = 0 @@ -1521,7 +1531,15 @@ async def over(org, namespace, **kw): e.cap_reads.append(kw) return (org, namespace) in e.over - async def resolve(q, *, policy, counts, shown=frozenset()): + async def resolve( + q, + *, + policy, + counts, + shown=frozenset(), + captured_policy="manual_review", + captured_confidence=0.98, + ): e.in_flight += 1 e.most_in_flight = max(e.most_in_flight, e.in_flight) await asyncio.sleep(e.slow) @@ -1529,6 +1547,7 @@ async def resolve(q, *, policy, counts, shown=frozenset()): if q["memory_key"] in e.raise_for: raise e.raise_for[q["memory_key"]] e.resolved.append((q["org"], q["namespace"], q["memory_key"], policy)) + e.captured_options.append((captured_policy, captured_confidence)) counts.judged += 1 return frozenset({"m2"}) if q["memory_key"] in e.left_owed else None @@ -1538,6 +1557,14 @@ async def stamp(q, **kw): async def policy(org, namespace, ch=None): return "newest_wins" + async def namespace_row(org, namespace, *, ch=None): + return { + "default_conflict_policy": "newest_wins", + "captured_conflict_policy": "manual_review", + "captured_conflict_confidence": 0.98, + **e.policy_rows.get((org, namespace), {}), + } + monkeypatch.setattr(queue, "owed_rows", owed) monkeypatch.setattr(queue, "unjudged_conflicted_rows", recheck) monkeypatch.setattr(queue, "queued_namespaces", namespaces) @@ -1546,11 +1573,26 @@ async def policy(org, namespace, ch=None): monkeypatch.setattr(budget, "namespace_over_cap", over) monkeypatch.setattr(resolver, "resolve_row", resolve) monkeypatch.setattr("server.memory.app.conflicts.namespace_conflict_policy", policy) + monkeypatch.setattr("server.memory.store.conflicts.namespace_write_row", namespace_row) monkeypatch.setattr("server.core.ch.get_client", lambda: object()) e.run = worker.run_pass return e +async def test_a_pass_reads_the_captured_conflict_policy_for_each_namespace( + pass_env: NS, +) -> None: + pass_env.owed = [_q(memory_key="captured")] + pass_env.policy_rows[("o", "ns")] = { + "captured_conflict_policy": "resolver_update", + "captured_conflict_confidence": 0.93, + } + + await pass_env.run() + + assert pass_env.captured_options == [("resolver_update", 0.93)] + + async def test_a_pass_handles_each_tenant_on_its_own_and_each_row_once(pass_env: NS) -> None: pass_env.owed = [ _q(org="o1", namespace="a", memory_key="k1"), @@ -1611,7 +1653,9 @@ async def test_an_answer_whose_action_failed_breaks_a_refusal_streak( monkeypatch.setattr(settings, "memory_conflict_resolver_concurrency", 1) - async def resolve(q: Any, *, policy: str, counts: Any, shown: Any = frozenset()) -> None: + async def resolve( + q: Any, *, policy: str, counts: Any, shown: Any = frozenset(), **_capture: Any + ) -> None: if q["memory_key"] == "answered": counts.judged += 1 raise resolver.JudgedThenFailed("RuntimeError: insert failed") @@ -1633,7 +1677,9 @@ async def test_another_namespaces_answer_breaks_no_refusal_streak( whose rows stay owed instead of being stamped.""" order = {k: asyncio.Event() for k in ("answered", "quiet")} - async def resolve(q: Any, *, policy: str, counts: Any, shown: Any = frozenset()) -> None: + async def resolve( + q: Any, *, policy: str, counts: Any, shown: Any = frozenset(), **_capture: Any + ) -> None: key = q["memory_key"] if key == "b-answered": counts.judged += 1 @@ -1829,7 +1875,7 @@ async def test_a_failure_that_escapes_a_row_ends_the_pass_with_no_row_running( running: set[str] = set() - async def resolve(q, *, policy, counts, shown=frozenset()): + async def resolve(q, *, policy, counts, shown=frozenset(), **_capture): running.add(q["memory_key"]) try: await asyncio.sleep(0 if q["memory_key"] == "k1" else 0.2) diff --git a/tests/unit/test_conflicts_bulk_accept.py b/tests/unit/test_conflicts_bulk_accept.py new file mode 100644 index 00000000000..7d8e5c4a650 --- /dev/null +++ b/tests/unit/test_conflicts_bulk_accept.py @@ -0,0 +1,230 @@ +"""Current resolver suggestions can be accepted in a bounded, partial batch.""" + +from __future__ import annotations + +from collections.abc import AsyncIterator +from contextlib import asynccontextmanager +from datetime import UTC, datetime +from types import SimpleNamespace + +import pytest +from pydantic import ValidationError + +from server.memory.api.models_conflicts import ( + ConflictsBulkAcceptInput, + ConflictsResolveOutput, +) + + +def _audit_record(memory_id: str, peer_id: str, sha_a: str, sha_b: str) -> dict[str, object]: + from server.observability.audit import audit_row + + subject = { + "memory_id": memory_id, + "content_sha256": sha_a, + "model": "fixed-test-judge", + "prompt_version": "v3", + "pairs": [ + { + "peer_id": peer_id, + "action": "flag", + "verdict": "update", + "confidence": 0.99, + "same_entity": True, + "same_attribute": True, + "memory_sha256": sha_a, + "peer_sha256": sha_b, + } + ], + } + return audit_row( + "memory.conflict_resolver", + "org", + "ns", + "process:loom", + subject, + ts=datetime(2026, 1, 1, tzinfo=UTC), + ) + + +def _item( + record: dict[str, object], memory_id: str, peer_id: str, sha_a: str, sha_b: str +) -> dict[str, str]: + return { + "memory_id": memory_id, + "peer_id": peer_id, + "memory_sha256": sha_a, + "peer_sha256": sha_b, + "suggestion_hash": str(record["row_hash"]), + } + + +def test_bulk_accept_input_is_bounded() -> None: + with pytest.raises(ValidationError): + ConflictsBulkAcceptInput( + org="o", + namespace="n", + items=[ + { + "memory_id": str(i), + "peer_id": "peer", + "memory_sha256": "a" * 64, + "peer_sha256": "b" * 64, + "suggestion_hash": "c" * 64, + } + for i in range(101) + ], + ) + + +def test_bulk_accept_is_admin_only_and_hidden_from_mcp() -> None: + from server.memory.api.ops_conflicts import conflicts_bulk_accept + from server.operations.base import Role + from server.operations.reach import mcp_reach + + assert conflicts_bulk_accept.required_role == Role.ADMIN + assert not mcp_reach("conflicts.bulk_accept") + + +@pytest.mark.asyncio +async def test_bulk_accept_resolves_current_item_and_returns_stale_for_changed_suggestion( + monkeypatch: pytest.MonkeyPatch, +) -> None: + import server.memory.store as memory_repo + from server.memory.api.models_conflicts import ConflictsResolveInput + from server.memory.app import conflict_resolver as resolver + from server.memory.app import conflicts_ops + from server.memory.store import conflicts as conflicts_repo + from server.memory.store import key_write_lock + from server.observability import audit + + sha_a, sha_b = "a" * 64, "b" * 64 + record = _audit_record("winner", "loser", sha_a, sha_b) + loser_record = _audit_record("other", "peer", "d" * 64, "e" * 64) + changed_record = _audit_record("changed-winner", "changed-loser", "d" * 64, "e" * 64) + records = { + ("winner", "loser"): record, + ("other", "peer"): loser_record, + ("changed-winner", "changed-loser"): changed_record, + } + monkeypatch.setattr( + conflicts_repo, + "latest_resolver_pair_audit", + lambda org, ns, mid, peer: _async_value(records.get((mid, peer))), + ) + rows = { + "winner": SimpleNamespace( + memory_id="winner", + namespace="ns", + agent="a", + user_id="u", + session_id="s", + memory_key="k1", + content_sha256=sha_a, + status="conflicted", + conflict_with=["loser"], + pinned=False, + sensitivity="", + tombstoned_at=None, + version=1, + valid_at=None, + ), + "loser": SimpleNamespace( + memory_id="loser", + namespace="ns", + agent="a", + user_id="u", + session_id="s", + memory_key="k2", + content_sha256=sha_b, + status="conflicted", + conflict_with=["winner"], + pinned=False, + sensitivity="", + tombstoned_at=None, + version=1, + valid_at=None, + ), + "changed-winner": SimpleNamespace( + memory_id="changed-winner", + namespace="ns", + agent="a", + user_id="u", + session_id="s", + memory_key="k3", + content_sha256="f" * 64, + status="conflicted", + conflict_with=["changed-loser"], + pinned=False, + sensitivity="", + tombstoned_at=None, + version=2, + valid_at=None, + ), + "changed-loser": SimpleNamespace( + memory_id="changed-loser", + namespace="ns", + agent="a", + user_id="u", + session_id="s", + memory_key="k4", + content_sha256="e" * 64, + status="conflicted", + conflict_with=["changed-winner"], + pinned=False, + sensitivity="", + tombstoned_at=None, + version=1, + valid_at=None, + ), + } + monkeypatch.setattr( + memory_repo, "get_by_id", lambda memory_id, **kwargs: _async_value(rows.get(memory_id)) + ) + + async def assertion_order(org: str, ns: str, pair_rows: list[object]): + return resolver.AssertionOrder({str(r.memory_id): (1, 1) for r in pair_rows}, []) + + monkeypatch.setattr(resolver, "_assertion_order", assertion_order) + monkeypatch.setattr(resolver, "_undone", lambda *args: False) + monkeypatch.setattr(resolver.queue, "under_erasure", lambda org: _async_value(False)) + + @asynccontextmanager + async def no_lease(*_key: str) -> AsyncIterator[None]: + yield + + monkeypatch.setattr(key_write_lock.key_write_locks, "hold", no_lease) + called: list[ConflictsResolveInput] = [] + + async def resolve(inp: ConflictsResolveInput) -> ConflictsResolveOutput: + called.append(inp) + return ConflictsResolveOutput( + resolved=True, decision="revise", affected_memory_ids=[inp.peer_id or ""] + ) + + monkeypatch.setattr(conflicts_ops, "handle_conflicts_resolve", resolve) + monkeypatch.setattr(audit, "emit", _audit_emit) + out = await conflicts_ops.handle_conflicts_bulk_accept( + ConflictsBulkAcceptInput( + org="org", + namespace="ns", + items=[ + _item(record, "winner", "loser", sha_a, sha_b), + _item(loser_record, "other", "peer", "d" * 64, "e" * 64), + _item(changed_record, "changed-winner", "changed-loser", "d" * 64, "e" * 64), + ], + ) + ) + + assert [r.status for r in out.results] == ["resolved", "stale", "stale"] + assert (out.requested, out.resolved, out.stale, out.failed) == (3, 1, 2, 0) + assert len(called) == 1 + assert called[0].decision == "revise" and called[0].peer_id == "loser" + + +async def _async_value(value): + return value + + +async def _audit_emit(*args, **kwargs): + return "hash" diff --git a/tests/unit/test_conflicts_repo.py b/tests/unit/test_conflicts_repo.py index f386a2ba8b0..eda045daae0 100644 --- a/tests/unit/test_conflicts_repo.py +++ b/tests/unit/test_conflicts_repo.py @@ -13,6 +13,8 @@ allowlist_insert, allowlist_list, allowlist_remove, + count_conflict_backlog, + latest_resolver_pair_audit, list_conflicted, lookup_keys_for_ids, lookup_target, @@ -21,6 +23,23 @@ ) +@pytest.mark.asyncio +async def test_latest_resolver_pair_audit_is_namespace_scoped_and_ordered() -> None: + ch = StubCH() + expected = {"row_hash": "h", "subject": "{}"} + ch.query_all_returns.append([expected]) + + row = await latest_resolver_pair_audit("o", "n", "new", "old", ch=ch) + + assert row == expected + sql, params = ch.query_all_calls[0] + assert "event_type = 'memory.conflict_resolver'" in sql + assert "ORDER BY ts DESC, row_hash DESC" in sql + assert "LIMIT 1" in sql + assert "arrayExists" in sql + assert params == {"org": "o", "ns": "n", "mid": "new", "peer": "old"} + + class StubCH: def __init__(self) -> None: self.query_one_calls: list[tuple[str, dict[str, Any]]] = [] @@ -45,6 +64,45 @@ async def insert(self, table, rows, settings=None): self.insert_calls.append((table, rows, settings or {})) +@pytest.mark.asyncio +async def test_conflict_backlog_counts_rows_by_mark_and_provenance() -> None: + ch = StubCH() + ch.query_all_returns.append( + [ + {"judgement": "pending_judgement", "provenance": "plugin_captured", "n": 2}, + {"judgement": "resolver_judged", "provenance": "caller_written", "n": 1}, + {"judgement": "cosine_only", "provenance": "unknown", "n": 3}, + ] + ) + + out = await count_conflict_backlog("o", "n", scope=WHOLE_NAMESPACE, ch=ch) + + assert out["pending_judgement"] == {"plugin_captured": 2, "caller_written": 0, "unknown": 0} + assert out["resolver_judged"] == {"plugin_captured": 0, "caller_written": 1, "unknown": 0} + assert out["cosine_only"] == {"plugin_captured": 0, "caller_written": 0, "unknown": 3} + sql, params = ch.query_all_calls[0] + assert "FROM loom.memory FINAL" in sql + assert "FROM loom.memory_embeddings FINAL" in sql + assert "GROUP BY judgement, provenance" in sql + assert "toUnixTimestamp(e.conflict_checked_at) = 2" in sql + assert "source_trace" not in sql + assert "m.source_class = 'asserted' AND startsWith(m.actor, 'human:')" in sql + assert params == {"org": "o", "ns": "n"} + + +@pytest.mark.asyncio +async def test_conflict_backlog_applies_narrow_read_scope() -> None: + from server.identity.domain.read_scope import ReadFilters + + ch = StubCH() + await count_conflict_backlog( + "o", "n", scope=ReadFilters(scope="own_session", user_id="u1", session_id="s1"), ch=ch + ) + sql, params = ch.query_all_calls[0] + assert "user_id = {scope_uid:String} AND session_id = {scope_sid:String}" in sql + assert params == {"org": "o", "ns": "n", "scope_uid": "u1", "scope_sid": "s1"} + + @pytest.mark.asyncio async def test_list_conflicted_filters_and_paginates() -> None: ch = StubCH() diff --git a/tests/unit/test_mentor.py b/tests/unit/test_mentor.py index addf80ab8ac..a32f6ef54ef 100644 --- a/tests/unit/test_mentor.py +++ b/tests/unit/test_mentor.py @@ -74,6 +74,7 @@ async def query_one(self, sql: str, params: dict[str, Any] | None = None): M_PREFIX = "AS top_prefix_sets" M_NSLEDGER = "AS conflict_ops" M_NSROWS = "AS coord_keys" +M_CONFLICT_BACKLOG = "GROUP BY judgement, provenance" M_DOCS = "FROM loom.documents" M_RECS = "FROM loom.memory_records" # The agent-scoped shape read: documents and checkpoints this agent wrote. @@ -113,6 +114,7 @@ def _store(usage: list[dict[str, Any]], sessions: int, **facts: Any) -> dict[str "live_rows": 100, "entity_rows": 0, "conflicted_rows": 0, + "conflict_backlog": [], "coord_keys": 0, "documents": 0, "records": 0, @@ -162,6 +164,7 @@ def _store(usage: list[dict[str, Any]], sessions: int, **facts: Any) -> dict[str M_NSROWS: [ {k: f[k] for k in ("live_rows", "entity_rows", "conflicted_rows", "coord_keys")} ], + M_CONFLICT_BACKLOG: f["conflict_backlog"], M_DOCS: [{"n": f["documents"]}], M_RECS: [{"n": f["records"]}], M_SHAPES: [ @@ -382,14 +385,13 @@ def test_every_other_rule_fires_on_its_fact_and_the_profile_keeps_eight( "checkpoints_as_memory", "documents_as_memories", "records_for_identities", - "conflicts_pending", "facts_graph_unused", "bisect_available", "runs_unused", "no_session_pack", } - # Nine rules fire (the blame calls are code.* calls, so the code index is not - # "unused"); the profile keeps the eight that matter most, warnings first. + # The namespace conflict count is observability, not agent guidance; the + # remaining rules fit in the profile limit. assert len(p.hints) == mentor_rules.PROFILE_MAX_HINTS assert codes <= expected assert {h.code for h in p.hints if h.severity == "warning"} == { @@ -1004,6 +1006,11 @@ def test_mentor_brief_returns_the_profile_planes_and_adoption( "records": 0, "entity_rows": 3, "conflicted_rows": 0, + "conflict_backlog": { + "pending_judgement": {"plugin_captured": 0, "caller_written": 1, "unknown": 2}, + "resolver_judged": {"plugin_captured": 0, "caller_written": 0, "unknown": 3}, + "cosine_only": {"plugin_captured": 0, "caller_written": 0, "unknown": 4}, + }, }, ) @@ -1041,6 +1048,9 @@ async def _p(*a: Any, **k: Any) -> Any: assert planes["claims"].calls == 12 and planes["code index"].available is True assert planes["documents"].available is False and planes["tracker"].available is None assert planes["erasure"].mentored is False and planes["code index"].mentored is True + assert out.conflict_backlog["pending_judgement"]["unknown"] == 2 + assert out.conflict_backlog["resolver_judged"]["unknown"] == 3 + assert out.conflict_backlog["cosine_only"]["unknown"] == 4 # A named agent is used as given; the writers list rode along (empty here). assert out.agent == "a" and out.agent_defaulted is False adoption = {a.code: (a.shown_sessions, a.followed_sessions) for a in out.adoption} @@ -2061,6 +2071,35 @@ def test_every_profile_ledger_read_leaves_the_inspectors_out() -> None: assert params["inspectors"] == ["loom-ui", "loom-assistant"] +def test_mentor_conflict_backlog_is_namespace_scoped_and_labels_rows() -> None: + from server.insights.store.mentor import ProfileReads + + ch = _CH( + { + M_CONFLICT_BACKLOG: [ + {"judgement": "pending_judgement", "provenance": "unknown", "n": 5}, + {"judgement": "resolver_judged", "provenance": "caller_written", "n": 2}, + ] + } + ) + reads = ProfileReads( + "org-x", + "ns-y", + "agent", + 3600, + ops={"sets": m.SETS, "gets": m.GETS, "searches": m.SEARCHES, "packs": m.PACKS}, + limits={"ttl": 60, "large": 1, "huge": 2, "advisory": 3, "clip": 4, "episodic_chars": 5}, + ch=ch, + ) + out = asyncio.run(reads.conflict_backlog()) + assert out["pending_judgement"]["unknown"] == 5 + assert out["resolver_judged"]["caller_written"] == 2 + sql, params = ch.sqls[0], ch.params[0] + assert "FROM loom.memory FINAL" in sql and "FROM loom.memory_embeddings FINAL" in sql + assert "status = 'conflicted'" in sql and "GROUP BY judgement, provenance" in sql + assert params == {"org": "org-x", "ns": "ns-y"} + + def test_a_profile_whose_repository_fact_failed_is_remembered_briefly( monkeypatch: pytest.MonkeyPatch, ) -> None: diff --git a/tests/unit/test_provenance.py b/tests/unit/test_provenance.py index 0831abacc21..0f2d9da1c6a 100644 --- a/tests/unit/test_provenance.py +++ b/tests/unit/test_provenance.py @@ -22,6 +22,123 @@ def test_writer_actor_kind_comes_from_the_token() -> None: assert writer_actor(fallback="process:consolidation") == "process:consolidation" +def test_capture_origin_is_signed_and_first_write_ignores_body_value() -> None: + from datetime import UTC, datetime + + from server.auth.jwt import TokenError, mint_token, verify_token + from server.memory.store.rows import build_first_version_row + + token = mint_token( + "sa:claude", "o", ["n"], ["writer"], capture_origin="claude-code", secret="s3" * 16 + ) + auth = verify_token(token, secret="s3" * 16) + assert auth.capture_origin == "claude-code" + with pytest.raises(TokenError): + mint_token("sa:claude", "o", ["n"], ["writer"], capture_origin="fake", secret="s3" * 16) + + set_current_auth(auth) + at = datetime(2026, 1, 1, tzinfo=UTC) + row = build_first_version_row( + { + "org": "o", + "namespace": "n", + "agent": "agent", + "user_id": "-", + "session_id": "-", + "memory_key": "fact", + "memory_type": "semantic", + "value": "{}", + "version": 1, + "content_sha256": "a" * 64, + "actor": "process:claude", + "source_class": "observed", + "capture_origin": "codex", + }, + now=at, + ) + assert row["capture_origin"] == "claude-code" + set_current_auth(None) + + +def test_memory_version_builder_carries_capture_origin() -> None: + from datetime import datetime + + from server.memory.store.rows import MemoryRow, build_memory_version_row + + row = MemoryRow( + memory_id="id", + org="o", + namespace="n", + agent="agent", + user_id="-", + session_id="-", + memory_key="fact", + memory_type="semantic", + value="value", + confidence=1.0, + version=1, + pinned=False, + created_at=datetime(2026, 1, 1), + expires_at=None, + capture_origin="codex", + ) + assert build_memory_version_row(row, version=2)["capture_origin"] == "codex" + + +@pytest.mark.parametrize( + ("winner_origin", "retired_origin", "winner_user", "threshold", "expected"), + [ + ("claude-code", "codex", "u1", 0.70, True), + ("", "codex", "u1", 0.70, False), + ("claude-code", "", "u1", 0.70, False), + ("claude-code", "codex", "u1", 0.90, False), + ("claude-code", "codex", "u2", 0.70, False), + ], +) +def test_captured_settlement_requires_owner_policy_trusted_same_subject_update( + winner_origin: str, + retired_origin: str, + winner_user: str, + threshold: float, + expected: bool, +) -> None: + from server.memory.domain.conflict_resolution import captured_update_eligible + + assert ( + captured_update_eligible( + policy="resolver_update", + verdict="update", + confidence=0.80, + threshold=threshold, + same_entity=True, + same_attribute=True, + winner_origin=winner_origin, + retired_origin=retired_origin, + winner_agent="agent", + retired_agent="agent", + winner_user_id=winner_user, + retired_user_id="u1", + cross_session=False, + ) + is expected + ) + assert not captured_update_eligible( + policy="resolver_update", + verdict="contradiction", + confidence=0.99, + threshold=0.50, + same_entity=True, + same_attribute=True, + winner_origin="claude-code", + retired_origin="codex", + winner_agent="agent", + retired_agent="agent", + winner_user_id="u1", + retired_user_id="u1", + cross_session=False, + ) + + def test_trace_conventions_imply_a_class() -> None: assert prov.class_from_trace("pipeline:set_from_messages|prompt=x") == "extracted" assert prov.class_from_trace("conversation:abc") == "extracted" diff --git a/tests/unit/test_read_scope_admission.py b/tests/unit/test_read_scope_admission.py index a479b59a946..b3bfe3b0066 100644 --- a/tests/unit/test_read_scope_admission.py +++ b/tests/unit/test_read_scope_admission.py @@ -572,9 +572,14 @@ async def count_review(org: str, namespace: str, *, scope: ReadFilters) -> tuple seen.append(scope) return (7, 2) if scope is WHOLE_NAMESPACE else (1, 0) - repo = SimpleNamespace(count_review=count_review) - assert await conflicts_ops._review_counts_cached(repo, "o", "n", WHOLE_NAMESPACE) == (7, 2) - assert await conflicts_ops._review_counts_cached(repo, "o", "n", U1) == (1, 0) + async def count_conflict_backlog( + org: str, namespace: str, *, scope: ReadFilters + ) -> dict[str, dict[str, int]]: + return {} + + repo = SimpleNamespace(count_review=count_review, count_conflict_backlog=count_conflict_backlog) + assert await conflicts_ops._review_counts_cached(repo, "o", "n", WHOLE_NAMESPACE) == (7, 2, {}) + assert await conflicts_ops._review_counts_cached(repo, "o", "n", U1) == (1, 0, {}) assert seen == [WHOLE_NAMESPACE, U1] conflicts_ops.reset_conflicts_count_cache() diff --git a/tests/unit/test_schema_baseline.py b/tests/unit/test_schema_baseline.py index 3219996603f..97f4b6438fb 100644 --- a/tests/unit/test_schema_baseline.py +++ b/tests/unit/test_schema_baseline.py @@ -174,6 +174,7 @@ def test_the_journal_files() -> None: "117_code_term_df_unchanged_refresh.sql", "118_store_names_reserved.sql", "119_workspace_crawl.sql", + "120_captured_conflict_provenance.sql", ] From e979a0287116cf8f591cd37ef4413fe369231f9e Mon Sep 17 00:00:00 2001 From: Project Manager Date: Sat, 5 Dec 2026 14:35:50 +0545 Subject: [PATCH 02/11] Guard captured conflict acceptance against stale peers The resolver audit determines the winner direction, and a bulk acceptance must not retire a peer whose content changed after review. Preserve the signed capture origin through full-row reads and unrelated namespace saves so later conflict review remains accurate. Signed-off-by: Project Manager --- frontend/src/api/admin.cost.test.ts | 23 ++- frontend/src/api/admin.ts | 2 - frontend/src/views/admin/ReviewQueue.test.tsx | 147 +++++++++++++++- frontend/src/views/admin/ReviewQueue.tsx | 26 ++- .../123_captured_conflict_provenance.sql | 7 +- server/auth/jwt.py | 3 + server/identity/app/namespace.py | 25 +-- server/memory/app/bulk_rows.py | 12 +- server/memory/app/conflicts_ops.py | 54 +++++- server/memory/app/observe.py | 3 +- server/memory/app/provenance.py | 8 + server/memory/app/update.py | 9 + server/memory/app/write.py | 13 +- server/memory/store/conflicts.py | 8 + server/memory/store/lifecycle.py | 13 +- server/memory/store/rows.py | 18 +- server/memory/store/sql.py | 2 +- .../integration/test_conflict_resolver_ch.py | 161 +++++++++++++++++- ...est_materialized_view_replace_atomic_ch.py | 53 ++++++ tests/unit/test_conflicts_bulk_accept.py | 11 +- tests/unit/test_conflicts_list.py | 41 +++++ tests/unit/test_conflicts_repo.py | 6 +- tests/unit/test_delegation.py | 7 + tests/unit/test_device_login.py | 14 ++ .../unit/test_namespace_register_preserve.py | 32 ++++ tests/unit/test_provenance.py | 55 ++++++ 26 files changed, 699 insertions(+), 54 deletions(-) create mode 100644 tests/integration/test_materialized_view_replace_atomic_ch.py create mode 100644 tests/unit/test_conflicts_list.py diff --git a/frontend/src/api/admin.cost.test.ts b/frontend/src/api/admin.cost.test.ts index adc98d73739..175fdfcc686 100644 --- a/frontend/src/api/admin.cost.test.ts +++ b/frontend/src/api/admin.cost.test.ts @@ -3,7 +3,7 @@ import { afterEach, beforeEach, describe, expect, it, vi } from "vitest"; // The cost clients' "last N days" is N UTC dates, today included. const post = vi.hoisted(() => vi.fn(async () => ({ rows: [] }))); vi.mock("../api", async (importOriginal) => ({ ...(await importOriginal()), post })); -import { getAgentSpend, listCostRollup } from "./admin"; +import { getAgentSpend, listCostRollup, reregisterNamespace } from "./admin"; const id = { org: "acme", namespace: "team" }; @@ -25,3 +25,24 @@ describe("cost windows", () => { expect(post).toHaveBeenCalledWith("/v1/cost.agent_summary", week, undefined); }); }); + +it("does not resend stale captured-conflict settings on an unrelated save", async () => { + const ns = { + namespace: "team", + owner_email: "owner@example.com", + description: "old", + tags: [], + active: true, + consolidation_enabled: false, + conflict_threshold: null, + captured_conflict_policy: "resolver_update" as const, + captured_conflict_confidence: 0.99, + created_at: "", + updated_at: "", + }; + await reregisterNamespace(id, ns, { description: "new" }); + const body = post.mock.calls.at(-1)?.[1] as Record; + expect(body.description).toBe("new"); + expect(body).not.toHaveProperty("captured_conflict_policy"); + expect(body).not.toHaveProperty("captured_conflict_confidence"); +}); diff --git a/frontend/src/api/admin.ts b/frontend/src/api/admin.ts index cb593990b5c..2f621dcbd1f 100644 --- a/frontend/src/api/admin.ts +++ b/frontend/src/api/admin.ts @@ -383,8 +383,6 @@ export async function reregisterNamespace( daily_cost_cap_usd: ns.daily_cost_cap_usd ?? 0.0, consolidation_enabled: ns.consolidation_enabled, conflict_threshold: ns.conflict_threshold, - captured_conflict_policy: ns.captured_conflict_policy, - captured_conflict_confidence: ns.captured_conflict_confidence, requires_approval: ns.requires_approval ?? false, capture_generation_io: ns.capture_generation_io, ...patch, diff --git a/frontend/src/views/admin/ReviewQueue.test.tsx b/frontend/src/views/admin/ReviewQueue.test.tsx index 51c122d586b..80740d026a2 100644 --- a/frontend/src/views/admin/ReviewQueue.test.tsx +++ b/frontend/src/views/admin/ReviewQueue.test.tsx @@ -59,7 +59,8 @@ vi.mock("../../api/conflicts", () => ({ vi.mock("../../api/definitions", () => ({ listDefinitions: vi.fn(async () => ({ count: 0, ceiling: 500, definitions: [] })), })); -vi.mock("../../components/ConfirmDialog", () => ({ confirmAction: async () => true })); +const confirmAction = vi.hoisted(() => vi.fn(async () => true)); +vi.mock("../../components/ConfirmDialog", () => ({ confirmAction })); const toast = vi.hoisted(() => vi.fn()); vi.mock("../../components/Toast", async (importOriginal) => ({ ...(await importOriginal()), @@ -197,6 +198,8 @@ describe("ReviewQueue", () => { vi.mocked(listAuditLog).mockReset(); vi.mocked(listAuditLog).mockResolvedValue({ rows: [] }); vi.mocked(acceptResolverSuggestions).mockReset(); + confirmAction.mockReset(); + confirmAction.mockResolvedValue(true); vi.mocked(listAllowlist).mockReset(); vi.mocked(listLearnings).mockReset(); vi.mocked(listProposals).mockReset(); @@ -346,6 +349,131 @@ describe("ReviewQueue", () => { ]); expect(await screen.findByText(/stale/)).toBeInTheDocument(); }, 20000); + + it("does not send a confirmed bulk action after the namespace visit changes", async () => { + const hashA = "a".repeat(64); + const hashB = "b".repeat(64); + vi.mocked(listConflicts).mockImplementation(async (id) => ({ + rows: [ + { ...conflict(`${id.namespace}/a`), memory_id: "a", conflict_with: ["b"], content_sha256: hashA }, + { ...conflict(`${id.namespace}/b`), memory_id: "b", conflict_with: ["a"], content_sha256: hashB }, + ], + next_before_version: null, + })); + vi.mocked(listAuditLog).mockResolvedValue({ + rows: [ + { + ts: "2026-09-20T00:00:00Z", + event_type: "memory.conflict_resolver", + actor: "process:loom", + request_id: "", + row_hash: "c".repeat(64), + subject: JSON.stringify({ + memory_id: "a", + content_sha256: hashA, + pairs: [ + { + peer_id: "b", + peer_sha256: hashB, + memory_sha256: hashA, + action: "flag", + verdict: "update", + confidence: 0.99, + same_entity: true, + same_attribute: true, + }, + ], + }), + }, + ], + }); + let finishConfirm: (yes: boolean) => void = () => {}; + confirmAction.mockImplementationOnce(() => new Promise((resolve) => (finishConfirm = resolve))); + seed("ns-a", "admin"); + const user = userEvent.setup(); + render(); + await screen.findByText("Resolver update suggestions", {}, WAIT); + await user.click(screen.getByRole("button", { name: "Select all eligible" })); + await user.click(screen.getByRole("button", { name: "Accept selected" })); + await waitFor(() => expect(confirmAction).toHaveBeenCalled(), WAIT); + + seed("ns-b", "admin"); + await waitFor( + () => expect(listConflicts).toHaveBeenCalledWith({ org: ORG, namespace: "ns-b" }, expect.anything()), + WAIT, + ); + await act(async () => finishConfirm(true)); + expect(acceptResolverSuggestions).not.toHaveBeenCalled(); + }); + + it("drops a bulk result that lands after switching namespaces", async () => { + const hashA = "a".repeat(64); + const hashB = "b".repeat(64); + vi.mocked(listConflicts).mockImplementation(async (id) => ({ + rows: [ + { ...conflict(`${id.namespace}/a`), memory_id: "a", conflict_with: ["b"], content_sha256: hashA }, + { ...conflict(`${id.namespace}/b`), memory_id: "b", conflict_with: ["a"], content_sha256: hashB }, + ], + next_before_version: null, + })); + vi.mocked(listAuditLog).mockResolvedValue({ + rows: [ + { + ts: "2026-09-20T00:00:00Z", + event_type: "memory.conflict_resolver", + actor: "process:loom", + request_id: "", + row_hash: "c".repeat(64), + subject: JSON.stringify({ + memory_id: "a", + content_sha256: hashA, + pairs: [ + { + peer_id: "b", + peer_sha256: hashB, + memory_sha256: hashA, + action: "flag", + verdict: "update", + confidence: 0.99, + same_entity: true, + same_attribute: true, + }, + ], + }), + }, + ], + }); + let finishRequest: (result: ResolverAcceptResult) => void = () => {}; + vi.mocked(acceptResolverSuggestions).mockImplementationOnce( + () => new Promise((resolve) => (finishRequest = resolve)), + ); + seed("ns-a", "admin"); + const user = userEvent.setup(); + render(); + await screen.findByText("Resolver update suggestions", {}, WAIT); + await user.click(screen.getByRole("button", { name: "Select all eligible" })); + await user.click(screen.getByRole("button", { name: "Accept selected" })); + await waitFor(() => expect(acceptResolverSuggestions).toHaveBeenCalledWith( + { org: ORG, namespace: "ns-a" }, + expect.any(Array), + ), WAIT); + + seed("ns-b", "admin"); + await waitFor( + () => expect(listConflicts).toHaveBeenCalledWith({ org: ORG, namespace: "ns-b" }, expect.anything()), + WAIT, + ); + await act(async () => + finishRequest({ + requested: 1, + resolved: 1, + stale: 0, + failed: 0, + results: [{ memory_id: "a", peer_id: "b", status: "resolved" }], + }), + ); + expect(screen.queryByText("a: resolved")).toBeNull(); + }); afterEach(() => { cleanup(); useStore.setState({ whoami: null, myNamespaces: null }); @@ -2285,15 +2413,26 @@ describe("ReviewQueue", () => { expect(screen.getByLabelText("Loading conflicts")).toBeInTheDocument(); }); - it("deciding the only conflict, with none past it, says 'No conflicts' without reading again", async () => { - vi.mocked(countReview).mockResolvedValue({ total: 1 }); + it("refreshes the backlog to explicit zero after deciding the only conflict", async () => { + vi.mocked(countReview) + .mockResolvedValueOnce({ total: 1 }) + .mockResolvedValue({ + total: 0, + backlog: { + pending_judgement: { plugin_captured: 0, caller_written: 0, unknown: 0 }, + resolver_judged: { plugin_captured: 0, caller_written: 0, unknown: 0 }, + cosine_only: { plugin_captured: 0, caller_written: 0, unknown: 0 }, + }, + }); vi.mocked(listConflicts).mockResolvedValue({ rows: [conflict("k/one")], next_before_version: null }); seed("ns-a", "admin"); render(); await screen.findByText("value of k/one", {}, WAIT); await userEvent.click(screen.getByRole("button", { name: /Keep A/ })); expect(await screen.findByText("No conflicts", {}, WAIT)).toBeInTheDocument(); - expect(listConflicts).toHaveBeenCalledTimes(1); + expect(await screen.findByText("Conflict backlog · conflicted rows", {}, WAIT)).toBeInTheDocument(); + await waitFor(() => expect(listConflicts).toHaveBeenCalledTimes(2), WAIT); + expect(screen.getByText(/0 captured/)).toBeInTheDocument(); }); it("holds the queue's picks and the reason while a decision is out", async () => { diff --git a/frontend/src/views/admin/ReviewQueue.tsx b/frontend/src/views/admin/ReviewQueue.tsx index 50bb40729f6..92b915ad22b 100644 --- a/frontend/src/views/admin/ReviewQueue.tsx +++ b/frontend/src/views/admin/ReviewQueue.tsx @@ -369,6 +369,11 @@ export function ReviewQueue() { // ─── Conflicts panel ─────────────────────────────────────────────────── const CONFLICT_PAGE = 50; +const EMPTY_CONFLICT_BACKLOG: ConflictBacklog = { + pending_judgement: { plugin_captured: 0, caller_written: 0, unknown: 0 }, + resolver_judged: { plugin_captured: 0, caller_written: 0, unknown: 0 }, + cosine_only: { plugin_captured: 0, caller_written: 0, unknown: 0 }, +}; function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void }) { const identity = useIdentity(); @@ -569,7 +574,7 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void if (rows.length === 0) { return ( <> - + {bulkOutcome} void const acceptSelected = async () => { if (resolveReason || busy) return; + const myVisit = visit.current; + const myQueue = queueKey; + const myOrg = identity.org; + const myNamespace = identity.namespace; const items = selectableSuggestions.filter((s) => bulkSelected.has(s.key)); if (!items.length) return; const yes = await confirmAction({ @@ -655,13 +664,14 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void "Each suggestion is rechecked against the latest resolver audit and both current memory revisions. Changed or protected conflicts will be left for review.", confirmLabel: "Accept suggestions", }); - if (!yes) return; + if (!yes || visit.current !== myVisit || queueNow.current !== myQueue) return; setBusy(true); try { const result = await acceptResolverSuggestions( - { org: identity.org, namespace: identity.namespace }, + { org: myOrg, namespace: myNamespace }, items.map(({ key: _key, target: _target, peer: _peer, confidence: _confidence, ...item }) => item), ); + if (visit.current !== myVisit || queueNow.current !== myQueue) return; setBulkResults(result.results); setBulkSelected(new Set()); toast( @@ -670,9 +680,10 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void ); if (result.resolved) setReload((n) => n + 1); } catch (e) { + if (visit.current !== myVisit || queueNow.current !== myQueue) return; toastError("Couldn't accept resolver suggestions", e); } finally { - setBusy(false); + if (visit.current === myVisit && queueNow.current === myQueue) setBusy(false); } }; @@ -699,7 +710,11 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void if (visit.current === myVisit) setReload((n) => n + 1); return; } - setBacklog(null); // refreshed with the next count after this decision + const sameVisit = visit.current === myVisit && queueNow.current === myQueue; + if (sameVisit) { + setBacklog(null); + setReload((n) => n + 1); // refresh the queue and its row-based backlog summary + } toast("Resolved", "ok"); // The decided row and the peers the resolve wrote (affected_memory_ids: tombstoned or // made active) leave every list, on any visit; ids are org-wide, so no other queue @@ -719,7 +734,6 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void // after it does not move the open conflict. const left = shown.length - dropped; setIndex((i) => Math.max(Math.min(i - before(i), left - 1), 0)); - const sameVisit = visit.current === myVisit; if (typeof res.total === "number" && queueNow.current === myQueue) { // The resolve's own count, made after its writes, for the namespace on screen. const total = res.total; diff --git a/schemas/migrations/123_captured_conflict_provenance.sql b/schemas/migrations/123_captured_conflict_provenance.sql index 4aa6b9a67ee..73f77bc73a0 100644 --- a/schemas/migrations/123_captured_conflict_provenance.sql +++ b/schemas/migrations/123_captured_conflict_provenance.sql @@ -8,10 +8,9 @@ ALTER TABLE loom.namespaces ALTER TABLE loom.namespaces ADD COLUMN IF NOT EXISTS captured_conflict_confidence Float32 DEFAULT 0.98; --- Recreate the append-only history mirror so new memory versions preserve provenance. -DROP VIEW IF EXISTS loom.memory_versions_mv; -CREATE MATERIALIZED VIEW loom.memory_versions_mv TO loom.memory_versions -AS SELECT +-- Modify the insert trigger in place while adding provenance to its query. +ALTER TABLE loom.memory_versions_mv MODIFY QUERY +SELECT org, namespace, agent, user_id, session_id, memory_key, memory_type, value, value_json, confidence, source_trace, version, tombstoned_at, created_at, expires_at, pinned, run_id, entities, memory_id, redacted_at, redaction_reason, diff --git a/server/auth/jwt.py b/server/auth/jwt.py index 6de175d905c..03fdab8f2ea 100644 --- a/server/auth/jwt.py +++ b/server/auth/jwt.py @@ -351,6 +351,8 @@ def mint_token( if is_reserved_subject(subject): # Only an end-user issuer's tokens carry these. raise ValueError(f"{RESERVED_SUBJECT}: {subject!r}") + if capture_origin and not is_service_account: + raise TokenError("capture_origin is only valid on an approved service-account credential") now = int(time.time()) if issued_at is None else issued_at payload: dict[str, Any] = { "sub": subject, @@ -568,6 +570,7 @@ def _end_user_key(token: str) -> tuple[str, EndUserIssuer, Any] | None: "creator", "saves_to", "parents", + "capture_origin", ) diff --git a/server/identity/app/namespace.py b/server/identity/app/namespace.py index ed38aaa8802..c69141baa7e 100644 --- a/server/identity/app/namespace.py +++ b/server/identity/app/namespace.py @@ -242,17 +242,11 @@ def registry_row( "default_conflict_policy": _set_or_stored( input.default_conflict_policy, existing, "default_conflict_policy", "auto_reinforce" ), - "captured_conflict_policy": _set_or_stored( - input.captured_conflict_policy, - existing, - "captured_conflict_policy", - "manual_review", + "captured_conflict_policy": _form_value_or_stored( + input, existing, "captured_conflict_policy", "manual_review" ), - "captured_conflict_confidence": _set_or_stored( - input.captured_conflict_confidence, - existing, - "captured_conflict_confidence", - 0.98, + "captured_conflict_confidence": _form_value_or_stored( + input, existing, "captured_conflict_confidence", 0.98 ), "auto_promote_gate": str((existing or {}).get("auto_promote_gate") or "k_supporters"), "evidence_threshold": int((existing or {}).get("evidence_threshold") or 5), @@ -295,6 +289,17 @@ def _sent_or_stored( return (existing or {}).get(field) +def _form_value_or_stored( + input: NamespaceRegisterInput, existing: dict[str, Any] | None, field: str, fresh: Any +) -> Any: + """An omitted settings field keeps the row read under account_change; an explicit + field value is the administrator's edit. Fresh rows use the field's default.""" + if field in input.model_fields_set: + return getattr(input, field) + stored = (existing or {}).get(field) + return fresh if stored is None else stored + + def _serialize_proposal_policy(policy: Any) -> str: from server.memory.domain.proposal_policy import serialize_policy diff --git a/server/memory/app/bulk_rows.py b/server/memory/app/bulk_rows.py index f53128b95ac..62af21f64a1 100644 --- a/server/memory/app/bulk_rows.py +++ b/server/memory/app/bulk_rows.py @@ -30,7 +30,7 @@ from server.memory.app.projections import ( resolved_entity_list, ) -from server.memory.app.provenance import writer_actor +from server.memory.app.provenance import capture_origin, revision_capture_origin, writer_actor from server.memory.app.sensitivity_level import decoded_text, resolve_level from server.memory.app.set_commit import count_attribute_tags, set_next from server.memory.domain import lock as _lock @@ -296,8 +296,14 @@ def _full_version_row( live = state.existing_rows.get(str(memory_row["memory_key"])) if live is not None: - return memory_repo.build_revision_row(live, memory_row) - return memory_repo.build_first_version_row(memory_row, now=now) + return memory_repo.build_revision_row( + live, + memory_row, + capture_origin=revision_capture_origin( + str(live.content_sha256 or ""), str(memory_row.get("content_sha256") or "") + ), + ) + return memory_repo.build_first_version_row(memory_row, now=now, capture_origin=capture_origin()) def _bulk_locked(state: _BulkWriteState, memory_key: str, action: _lock.LockAction) -> bool: diff --git a/server/memory/app/conflicts_ops.py b/server/memory/app/conflicts_ops.py index df7ec6a6e50..49f1ec737e3 100644 --- a/server/memory/app/conflicts_ops.py +++ b/server/memory/app/conflicts_ops.py @@ -141,6 +141,7 @@ async def handle_conflicts_list( conflict_with=[str(p) for p in r["conflict_with"]], content_sha256=_sha256(r["value"]) if r["value"] else "", sensitivity=r["sensitivity"], + capture_origin=str(r.get("capture_origin") or ""), ) for r in rows ] @@ -304,6 +305,8 @@ async def live(memory_id: str) -> bool: async def handle_conflicts_resolve( input: ConflictsResolveInput, + *, + expected_sha256: dict[str, str] | None = None, ) -> ConflictsResolveOutput: """Three decision paths: @@ -334,6 +337,8 @@ async def handle_conflicts_resolve( peers = await _live_peers(input, [input.peer_id] if input.peer_id else all_peers) if peers is None: return unresolved + if expected_sha256 is not None and not set(expected_sha256).issubset(peers): + return unresolved affected: list[str] = [] # The tombstones are announced as soon as they are in, before the kept side's status @@ -342,8 +347,15 @@ async def handle_conflicts_resolve( ns = input.namespace if input.decision == "revise": tombstoned = await conflicts_repo.tombstone_ids( - input.org, peers, audit_note, now, namespace=ns + input.org, + peers, + audit_note, + now, + namespace=ns, + expected_sha256=expected_sha256, ) + if expected_sha256 is not None and len(tombstoned) != len(expected_sha256): + return unresolved await webhooks.announce([("memory.tombstoned", row) for row in tombstoned]) affected.extend(peers) await conflicts_repo.mark_active_by_ids(input.org, [input.memory_id], namespace=ns) @@ -397,16 +409,51 @@ async def handle_conflicts_bulk_accept( records before delegating the actual state change to the existing resolve handler. """ results: list[_ConflictBulkResult] = [] + grouped: dict[tuple[str, str], list[Any]] = {} + for item in input.items: + pair = ( + (item.memory_id, item.peer_id) + if item.memory_id < item.peer_id + else (item.peer_id, item.memory_id) + ) + grouped.setdefault(pair, []).append(item) + selected: dict[tuple[str, str], Any] = {} + from server.memory.store import conflicts as conflicts_repo + + for pair, items in grouped.items(): + event = await conflicts_repo.latest_resolver_pair_audit( + input.org, input.namespace, pair[0], pair[1] + ) + direction = "" + if event is not None: + import json + + direction = str(json.loads(str(event.get("subject") or "{}")).get("memory_id") or "") + selected[pair] = next((item for item in items if item.memory_id == direction), items[0]) seen: set[tuple[str, str]] = set() for item in input.items: - pair = (item.memory_id, item.peer_id) + pair = ( + (item.memory_id, item.peer_id) + if item.memory_id < item.peer_id + else (item.peer_id, item.memory_id) + ) if pair in seen: results.append(_bulk_accept_result(item, "failed", "Duplicate item")) continue seen.add(pair) + if selected[pair] is not item: + results.append(_bulk_accept_result(item, "failed", "Duplicate item")) + continue try: results.append(await _accept_bulk_item(input, item)) except Exception as e: # noqa: BLE001 — one item failure must not stop independent selections + from server.memory.store.pg_memory import AdmissionContendedError + + if isinstance(e, AdmissionContendedError): + results.append( + _bulk_accept_result(item, "stale", "A memory changed during acceptance") + ) + continue log.warning("conflicts.bulk_accept: item failed for %s: %s", item.memory_id, e) results.append(_bulk_accept_result(item, "failed", "Item could not be resolved")) return ConflictsBulkAcceptOutput( @@ -534,7 +581,8 @@ async def _resolve_current_bulk_pair( decision="revise", reason="resolver suggestion accepted", resolved_by=writer_actor(), - ) + ), + expected_sha256={item.peer_id: item.peer_sha256}, ) diff --git a/server/memory/app/observe.py b/server/memory/app/observe.py index dc7d76da2e9..3b605142c61 100644 --- a/server/memory/app/observe.py +++ b/server/memory/app/observe.py @@ -34,7 +34,7 @@ ObserveRecordInput, ObserveRecordOutput, ) -from server.memory.app.provenance import writer_actor +from server.memory.app.provenance import capture_origin, writer_actor from server.memory.domain.observation_tags import ( BLACKLISTED_REASON, BLACKLISTED_TAG, @@ -358,6 +358,7 @@ async def handle_observe_record(input: ObserveRecordInput) -> ObserveRecordOutpu "content_sha256": content_sha, }, now=now_naive, + capture_origin=capture_origin(), ) await insert_memory_versions([row], ch=ch) diff --git a/server/memory/app/provenance.py b/server/memory/app/provenance.py index 6a426a73713..3935f6fbadb 100644 --- a/server/memory/app/provenance.py +++ b/server/memory/app/provenance.py @@ -32,6 +32,14 @@ def capture_origin() -> str: auth = current_auth() origin = str(getattr(auth, "capture_origin", "") or "") if auth is not None else "" return origin if origin in {"claude-code", "codex"} else "" + + +def revision_capture_origin(existing_sha256: str, new_sha256: str) -> str | None: + """Use the verified writer origin for changed content; maintenance-only copies keep + the row's stored origin through the version builder.""" + return capture_origin() if existing_sha256 != new_sha256 else None + + def label_actor() -> str: """The principal an agent's usage label (`used`, `evidence`, `harm`) is stamped with: the token's actor, '-' with no auth. Never '', which marks the server's own diff --git a/server/memory/app/update.py b/server/memory/app/update.py index 53d285052ee..a905d34c416 100644 --- a/server/memory/app/update.py +++ b/server/memory/app/update.py @@ -1072,6 +1072,15 @@ async def _write_revision( tombstoned_at=None, char_limit=input.char_limit, content_sha256=new_sha, + **( + { + "capture_origin": app_provenance.revision_capture_origin( + str(existing.content_sha256 or ""), new_sha + ) + } + if existing.content_sha256 != new_sha + else {} + ), tags=new_tags, concepts=new_concepts, sensitivity=sensitivity, diff --git a/server/memory/app/write.py b/server/memory/app/write.py index c196414e7bd..c4fc7525deb 100644 --- a/server/memory/app/write.py +++ b/server/memory/app/write.py @@ -618,11 +618,20 @@ def _set_build_memory_row(w: _SetWrite) -> None: # from the live row; the builder resets the ones about the old value. import server.memory.store as memory_repo - memory_row = memory_repo.build_revision_row(existing, memory_row) + memory_row = memory_repo.build_revision_row( + existing, + memory_row, + capture_origin=app_provenance.revision_capture_origin( + str(existing.content_sha256 or ""), + str(memory_row.get("content_sha256") or ""), + ), + ) else: import server.memory.store as memory_repo - memory_row = memory_repo.build_first_version_row(memory_row, now=now_naive) + memory_row = memory_repo.build_first_version_row( + memory_row, now=now_naive, capture_origin=app_provenance.capture_origin() + ) w.memory_id = memory_id w.had_existing_row = had_existing_row w.writer_actor = writer_actor diff --git a/server/memory/store/conflicts.py b/server/memory/store/conflicts.py index 6e4473770c0..2e14d727abc 100644 --- a/server/memory/store/conflicts.py +++ b/server/memory/store/conflicts.py @@ -333,6 +333,7 @@ async def tombstone_ids( when: datetime, *, namespace: str, + expected_sha256: dict[str, str] | None = None, ch: _CHClient | None = None, ) -> list[dict[str, Any]]: """Tombstone N rows of `namespace` by memory_id. `audit_note` is appended to @@ -349,6 +350,10 @@ def _note(row: memory_repo.MemoryRow) -> dict[str, Any]: trace = carried_trace(row.source_trace) # the delete_version marker is not carried return {"source_trace": f"{trace} | {audit_note}" if trace else audit_note} + def _unchanged(row: memory_repo.MemoryRow) -> bool: + expected = (expected_sha256 or {}).get(str(row.memory_id)) + return expected is not None and str(row.content_sha256 or "") != expected + # The tombstone must reach memory_embeddings too, or the losing side of a # conflict keeps surfacing in search. return await memory_repo.tombstone_cascade_by_ids( @@ -356,6 +361,9 @@ def _note(row: memory_repo.MemoryRow) -> dict[str, Any]: memory_ids, when=when, update=_note, + skip=_unchanged if expected_sha256 is not None else None, + strong=expected_sha256 is not None, + exact=expected_sha256 is not None, ch=ch, namespace=namespace, ) diff --git a/server/memory/store/lifecycle.py b/server/memory/store/lifecycle.py index 0ec2355b051..aeabf3b632f 100644 --- a/server/memory/store/lifecycle.py +++ b/server/memory/store/lifecycle.py @@ -76,6 +76,7 @@ async def write_versions_by_ids( on_unconfirmed: Callable[[list[dict[str, Any]]], Awaitable[None]] | None = None, judged: bool = False, strict: bool = False, + exact: bool = False, ) -> int: """Write a new version of each live row in `memory_ids`: `update(existing)`'s overrides on every persisted column carried forward, a fresh `version` unless it @@ -108,7 +109,7 @@ async def write_versions_by_ids( if not rows: return 0 - await insert_versions_over_heads(rows, sources, ch=ch) + await insert_versions_over_heads(rows, sources, ch=ch, exact=exact) confirmed = rows if on_written is not None: # Under Postgres the commit is over each head read (`heads_unchanged(exact=True)`) @@ -1245,6 +1246,7 @@ async def tombstone_cascade_by_ids( namespace: str, skip: Callable[[MemoryRow], bool] | None = None, strong: bool = False, + exact: bool = False, ) -> list[dict[str, Any]]: """Tombstone rows by memory_id AND mirror the tombstone onto every tier search reads (`strong`: the rows read current, for a `skip` that must see a write @@ -1298,7 +1300,14 @@ def _tombstone(existing: MemoryRow) -> dict[str, Any]: # `write_versions_by_ids` mirrors the tombstone onto memory_embeddings at its version. await write_versions_by_ids( - org, memory_ids, _tombstone, ch=ch, namespace=namespace, skip=skip, strong=strong + org, + memory_ids, + _tombstone, + ch=ch, + namespace=namespace, + skip=skip, + strong=strong, + exact=exact, ) # A decision's record goes with its writer's row, as on memory.delete; under Postgres # the tombstone's publication retires it (`pg_publish.retire_decision_records`). diff --git a/server/memory/store/rows.py b/server/memory/store/rows.py index 3d3c45ec150..e08389686c1 100644 --- a/server/memory/store/rows.py +++ b/server/memory/store/rows.py @@ -484,7 +484,9 @@ def build_memory_version_row( } -def build_revision_row(existing: MemoryRow, new: Mapping[str, Any]) -> dict[str, Any]: +def build_revision_row( + existing: MemoryRow, new: Mapping[str, Any], *, capture_origin: str | None = None +) -> dict[str, Any]: """The version row of a revision: `new` (the columns the write sets) over the live row `existing`, through `build_memory_version_row`, with REVISION_RESETS applied to every column `new` does not set. The @@ -497,6 +499,8 @@ def build_revision_row(existing: MemoryRow, new: Mapping[str, Any]) -> dict[str, if c not in new } overrides.update(new) + if capture_origin is not None: + overrides["capture_origin"] = capture_origin return build_memory_version_row(existing, **overrides) @@ -541,7 +545,9 @@ def build_revision_row(existing: MemoryRow, new: Mapping[str, Any]) -> dict[str, } -def build_first_version_row(new: Mapping[str, Any], *, now: datetime) -> dict[str, Any]: +def build_first_version_row( + new: Mapping[str, Any], *, now: datetime, capture_origin: str = "" +) -> dict[str, Any]: """`new` completed to every persisted column with the DDL defaults of the ones it does not set (FIRST_VERSION_DEFAULTS; `updated_at` and `last_reinforced_at` = `now`).""" @@ -554,11 +560,9 @@ def build_first_version_row(new: Mapping[str, Any], *, now: datetime) -> dict[st row.setdefault("last_reinforced_at", now) row.setdefault("created_at", now) row.update(new) - # A write's capture origin comes only from the verified token claim, never - # from memory.set input. Existing row updates use build_memory_version_row. - from server.memory.app.provenance import capture_origin - - row["capture_origin"] = capture_origin() + # The application layer passes this only from the verified token claim. Existing row + # updates use build_memory_version_row, which carries the stored value. + row["capture_origin"] = capture_origin row["requires_review"] = int( bool(row.get("requires_review")) or row.get("status") in {"proposed"} ) diff --git a/server/memory/store/sql.py b/server/memory/store/sql.py index 0f2e8aab0eb..912a14b1427 100644 --- a/server/memory/store/sql.py +++ b/server/memory/store/sql.py @@ -49,7 +49,7 @@ sensitivity, actor, source_class, grounding, evidence, lock_mode, lock_reason, lock_until, locked_by, locked_at, - on_expire, expire_reason + on_expire, expire_reason, capture_origin FROM loom.memory FINAL""" diff --git a/tests/integration/test_conflict_resolver_ch.py b/tests/integration/test_conflict_resolver_ch.py index a466cb4023a..98390875ff9 100644 --- a/tests/integration/test_conflict_resolver_ch.py +++ b/tests/integration/test_conflict_resolver_ch.py @@ -680,7 +680,14 @@ async def test_bulk_accept_uses_current_resolver_audit_and_is_retry_safe(ch: Any memory_sha256=str(new_row.content_sha256), peer_sha256=str(old_row.content_sha256), suggestion_hash=suggestion_hash, - ) + ), + ConflictsResolverAcceptItem( + memory_id=old["id"], + peer_id=new["id"], + memory_sha256=str(old_row.content_sha256), + peer_sha256=str(new_row.content_sha256), + suggestion_hash=suggestion_hash, + ), ], ) @@ -694,7 +701,8 @@ async def test_bulk_accept_uses_current_resolver_audit_and_is_retry_safe(ch: Any params={"org": org, "ns": NS, "id": old["id"]}, ) - assert (accepted.resolved, accepted.stale, accepted.failed) == (1, 0, 0) + assert (accepted.resolved, accepted.stale, accepted.failed) == (1, 0, 1) + assert accepted.results[1].reason == "Duplicate item" assert retry.results[0].status == "stale" assert tombstone and tombstone[0]["status"] == "tombstoned" assert tombstone[0]["tombstoned_at"] is not None @@ -707,6 +715,155 @@ async def test_bulk_accept_uses_current_resolver_audit_and_is_retry_safe(ch: Any assert int(audit_rows[0]["n"]) == 1 +async def test_signed_capture_origin_reaches_conflicts_list_and_backlog(ch: Any) -> None: + import server.memory.store as memory_repo + from server.auth import revocation + from server.auth.context import set_current_auth + from server.auth.jwt import mint_token, verify_token + from server.identity.domain.read_scope import WHOLE_NAMESPACE + from server.memory.api.models_conflicts import ConflictsListInput + from server.memory.app.conflicts import mark_peers_conflicted + from server.memory.app.conflicts_ops import handle_conflicts_list + from server.memory.store.conflicts import count_conflict_backlog + from server.settings import settings + + org = unique_org("resolver-capture-origin") + token = mint_token( + "sa:capture-test", + org, + [NS], + ["writer"], + capture_origin="claude-code", + secret=settings.jwt_secret, + ) + await revocation.refresh() + set_current_auth(verify_token(token, secret=settings.jwt_secret)) + try: + await _pair(ch, org, "captured_old", "captured_new", 152, gap=False) + rows = await _rows(ch, org) + old, new = rows["captured_old"], rows["captured_new"] + old_row, new_row = await asyncio.gather( + memory_repo.get_by_id( + old["id"], org=org, namespace=NS, scope=WHOLE_NAMESPACE, fresh=True, strong=True + ), + memory_repo.get_by_id( + new["id"], org=org, namespace=NS, scope=WHOLE_NAMESPACE, fresh=True, strong=True + ), + ) + assert old_row is not None and new_row is not None + await mark_peers_conflicted( + org=org, + namespace=NS, + new_memory_id=new["id"], + peer_ids=[old["id"]], + expected_sha256=str(new_row.content_sha256), + peer_sha256={old["id"]: str(old_row.content_sha256)}, + ) + listed = await handle_conflicts_list(ConflictsListInput(org=org, namespace=NS)) + assert listed.rows and all(row.capture_origin == "claude-code" for row in listed.rows) + backlog = await count_conflict_backlog(org, NS, scope=WHOLE_NAMESPACE, ch=ch) + assert sum(group["plugin_captured"] for group in backlog.values()) == 2 + finally: + set_current_auth(None) + + +async def test_bulk_accept_does_not_retire_a_peer_replaced_after_validation( + ch: Any, monkeypatch: pytest.MonkeyPatch +) -> None: + import server.memory.store as memory_repo + from server.identity.domain.read_scope import WHOLE_NAMESPACE + from server.memory.api.models_conflicts import ( + ConflictsBulkAcceptInput, + ConflictsResolverAcceptItem, + ) + from server.memory.app import conflicts, conflicts_ops + from server.observability import audit + + org = unique_org("resolver-bulk-cas") + await _pair(ch, org, "city_old", "city_new", 151, gap=False) + rows = await _rows(ch, org) + old, new = rows["city_old"], rows["city_new"] + old_row, new_row = await asyncio.gather( + memory_repo.get_by_id( + old["id"], org=org, namespace=NS, scope=WHOLE_NAMESPACE, fresh=True, strong=True + ), + memory_repo.get_by_id( + new["id"], org=org, namespace=NS, scope=WHOLE_NAMESPACE, fresh=True, strong=True + ), + ) + assert old_row is not None and new_row is not None + await conflicts.mark_peers_conflicted( + org=org, + namespace=NS, + new_memory_id=new["id"], + peer_ids=[old["id"]], + expected_sha256=str(new_row.content_sha256), + peer_sha256={old["id"]: str(old_row.content_sha256)}, + ) + suggestion_hash = await audit.emit( + "memory.conflict_resolver", + org=org, + namespace=NS, + actor="process:loom", + subject={ + "memory_id": new["id"], + "content_sha256": str(new_row.content_sha256), + "model": "scripted", + "prompt_version": PROMPT_VERSION, + "pairs": [ + { + "peer_id": old["id"], + "action": "flag", + "verdict": "update", + "confidence": 0.99, + "same_entity": True, + "same_attribute": True, + "memory_sha256": str(new_row.content_sha256), + "peer_sha256": str(old_row.content_sha256), + } + ], + }, + ) + request = ConflictsBulkAcceptInput( + org=org, + namespace=NS, + items=[ + ConflictsResolverAcceptItem( + memory_id=new["id"], + peer_id=old["id"], + memory_sha256=str(new_row.content_sha256), + peer_sha256=str(old_row.content_sha256), + suggestion_hash=suggestion_hash, + ) + ], + ) + original_resolve = conflicts_ops.handle_conflicts_resolve + + async def replace_then_resolve(resolve_input: Any, **kwargs: Any) -> Any: + replacement_id = await _set(org, "s1", "city_old", "The office is in London") + assert replacement_id == old["id"] + return await original_resolve(resolve_input, **kwargs) + + monkeypatch.setattr(conflicts_ops, "handle_conflicts_resolve", replace_then_resolve) + accepted = await conflicts_ops.handle_conflicts_bulk_accept(request) + current = await ch.query_all( + "SELECT content_sha256, status, tombstoned_at FROM loom.memory FINAL " + "WHERE org = {org:String} AND namespace = {ns:String} AND memory_id = {id:UUID} " + "SETTINGS select_sequential_consistency = 1", + params={"org": org, "ns": NS, "id": old["id"]}, + ) + + assert accepted.results[0].status == "stale" + assert current and current[0]["content_sha256"] != str(old_row.content_sha256) + assert current[0]["tombstoned_at"] is None + accepted_events = await ch.query_all( + "SELECT count() AS n FROM loom.audit_log WHERE org = {org:String} " + "AND namespace = {ns:String} AND event_type = 'memory.conflict_suggestion_accepted'", + params={"org": org, "ns": NS}, + ) + assert int(accepted_events[0]["n"]) == 0 + + async def test_a_row_the_provider_refuses_does_not_stop_another_orgs_update( ch, wired, monkeypatch ) -> None: diff --git a/tests/integration/test_materialized_view_replace_atomic_ch.py b/tests/integration/test_materialized_view_replace_atomic_ch.py new file mode 100644 index 00000000000..1a382ac5f04 --- /dev/null +++ b/tests/integration/test_materialized_view_replace_atomic_ch.py @@ -0,0 +1,53 @@ +"""Modifying an explicit-TO materialized view must not leave an insert gap.""" + +from __future__ import annotations + +import asyncio +import uuid + +import pytest + + +@pytest.mark.asyncio +async def test_modify_materialized_view_query_is_safe_with_concurrent_inserts() -> None: + from server.core.ch import get_client, set_query_tag + + ch = get_client() + await ch.connect() + suffix = uuid.uuid4().hex + source = f"test_mv_replace_source_{suffix}" + target = f"test_mv_replace_target_{suffix}" + view = f"test_mv_replace_view_{suffix}" + set_query_tag("test.materialized_view.replace_atomic") + try: + await ch.execute(f"CREATE TABLE loom.{source} (x UInt64) ENGINE = MergeTree ORDER BY x") + await ch.execute( + f"CREATE TABLE loom.{target} (value UInt64) ENGINE = MergeTree ORDER BY value" + ) + await ch.execute( + f"CREATE MATERIALIZED VIEW loom.{view} TO loom.{target} AS " + f"SELECT x AS value FROM loom.{source}" + ) + await ch.execute(f"INSERT INTO loom.{source} VALUES (0)") + + async def insert_rows() -> None: + for i in range(1, 101): + await ch.execute(f"INSERT INTO loom.{source} VALUES ({i})") + + async def alter_view() -> None: + for _ in range(20): + await ch.execute( + f"ALTER TABLE loom.{view} MODIFY QUERY SELECT x AS value FROM loom.{source}" + ) + + await asyncio.gather(insert_rows(), alter_view()) + rows = await ch.query_all( + f"SELECT count() AS total, uniqExact(value) AS distinct_values FROM loom.{target}" + ) + assert int(rows[0]["total"]) == 101 + assert int(rows[0]["distinct_values"]) == 101 + finally: + await ch.execute(f"DROP VIEW IF EXISTS loom.{view}") + await ch.execute(f"DROP TABLE IF EXISTS loom.{target}") + await ch.execute(f"DROP TABLE IF EXISTS loom.{source}") + await ch.disconnect() diff --git a/tests/unit/test_conflicts_bulk_accept.py b/tests/unit/test_conflicts_bulk_accept.py index 7d8e5c4a650..48d5b8e3fe6 100644 --- a/tests/unit/test_conflicts_bulk_accept.py +++ b/tests/unit/test_conflicts_bulk_accept.py @@ -194,10 +194,12 @@ async def no_lease(*_key: str) -> AsyncIterator[None]: yield monkeypatch.setattr(key_write_lock.key_write_locks, "hold", no_lease) - called: list[ConflictsResolveInput] = [] + called: list[tuple[ConflictsResolveInput, dict[str, str] | None]] = [] - async def resolve(inp: ConflictsResolveInput) -> ConflictsResolveOutput: - called.append(inp) + async def resolve( + inp: ConflictsResolveInput, *, expected_sha256: dict[str, str] | None = None + ) -> ConflictsResolveOutput: + called.append((inp, expected_sha256)) return ConflictsResolveOutput( resolved=True, decision="revise", affected_memory_ids=[inp.peer_id or ""] ) @@ -219,7 +221,8 @@ async def resolve(inp: ConflictsResolveInput) -> ConflictsResolveOutput: assert [r.status for r in out.results] == ["resolved", "stale", "stale"] assert (out.requested, out.resolved, out.stale, out.failed) == (3, 1, 2, 0) assert len(called) == 1 - assert called[0].decision == "revise" and called[0].peer_id == "loser" + assert called[0][0].decision == "revise" and called[0][0].peer_id == "loser" + assert called[0][1] == {"loser": sha_b} async def _async_value(value): diff --git a/tests/unit/test_conflicts_list.py b/tests/unit/test_conflicts_list.py new file mode 100644 index 00000000000..41768ff8a34 --- /dev/null +++ b/tests/unit/test_conflicts_list.py @@ -0,0 +1,41 @@ +"""The conflicts API returns stored, signed capture provenance to reviewers.""" + +from __future__ import annotations + +from datetime import datetime +from typing import Any + +import pytest + + +@pytest.mark.asyncio +async def test_conflicts_list_projects_persisted_capture_origin( + monkeypatch: pytest.MonkeyPatch, +) -> None: + from server.identity.domain.read_scope import WHOLE_NAMESPACE + from server.memory.api.models_conflicts import ConflictsListInput + from server.memory.app import conflicts_ops + from server.memory.store import conflicts as conflicts_repo + + monkeypatch.setattr(conflicts_ops, "request_scope", lambda: WHOLE_NAMESPACE) + + async def list_conflicted(*_args: Any, **_kwargs: Any) -> list[dict[str, Any]]: + return [ + { + "memory_id": "m1", + "memory_key": "decision", + "memory_type": "fact", + "value": '"the build is green"', + "version": 7, + "pinned": False, + "created_at": datetime(2026, 1, 1), + "conflict_with": ["m2"], + "sensitivity": "", + "capture_origin": "claude-code", + } + ] + + monkeypatch.setattr(conflicts_repo, "list_conflicted", list_conflicted) + output = await conflicts_ops.handle_conflicts_list(ConflictsListInput(org="o", namespace="n")) + + assert output.rows[0].capture_origin == "claude-code" diff --git a/tests/unit/test_conflicts_repo.py b/tests/unit/test_conflicts_repo.py index 91ebac5d7d3..f53b7893a6c 100644 --- a/tests/unit/test_conflicts_repo.py +++ b/tests/unit/test_conflicts_repo.py @@ -16,8 +16,8 @@ allowlist_list, allowlist_remove, count_conflict_backlog, - latest_resolver_pair_audit, ids_in_scope, + latest_resolver_pair_audit, list_conflicted, lookup_keys_for_ids, lookup_target, @@ -89,6 +89,8 @@ async def test_conflict_backlog_counts_rows_by_mark_and_provenance() -> None: assert "GROUP BY judgement, provenance" in sql assert "toUnixTimestamp(e.conflict_checked_at) = 2" in sql assert "source_trace" not in sql + assert "m.capture_origin IN ('claude-code', 'codex')" in sql + assert "AS provenance" in sql assert "m.source_class = 'asserted' AND startsWith(m.actor, 'human:')" in sql assert params == {"org": "o", "ns": "n"} @@ -218,7 +220,7 @@ async def fake_get_by_id(mid, *, org=None, namespace=None, ch=None, scope=None): monkeypatch.setattr(lifecycle, "get_by_id", fake_get_by_id) async def fake_write_versions_by_ids( - org, memory_ids, update, *, ch=None, namespace=None, skip=None, strong=False + org, memory_ids, update, *, ch=None, namespace=None, skip=None, strong=False, exact=False ): row = memory_repo.MemoryRow( memory_id="11111111-2222-3333-4444-555555555555", diff --git a/tests/unit/test_delegation.py b/tests/unit/test_delegation.py index df923b0d84b..4ac4dea322e 100644 --- a/tests/unit/test_delegation.py +++ b/tests/unit/test_delegation.py @@ -138,6 +138,13 @@ async def _child(parent: AuthInfo, requested: dict[str, str | None], **kw: Any) return verify_token(d.mint(kw.pop("subject", "sa:bot"))) +@pytest.mark.asyncio +async def test_a_child_token_does_not_inherit_capture_origin(world) -> None: + parent = _login(capture_origin="claude-code") + child = await _child(parent, {"a": "writer"}) + assert child.capture_origin == "" + + async def _reaches(token: AuthInfo, ns: str, role: Role = Role.VIEWER, org: str = ORG) -> bool: try: await authz.check_authorized(token, role, org, ns) diff --git a/tests/unit/test_device_login.py b/tests/unit/test_device_login.py index f5134883813..f888b6b1654 100644 --- a/tests/unit/test_device_login.py +++ b/tests/unit/test_device_login.py @@ -511,6 +511,20 @@ def test_an_end_user_token_revokes_nothing_here(_world, monkeypatch) -> None: assert r.status_code == 200 and _world["revoked"] == [] +def test_an_end_user_issuer_cannot_claim_a_captured_plugin_origin(monkeypatch) -> None: + from server.auth.jwt import TokenError, verify_token + from server.settings import settings + from tests import end_user_issuer + + private, public = end_user_issuer.new_key() + monkeypatch.setattr( + settings, "jwt_end_user_issuers_json", end_user_issuer.issuers_setting(public) + ) + token = end_user_issuer.mint("acme", "u-1", private_pem=private, capture_origin="claude-code") + with pytest.raises(TokenError, match="capture_origin"): + verify_token(token) + + def test_revoking_garbage_is_a_quiet_200(_world) -> None: r = _client().post("/oauth/revoke", data={"token": "nonsense", "client_id": "loom-cli"}) assert r.status_code == 200 and _world["revoked"] == [] diff --git a/tests/unit/test_namespace_register_preserve.py b/tests/unit/test_namespace_register_preserve.py index 1494c4a14c5..b911d9f9b1e 100644 --- a/tests/unit/test_namespace_register_preserve.py +++ b/tests/unit/test_namespace_register_preserve.py @@ -32,6 +32,8 @@ "classify_endpoint": "https://classify.example/v1", "classify_prompt_template": "classify {text}", "default_conflict_policy": "manual_review", + "captured_conflict_policy": "resolver_update", + "captured_conflict_confidence": 0.99, } FRESH: dict[str, Any] = { "description": "", @@ -50,6 +52,8 @@ "classify_endpoint": "", "classify_prompt_template": "", "default_conflict_policy": "auto_reinforce", + "captured_conflict_policy": "manual_review", + "captured_conflict_confidence": 0.98, } NOW = datetime(2026, 9, 28, 12, 0, 0) @@ -93,6 +97,34 @@ def test_tags_are_replaced_whole() -> None: assert _row(_existing(), tags=["x"])["tags"] == ["x"] +def test_description_save_keeps_a_policy_changed_by_another_admin() -> None: + original = _existing( + captured_conflict_policy="resolver_update", captured_conflict_confidence=0.99 + ) + changed_by_admin_b = h.registry_row( + NamespaceRegisterInput( + org="o", + namespace="n", + owner_email="o@x", + captured_conflict_policy="manual_review", + captured_conflict_confidence=0.82, + ), + original, + NOW, + ) + saved_by_admin_a = h.registry_row( + NamespaceRegisterInput( + org="o", namespace="n", owner_email="o@x", description="updated description" + ), + changed_by_admin_b, + NOW, + ) + + assert saved_by_admin_a["description"] == "updated description" + assert saved_by_admin_a["captured_conflict_policy"] == "manual_review" + assert saved_by_admin_a["captured_conflict_confidence"] == 0.82 + + def test_a_restricted_row_stays_private() -> None: row = _row(_existing(classification="restricted"), visibility="public") assert row["visibility"] == "private" diff --git a/tests/unit/test_provenance.py b/tests/unit/test_provenance.py index 0f2d9da1c6a..f114fa626e1 100644 --- a/tests/unit/test_provenance.py +++ b/tests/unit/test_provenance.py @@ -35,6 +35,16 @@ def test_capture_origin_is_signed_and_first_write_ignores_body_value() -> None: assert auth.capture_origin == "claude-code" with pytest.raises(TokenError): mint_token("sa:claude", "o", ["n"], ["writer"], capture_origin="fake", secret="s3" * 16) + with pytest.raises(TokenError, match="service-account"): + mint_token( + "alice", + "o", + ["n"], + ["writer"], + is_service_account=False, + capture_origin="claude-code", + secret="s3" * 16, + ) set_current_auth(auth) at = datetime(2026, 1, 1, tzinfo=UTC) @@ -55,6 +65,7 @@ def test_capture_origin_is_signed_and_first_write_ignores_body_value() -> None: "capture_origin": "codex", }, now=at, + capture_origin="claude-code", ) assert row["capture_origin"] == "claude-code" set_current_auth(None) @@ -85,6 +96,50 @@ def test_memory_version_builder_carries_capture_origin() -> None: assert build_memory_version_row(row, version=2)["capture_origin"] == "codex" +def test_content_changes_take_the_verified_writer_origin_and_copies_keep_the_old_one() -> None: + from datetime import datetime + + from server.auth.jwt import mint_token, verify_token + from server.memory.app.provenance import revision_capture_origin + from server.memory.store.rows import MemoryRow, build_revision_row + + token = mint_token( + "sa:claude", "o", ["n"], ["writer"], capture_origin="claude-code", secret="s3" * 16 + ) + set_current_auth(verify_token(token, secret="s3" * 16)) + try: + row = MemoryRow( + memory_id="m1", + org="o", + namespace="n", + agent="agent", + user_id="-", + session_id="-", + memory_key="fact", + memory_type="semantic", + value="old", + confidence=1.0, + version=1, + pinned=False, + created_at=datetime(2026, 1, 1), + expires_at=None, + content_sha256="a" * 64, + capture_origin="codex", + ) + assert revision_capture_origin("a" * 64, "a" * 64) is None + origin = revision_capture_origin("a" * 64, "b" * 64) + assert origin == "claude-code" + assert build_revision_row(row, {"value": "copy"})["capture_origin"] == "codex" + assert ( + build_revision_row(row, {"value": "replacement"}, capture_origin=origin)[ + "capture_origin" + ] + == "claude-code" + ) + finally: + set_current_auth(None) + + @pytest.mark.parametrize( ("winner_origin", "retired_origin", "winner_user", "threshold", "expected"), [ From 2c5dc83819c0eab9549e964a6591e6218c6194bc Mon Sep 17 00:00:00 2001 From: PRAZPC Date: Sat, 5 Dec 2026 16:11:23 +0545 Subject: [PATCH 03/11] Classify captured rows in mentor conflict backlog Signed-off-by: PRAZPC --- server/insights/store/mentor.py | 10 +++++++--- tests/integration/test_conflict_resolver_ch.py | 18 ++++++++++++++++++ tests/unit/test_mentor.py | 4 ++++ 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/server/insights/store/mentor.py b/server/insights/store/mentor.py index b3b06c27574..e84eb903857 100644 --- a/server/insights/store/mentor.py +++ b/server/insights/store/mentor.py @@ -347,11 +347,15 @@ async def conflict_backlog(self) -> dict[str, dict[str, int]]: toUnixTimestamp(e.conflict_checked_at) = 2, 'resolver_judged', 'cosine_only' ) AS judgement, - if(m.source_class = 'asserted' AND startsWith(m.actor, 'human:'), - 'caller_written', 'unknown') AS provenance + multiIf( + m.capture_origin IN ('claude-code', 'codex'), 'plugin_captured', + m.source_class = 'asserted' AND startsWith(m.actor, 'human:'), + 'caller_written', + 'unknown' + ) AS provenance FROM ( SELECT org, namespace, agent, user_id, session_id, memory_key, version, - created_at, source_class, actor + created_at, source_class, actor, capture_origin FROM loom.memory FINAL WHERE org = {org:String} AND namespace = {ns:String} AND status = 'conflicted' AND tombstoned_at IS NULL diff --git a/tests/integration/test_conflict_resolver_ch.py b/tests/integration/test_conflict_resolver_ch.py index 98390875ff9..a4066c02cd7 100644 --- a/tests/integration/test_conflict_resolver_ch.py +++ b/tests/integration/test_conflict_resolver_ch.py @@ -721,6 +721,7 @@ async def test_signed_capture_origin_reaches_conflicts_list_and_backlog(ch: Any) from server.auth.context import set_current_auth from server.auth.jwt import mint_token, verify_token from server.identity.domain.read_scope import WHOLE_NAMESPACE + from server.insights.store.mentor import ProfileReads from server.memory.api.models_conflicts import ConflictsListInput from server.memory.app.conflicts import mark_peers_conflicted from server.memory.app.conflicts_ops import handle_conflicts_list @@ -763,6 +764,23 @@ async def test_signed_capture_origin_reaches_conflicts_list_and_backlog(ch: Any) assert listed.rows and all(row.capture_origin == "claude-code" for row in listed.rows) backlog = await count_conflict_backlog(org, NS, scope=WHOLE_NAMESPACE, ch=ch) assert sum(group["plugin_captured"] for group in backlog.values()) == 2 + mentor_backlog = await ProfileReads( + org, + NS, + "capture-test", + 3600, + ops={"sets": (), "gets": (), "searches": (), "packs": ()}, + limits={ + "ttl": 60, + "large": 1, + "huge": 2, + "advisory": 3, + "clip": 4, + "episodic_chars": 5, + }, + ch=ch, + ).conflict_backlog() + assert sum(group["plugin_captured"] for group in mentor_backlog.values()) == 2 finally: set_current_auth(None) diff --git a/tests/unit/test_mentor.py b/tests/unit/test_mentor.py index c480fbb9d1e..38da4a3732c 100644 --- a/tests/unit/test_mentor.py +++ b/tests/unit/test_mentor.py @@ -2225,6 +2225,7 @@ def test_mentor_conflict_backlog_is_namespace_scoped_and_labels_rows() -> None: M_CONFLICT_BACKLOG: [ {"judgement": "pending_judgement", "provenance": "unknown", "n": 5}, {"judgement": "resolver_judged", "provenance": "caller_written", "n": 2}, + {"judgement": "cosine_only", "provenance": "plugin_captured", "n": 3}, ] } ) @@ -2240,9 +2241,12 @@ def test_mentor_conflict_backlog_is_namespace_scoped_and_labels_rows() -> None: out = asyncio.run(reads.conflict_backlog()) assert out["pending_judgement"]["unknown"] == 5 assert out["resolver_judged"]["caller_written"] == 2 + assert out["cosine_only"]["plugin_captured"] == 3 sql, params = ch.sqls[0], ch.params[0] assert "FROM loom.memory FINAL" in sql and "FROM loom.memory_embeddings FINAL" in sql assert "status = 'conflicted'" in sql and "GROUP BY judgement, provenance" in sql + assert "m.capture_origin IN ('claude-code', 'codex')" in sql + assert "created_at, source_class, actor, capture_origin" in sql assert params == {"org": "org-x", "ns": "ns-y"} From f5fd6c786c7709a6a0d6a55bcd145c65476d6188 Mon Sep 17 00:00:00 2001 From: PRAZPC Date: Sat, 5 Dec 2026 16:18:02 +0545 Subject: [PATCH 04/11] Keep conflict review position after decisions Signed-off-by: PRAZPC --- frontend/src/views/admin/ReviewQueue.test.tsx | 28 +++++++++ frontend/src/views/admin/ReviewQueue.tsx | 59 ++++++++++++++----- 2 files changed, 72 insertions(+), 15 deletions(-) diff --git a/frontend/src/views/admin/ReviewQueue.test.tsx b/frontend/src/views/admin/ReviewQueue.test.tsx index 80740d026a2..3eaf895a501 100644 --- a/frontend/src/views/admin/ReviewQueue.test.tsx +++ b/frontend/src/views/admin/ReviewQueue.test.tsx @@ -348,6 +348,9 @@ describe("ReviewQueue", () => { { memory_id: "c", peer_id: "d", memory_sha256: hashC, peer_sha256: hashD, suggestion_hash: "f".repeat(64) }, ]); expect(await screen.findByText(/stale/)).toBeInTheDocument(); + expect(await screen.findByText("value of newer")).toBeInTheDocument(); + expect(screen.getByRole("button", { name: "c" })).toHaveAttribute("aria-current", "true"); + expect(listConflicts).toHaveBeenCalledTimes(1); }, 20000); it("does not send a confirmed bulk action after the namespace visit changes", async () => { @@ -1226,6 +1229,31 @@ describe("ReviewQueue", () => { expect(within(table).getByRole("button", { name: "k/one" })).toHaveAttribute("aria-current", "true"); }); + it("keeps the loaded queue position and decision reason after resolving a conflict", async () => { + vi.mocked(listConflicts).mockImplementation(async (_id, opts) => + opts?.before_version + ? { rows: [conflict("k/three")], next_before_version: null } + : { rows: [conflict("k/one"), conflict("k/two")], next_before_version: 7 }, + ); + vi.mocked(resolveConflict).mockResolvedValueOnce({ resolved: true, affected_memory_ids: [] }); + seed("ns-a", "admin"); + const user = userEvent.setup(); + render(); + await screen.findByText("value of k/one", {}, WAIT); + const table = screen.getByRole("table", { name: "Conflicts" }); + await user.click(screen.getByRole("button", { name: "Load more" })); + await user.click(within(table).getByRole("button", { name: "k/two" })); + const reason = screen.getByRole("textbox", { name: "Reason for the decision" }); + await user.type(reason, "same entity, current value is correct"); + await user.click(screen.getByRole("button", { name: /Keep A/ })); + await waitFor(() => expect(within(table).queryByRole("button", { name: "k/two" })).toBeNull(), WAIT); + expect(within(table).getByRole("button", { name: "k/one" })).toHaveAttribute("aria-current", "true"); + expect(screen.getByRole("textbox", { name: "Reason for the decision" })).toHaveValue( + "same entity, current value is correct", + ); + expect(listConflicts).toHaveBeenCalledTimes(2); + }); + it("peers a resolve wrote while the queue is read again stay out of that read", async () => { let reread: (v: { rows: ConflictRow[]; next_before_version: null }) => void = () => {}; let aReads = 0; diff --git a/frontend/src/views/admin/ReviewQueue.tsx b/frontend/src/views/admin/ReviewQueue.tsx index 92b915ad22b..53803879b68 100644 --- a/frontend/src/views/admin/ReviewQueue.tsx +++ b/frontend/src/views/admin/ReviewQueue.tsx @@ -441,6 +441,7 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void // count, each count read out collects the rows decisions take meanwhile instead and // subtracts them from its answer. const countsOut = useRef(new Set<{ taken: number; stale: boolean }>()); + const countRefresh = useRef(0); // The namespace on screen as of the latest render, for a resolve's count. const queueNow = useRef(queueKey); queueNow.current = queueKey; @@ -515,6 +516,35 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void
); + const removeResolvedRows = (gone: Set) => { + for (const out of readsOut.current) for (const id of gone) out.add(id); + const shown = rowsNow.current ?? []; + for (const c of shown) if (gone.has(c.memory_id)) decidedAt.current.set(c.memory_id, c.version); + const dropped = shown.filter((c) => gone.has(c.memory_id)).length; + const before = (i: number) => shown.slice(0, i).filter((c) => gone.has(c.memory_id)).length; + setRows((prev) => prev && prev.filter((c) => !gone.has(c.memory_id))); + setIndex((i) => Math.max(Math.min(i - before(i), shown.length - dropped - 1), 0)); + return dropped; + }; + + const refreshCounts = (myVisit: number, myQueue: string) => { + const request = ++countRefresh.current; + const countHere = { taken: 0, stale: false }; + countsOut.current.add(countHere); + countReview({ org: identity.org, namespace: identity.namespace }, { fresh: true }) + .then((r) => { + if (visit.current !== myVisit || queueNow.current !== myQueue || request !== countRefresh.current) return; + if (!countHere.stale) setTotal(Math.max((r.total ?? 0) - countHere.taken, 0)); + if (!countHere.stale && countHere.taken === 0) setBacklog(r.backlog ?? null); + onCount(countHere.stale || countHere.taken > 0 ? null : r); + }) + .catch(() => { + if (visit.current === myVisit && queueNow.current === myQueue && request === countRefresh.current) + setBacklog(null); + }) + .finally(() => countsOut.current.delete(countHere)); + }; + useEffect(() => { const at = focusAdded.current; if (at === null || loadingMore) return; @@ -678,7 +708,17 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void `${result.resolved} accepted · ${result.stale} stale · ${result.failed} failed`, result.resolved ? "ok" : "error", ); - if (result.resolved) setReload((n) => n + 1); + if (result.resolved) { + setBacklog(null); + const gone = new Set( + result.results.flatMap((r) => (r.status === "resolved" ? [r.memory_id, r.peer_id] : [])), + ); + const dropped = removeResolvedRows(gone); + if (dropped > 0) decided.current = true; + setTotal((total) => (total === null ? total : Math.max(total - dropped, 0))); + for (const out of countsOut.current) out.taken += dropped; + refreshCounts(myVisit, myQueue); + } } catch (e) { if (visit.current !== myVisit || queueNow.current !== myQueue) return; toastError("Couldn't accept resolver suggestions", e); @@ -713,27 +753,16 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void const sameVisit = visit.current === myVisit && queueNow.current === myQueue; if (sameVisit) { setBacklog(null); - setReload((n) => n + 1); // refresh the queue and its row-based backlog summary } toast("Resolved", "ok"); // The decided row and the peers the resolve wrote (affected_memory_ids: tombstoned or // made active) leave every list, on any visit; ids are org-wide, so no other queue // loses a row. Each is remembered at the version on screen, so a later re-flag shows. const gone = new Set([current.memory_id, ...res.affected_memory_ids]); - for (const out of readsOut.current) for (const id of gone) out.add(id); decidedAt.current.set(current.memory_id, current.version); - const shown = rowsNow.current ?? []; - for (const c of shown) if (gone.has(c.memory_id)) decidedAt.current.set(c.memory_id, c.version); - const dropped = shown.filter((c) => gone.has(c.memory_id)).length; - // Rows dropped before a position move it up by as many: the conflict open now stays - // open, and after this visit's own decision the next one takes its place. - const before = (i: number) => shown.slice(0, i).filter((c) => gone.has(c.memory_id)).length; + // An emptied page with more past it reads the queue again (the decided flag). decided.current = true; - setRows((prev) => prev && prev.filter((c) => !gone.has(c.memory_id))); - // Kept on a row: a decision on the last one opens the one before it, so a Load more - // after it does not move the open conflict. - const left = shown.length - dropped; - setIndex((i) => Math.max(Math.min(i - before(i), left - 1), 0)); + const dropped = removeResolvedRows(gone); if (typeof res.total === "number" && queueNow.current === myQueue) { // The resolve's own count, made after its writes, for the namespace on screen. const total = res.total; @@ -751,7 +780,7 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void // Another visit: the reason is not this decision's. An emptied page with more past // it reads the queue again (the decided flag). if (!sameVisit) return; - setReason(""); + refreshCounts(myVisit, myQueue); } catch (e) { toastError("Couldn't resolve the conflict", e); } finally { From f0ffd3ec2158be979db53c5bae6690f29af9a51c Mon Sep 17 00:00:00 2001 From: PRAZPC Date: Sat, 5 Dec 2026 17:03:46 +0545 Subject: [PATCH 05/11] Fence both revisions during bulk acceptance Signed-off-by: PRAZPC --- server/memory/app/conflicts_ops.py | 10 +++-- server/memory/store/conflicts.py | 1 + server/memory/store/inserts.py | 13 +++++- server/memory/store/lifecycle.py | 35 +++++++++++++--- server/memory/store/pg_memory.py | 11 +++-- server/memory/store/write_fence.py | 11 +++-- .../integration/test_conflict_resolver_ch.py | 42 +++++++++++++++---- tests/unit/test_conflicts_bulk_accept.py | 2 +- tests/unit/test_conflicts_repo.py | 11 ++++- 9 files changed, 107 insertions(+), 29 deletions(-) diff --git a/server/memory/app/conflicts_ops.py b/server/memory/app/conflicts_ops.py index 49f1ec737e3..d8ca3bce122 100644 --- a/server/memory/app/conflicts_ops.py +++ b/server/memory/app/conflicts_ops.py @@ -337,7 +337,7 @@ async def handle_conflicts_resolve( peers = await _live_peers(input, [input.peer_id] if input.peer_id else all_peers) if peers is None: return unresolved - if expected_sha256 is not None and not set(expected_sha256).issubset(peers): + if expected_sha256 is not None and not set(expected_sha256).issubset({input.memory_id, *peers}): return unresolved affected: list[str] = [] @@ -354,7 +354,8 @@ async def handle_conflicts_resolve( namespace=ns, expected_sha256=expected_sha256, ) - if expected_sha256 is not None and len(tombstoned) != len(expected_sha256): + expected_peers = set(expected_sha256 or {}) & set(peers) + if expected_sha256 is not None and len(tombstoned) != len(expected_peers): return unresolved await webhooks.announce([("memory.tombstoned", row) for row in tombstoned]) affected.extend(peers) @@ -582,7 +583,10 @@ async def _resolve_current_bulk_pair( reason="resolver suggestion accepted", resolved_by=writer_actor(), ), - expected_sha256={item.peer_id: item.peer_sha256}, + expected_sha256={ + item.memory_id: item.memory_sha256, + item.peer_id: item.peer_sha256, + }, ) diff --git a/server/memory/store/conflicts.py b/server/memory/store/conflicts.py index 2e14d727abc..ee64b2ca7b9 100644 --- a/server/memory/store/conflicts.py +++ b/server/memory/store/conflicts.py @@ -364,6 +364,7 @@ def _unchanged(row: memory_repo.MemoryRow) -> bool: skip=_unchanged if expected_sha256 is not None else None, strong=expected_sha256 is not None, exact=expected_sha256 is not None, + guard_sha256=expected_sha256, ch=ch, namespace=namespace, ) diff --git a/server/memory/store/inserts.py b/server/memory/store/inserts.py index bd4ec0d679a..02e81f7ed71 100644 --- a/server/memory/store/inserts.py +++ b/server/memory/store/inserts.py @@ -39,6 +39,7 @@ async def insert_memory_versions( publish_now: bool = True, policy: Mapping[tuple[str, str], int] | None = None, expected_heads: Mapping[IdentityKey, MemoryRow | None] | None = None, + guard_heads: Mapping[IdentityKey, MemoryRow | None] | None = None, on_send: Callable[[], None] | None = None, on_inserted: Callable[[], None] | None = None, refuse_values: bool = False, @@ -61,6 +62,9 @@ async def insert_memory_versions( if pg.enabled() and not published: from server.memory.store import pg_memory, pg_publish + if guard_heads: + raise RuntimeError("guard heads require insert_versions_over_heads") + admission = pg_memory.Admission(generations=dict(policy)) if policy else None try: if publish_now: @@ -80,10 +84,17 @@ async def insert_memory_versions( from server.memory.store import refusals from server.memory.store.write_fence import checked_write + checked_heads = dict(expected_heads or {}) + checked_heads.update(guard_heads or {}) guard = ( refusals.publication(ch, rows, committed=True) if pg.enabled() - else checked_write(rows, expected_heads=expected_heads, ch=ch, refuse_values=refuse_values) + else checked_write( + rows, + expected_heads=checked_heads if expected_heads is not None or guard_heads else None, + ch=ch, + refuse_values=refuse_values, + ) ) async with guard: if on_send is not None: diff --git a/server/memory/store/lifecycle.py b/server/memory/store/lifecycle.py index aeabf3b632f..808af27e709 100644 --- a/server/memory/store/lifecycle.py +++ b/server/memory/store/lifecycle.py @@ -77,13 +77,16 @@ async def write_versions_by_ids( judged: bool = False, strict: bool = False, exact: bool = False, + guard_sha256: Mapping[str, str] | None = None, ) -> int: """Write a new version of each live row in `memory_ids`: `update(existing)`'s overrides on every persisted column carried forward, a fresh `version` unless it sets one; an `update` that raises writes nothing, since every row is built before any is written; `skip` and `update` run once every row is read. `namespace`: the rows of that namespace (`reads.get_by_id`). `skip` leaves a row as it is; `strong` - reads read-your-writes, the status mirror's vector rows included. + reads read-your-writes, the status mirror's vector rows included. `guard_sha256` + keeps additional heads at their reviewed hashes through the write fence, without + changing those rows. `on_written` / `on_unconfirmed` hear what the re-read confirmed or could not (see Lifecycle in memory-architecture.md). `judged`: the rows land a verdict reached after the write (the conflict resolver's) on the write it judged @@ -95,10 +98,19 @@ async def write_versions_by_ids( if not memory_ids: return 0 ch = ch or _default_client() - found = await _heads_by_ids(org, namespace, memory_ids, ch=ch, strong=strong) + all_ids = list(dict.fromkeys([*map(str, memory_ids), *(guard_sha256 or {}).keys()])) + found = await _heads_by_ids(org, namespace, all_ids, ch=ch, strong=strong) + by_id = {str(r.memory_id): r for r in found if r is not None} + guard_heads: dict[IdentityKey, MemoryRow] = {} + for memory_id, expected in (guard_sha256 or {}).items(): + head = by_id.get(str(memory_id)) + if head is None or str(head.content_sha256 or "") != expected: + raise pg_memory.AdmissionContendedError("the memory changed while it was read") + guard_heads[identity_key(head)] = head rows: list[dict[str, Any]] = [] sources: list[MemoryRow] = [] - for existing in found: + for memory_id in dict.fromkeys(map(str, memory_ids)): + existing = by_id.get(memory_id) if existing is None or (skip is not None and skip(existing)): continue overrides = dict(update(existing)) @@ -109,7 +121,7 @@ async def write_versions_by_ids( if not rows: return 0 - await insert_versions_over_heads(rows, sources, ch=ch, exact=exact) + await insert_versions_over_heads(rows, sources, ch=ch, exact=exact, guard_heads=guard_heads) confirmed = rows if on_written is not None: # Under Postgres the commit is over each head read (`heads_unchanged(exact=True)`) @@ -318,6 +330,7 @@ async def _insert_clickhouse_copies( on_commit: Callable[[], None] | None, exact: bool, refuse_values: bool, + guard_heads: Mapping[IdentityKey, MemoryRow | None] | None, ) -> int: inserted = not rows count = 0 @@ -336,12 +349,15 @@ async def follow() -> int: try: if rows: expected = ( - {identity_key(r): h for r, h in zip(rows, read, strict=True)} if exact else None + {identity_key(r): h for r, h in zip(rows, read, strict=True)} + if exact or guard_heads + else None ) await insert_memory_versions( rows, ch=ch, expected_heads=expected, + guard_heads=guard_heads, on_inserted=mark_inserted, refuse_values=refuse_values, ) @@ -367,13 +383,15 @@ async def insert_versions_over_heads( on_commit: Callable[[], None] | None = None, exact: bool = False, refuse_values: bool = False, + guard_heads: Mapping[IdentityKey, MemoryRow | None] | None = None, ) -> int: """Write `rows`, each a copy of the authority's head beside it in `read`, drawn above it (`rows.version_over`) or, to yield to a write since, before the read: a copy below the head is overtaken by it. Under Postgres only over that very version, else 503 (`heads_unchanged(exact=True)`): a copy never overwrites a write, a relabel or a redaction it did not see; a key with no head read (None) is held to having no live - head. On ClickHouse, `exact` checks the rows under the same Keeper fences every + head. Guard heads are checked under the same fences or commit locks without being + rewritten. On ClickHouse, `exact` checks the rows under the same Keeper fences every memory insert takes, refusing a moved head with 503 `ADMISSION_CONTENDED`; without it, only the insert is fenced and the source may have moved before the fence. @@ -398,12 +416,15 @@ async def insert_versions_over_heads( on_commit=on_commit, exact=exact, refuse_values=refuse_values, + guard_heads=guard_heads, ) check_memory_rows(rows) heads = {identity_key(r): e for r, e in zip(rows, read, strict=True)} + heads.update(guard_heads or {}) admission = pg_memory.Admission( generations=dict(policy or {}), recheck=pg_memory.heads_unchanged(heads, exact=True), + head_keys=tuple(heads), sources=sources, live_sources=live_sources, ) @@ -1247,6 +1268,7 @@ async def tombstone_cascade_by_ids( skip: Callable[[MemoryRow], bool] | None = None, strong: bool = False, exact: bool = False, + guard_sha256: Mapping[str, str] | None = None, ) -> list[dict[str, Any]]: """Tombstone rows by memory_id AND mirror the tombstone onto every tier search reads (`strong`: the rows read current, for a `skip` that must see a write @@ -1308,6 +1330,7 @@ def _tombstone(existing: MemoryRow) -> dict[str, Any]: skip=skip, strong=strong, exact=exact, + guard_sha256=guard_sha256, ) # A decision's record goes with its writer's row, as on memory.delete; under Postgres # the tombstone's publication retires it (`pg_publish.retire_decision_records`). diff --git a/server/memory/store/pg_memory.py b/server/memory/store/pg_memory.py index 5af3de3a3bc..4542c4fb112 100644 --- a/server/memory/store/pg_memory.py +++ b/server/memory/store/pg_memory.py @@ -266,11 +266,13 @@ class Admission: """What a semantic write checked against, rechecked inside its commit. `generations`: each scope's generation the verdict was reached at. `recheck` - is called with each written key and its current head (a decoded row, or None) + is called with each written or guard key and its current head (a decoded row, or None) under the head's row lock, and raises to refuse or restart the write.""" generations: dict[tuple[str, str], int] = field(default_factory=dict) recheck: Callable[[IdentityKey, dict[str, Any] | None], None] | None = None + # Heads read only to authorize another row's write, checked under the same row locks. + head_keys: Sequence[IdentityKey] = () # Called inside the commit, under the namespace's generation lock, with the rows # committed after the captured generation: True when none can change the # verdict, so the commit goes ahead at the new generation. It does no I/O. @@ -723,6 +725,7 @@ async def commit_versions( for t, r in zip(per_row, stored, strict=True) ] per_scope, scopes, heads, keys = _batch_indexes(stored) + check_keys = sorted(set(keys) | set(admission.head_keys if admission is not None else ())) async with pg.transaction() as conn: await _bound_lock_waits(conn) from server.memory.store import refusals @@ -752,14 +755,14 @@ async def commit_versions( # Each written key's head, locked: checked against what the write read, and a row # not embedded over one that was owes its vectors' retirement (`_replaces_vectors`). recheck = admission.recheck if admission is not None else None - locked = await conn.fetch(_LOCK_HEADS, *_key_arrays(keys)) + locked = await conn.fetch(_LOCK_HEADS, *_key_arrays(check_keys)) current = {identity_key(h): decode_row(h["row"]) for h in locked} enforce_review(stored, current) - for k in keys: + for k in check_keys: head = current.get(k) if recheck is not None: recheck(k, head) - if _replaces_vectors(stored[heads[k]], head): + if k in heads and _replaces_vectors(stored[heads[k]], head): per_row[heads[k]] |= OLD_VECTORS if refuse_values: await refusals.record_postgres(conn, stored) diff --git a/server/memory/store/write_fence.py b/server/memory/store/write_fence.py index ced15c7ba25..eef438ff9b1 100644 --- a/server/memory/store/write_fence.py +++ b/server/memory/store/write_fence.py @@ -42,22 +42,25 @@ async def checked_write( A failed send retains its Keeper holders until all admitted inserts expire; an old process cannot send an insert after another holder starts its check. + Extra expected heads are read-only guards fenced and checked with the inserted keys. """ keys = {identity_key(r) for r in rows} - if expected_heads is not None and set(expected_heads) != keys: - raise ValueError("expected heads must name exactly the inserted keys") + if expected_heads is not None and not keys.issubset(expected_heads): + raise ValueError("expected heads must include every inserted key") + fenced_keys = set(expected_heads) if expected_heads is not None else keys from server.memory.store import refusals names = sorted( set( - [lease_name(key) for key in keys] + refusals.fence_names(rows, forgetting=refuse_values) + [lease_name(key) for key in fenced_keys] + + refusals.fence_names(rows, forgetting=refuse_values) ) ) async with lease_writes.fenced_many( names, ch=_lease_client(ch), wait_s=_admission_wait_s() ) as mark: current = await memory_rows_by_identity_keys( - list(keys), ch=ch, sequential=True, include_tombstoned=True + list(fenced_keys), ch=ch, sequential=True, include_tombstoned=True ) enforce_review(rows, current) if expected_heads is not None: diff --git a/tests/integration/test_conflict_resolver_ch.py b/tests/integration/test_conflict_resolver_ch.py index a4066c02cd7..ae0c2152071 100644 --- a/tests/integration/test_conflict_resolver_ch.py +++ b/tests/integration/test_conflict_resolver_ch.py @@ -785,8 +785,9 @@ async def test_signed_capture_origin_reaches_conflicts_list_and_backlog(ch: Any) set_current_auth(None) -async def test_bulk_accept_does_not_retire_a_peer_replaced_after_validation( - ch: Any, monkeypatch: pytest.MonkeyPatch +@pytest.mark.parametrize("replace_winner", [False, True]) +async def test_bulk_accept_does_not_retire_a_replaced_pair_member_after_validation( + ch: Any, monkeypatch: pytest.MonkeyPatch, replace_winner: bool ) -> None: import server.memory.store as memory_repo from server.identity.domain.read_scope import WHOLE_NAMESPACE @@ -856,23 +857,46 @@ async def test_bulk_accept_does_not_retire_a_peer_replaced_after_validation( ], ) original_resolve = conflicts_ops.handle_conflicts_resolve + replaced = new if replace_winner else old + replaced_key = "city_new" if replace_winner else "city_old" + replaced_session = "s2" if replace_winner else "s1" + + if replace_winner: + original_insert = lifecycle.insert_versions_over_heads + replacing = False + + async def replace_winner_after_read(rows: Any, read: Any, **kwargs: Any) -> Any: + nonlocal replacing + if kwargs.get("guard_heads") and not replacing: + replacing = True + replacement_id = await _set( + org, replaced_session, replaced_key, "The office is in London" + ) + assert replacement_id == replaced["id"] + return await original_insert(rows, read, **kwargs) - async def replace_then_resolve(resolve_input: Any, **kwargs: Any) -> Any: - replacement_id = await _set(org, "s1", "city_old", "The office is in London") - assert replacement_id == old["id"] - return await original_resolve(resolve_input, **kwargs) + monkeypatch.setattr(lifecycle, "insert_versions_over_heads", replace_winner_after_read) + else: - monkeypatch.setattr(conflicts_ops, "handle_conflicts_resolve", replace_then_resolve) + async def replace_peer_then_resolve(resolve_input: Any, **kwargs: Any) -> Any: + replacement_id = await _set( + org, replaced_session, replaced_key, "The office is in London" + ) + assert replacement_id == replaced["id"] + return await original_resolve(resolve_input, **kwargs) + + monkeypatch.setattr(conflicts_ops, "handle_conflicts_resolve", replace_peer_then_resolve) accepted = await conflicts_ops.handle_conflicts_bulk_accept(request) current = await ch.query_all( "SELECT content_sha256, status, tombstoned_at FROM loom.memory FINAL " "WHERE org = {org:String} AND namespace = {ns:String} AND memory_id = {id:UUID} " "SETTINGS select_sequential_consistency = 1", - params={"org": org, "ns": NS, "id": old["id"]}, + params={"org": org, "ns": NS, "id": replaced["id"]}, ) assert accepted.results[0].status == "stale" - assert current and current[0]["content_sha256"] != str(old_row.content_sha256) + prior_hash = new_row.content_sha256 if replace_winner else old_row.content_sha256 + assert current and current[0]["content_sha256"] != str(prior_hash) assert current[0]["tombstoned_at"] is None accepted_events = await ch.query_all( "SELECT count() AS n FROM loom.audit_log WHERE org = {org:String} " diff --git a/tests/unit/test_conflicts_bulk_accept.py b/tests/unit/test_conflicts_bulk_accept.py index 48d5b8e3fe6..9908b0a0144 100644 --- a/tests/unit/test_conflicts_bulk_accept.py +++ b/tests/unit/test_conflicts_bulk_accept.py @@ -222,7 +222,7 @@ async def resolve( assert (out.requested, out.resolved, out.stale, out.failed) == (3, 1, 2, 0) assert len(called) == 1 assert called[0][0].decision == "revise" and called[0][0].peer_id == "loser" - assert called[0][1] == {"loser": sha_b} + assert called[0][1] == {"winner": sha_a, "loser": sha_b} async def _async_value(value): diff --git a/tests/unit/test_conflicts_repo.py b/tests/unit/test_conflicts_repo.py index f53b7893a6c..d153eee4887 100644 --- a/tests/unit/test_conflicts_repo.py +++ b/tests/unit/test_conflicts_repo.py @@ -220,7 +220,16 @@ async def fake_get_by_id(mid, *, org=None, namespace=None, ch=None, scope=None): monkeypatch.setattr(lifecycle, "get_by_id", fake_get_by_id) async def fake_write_versions_by_ids( - org, memory_ids, update, *, ch=None, namespace=None, skip=None, strong=False, exact=False + org, + memory_ids, + update, + *, + ch=None, + namespace=None, + skip=None, + strong=False, + exact=False, + guard_sha256=None, ): row = memory_repo.MemoryRow( memory_id="11111111-2222-3333-4444-555555555555", From 9f7eb7b6c895be32950afada0be5e1ca3f075c73 Mon Sep 17 00:00:00 2001 From: PRAZPC Date: Sat, 5 Dec 2026 17:08:45 +0545 Subject: [PATCH 06/11] Keep conflict queue decisions and counts current Signed-off-by: PRAZPC --- frontend/src/views/admin/ReviewQueue.test.tsx | 72 +++++++++++++++++++ frontend/src/views/admin/ReviewQueue.tsx | 8 ++- 2 files changed, 78 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/admin/ReviewQueue.test.tsx b/frontend/src/views/admin/ReviewQueue.test.tsx index 3eaf895a501..cc7fa68dddd 100644 --- a/frontend/src/views/admin/ReviewQueue.test.tsx +++ b/frontend/src/views/admin/ReviewQueue.test.tsx @@ -353,6 +353,78 @@ describe("ReviewQueue", () => { expect(listConflicts).toHaveBeenCalledTimes(1); }, 20000); + it("offers only the latest direction for a pair and ignores counts that overlap acceptance", async () => { + const hashA = "a".repeat(64); + const hashB = "b".repeat(64); + let finishOldCount: (result: ReviewCounts) => void = () => {}; + vi.mocked(countReview) + .mockImplementationOnce(() => new Promise((resolve) => (finishOldCount = resolve))) + .mockResolvedValue({ total: 1 }); + vi.mocked(listConflicts).mockResolvedValue({ + rows: [ + { ...conflict("a"), memory_id: "a", conflict_with: ["b"], content_sha256: hashA }, + { ...conflict("b"), memory_id: "b", conflict_with: ["a"], content_sha256: hashB }, + { ...conflict("c"), memory_id: "c", conflict_with: [], content_sha256: "c".repeat(64) }, + ], + next_before_version: null, + }); + const auditEvent = (memoryId: string, peerId: string, memorySha: string, peerSha: string, rowHash: string) => ({ + ts: "2026-09-20T00:00:00Z", + event_type: "memory.conflict_resolver", + actor: "process:loom", + request_id: "", + row_hash: rowHash, + subject: JSON.stringify({ + memory_id: memoryId, + content_sha256: memorySha, + pairs: [ + { + peer_id: peerId, + peer_sha256: peerSha, + memory_sha256: memorySha, + action: "flag", + verdict: "update", + confidence: 0.99, + same_entity: true, + same_attribute: true, + }, + ], + }), + }); + // listAuditLog returns newest first. The newer judgement favors B; the older reverse + // direction must not make the same pair selectable a second time. + vi.mocked(listAuditLog).mockResolvedValue({ + rows: [ + auditEvent("b", "a", hashB, hashA, "d".repeat(64)), + auditEvent("a", "b", hashA, hashB, "c".repeat(64)), + ], + }); + vi.mocked(acceptResolverSuggestions).mockResolvedValue({ + requested: 1, + resolved: 1, + stale: 0, + failed: 0, + results: [{ memory_id: "b", peer_id: "a", status: "resolved" }], + }); + seed("ns-a", "admin"); + const user = userEvent.setup(); + render(); + await screen.findByText("Resolver update suggestions", {}, WAIT); + expect(screen.getAllByRole("checkbox")).toHaveLength(1); + await user.click(screen.getByRole("button", { name: "Select all eligible" })); + await user.click(screen.getByRole("button", { name: "Accept selected" })); + await waitFor(() => expect(acceptResolverSuggestions).toHaveBeenCalledWith( + { org: ORG, namespace: "ns-a" }, + [{ memory_id: "b", peer_id: "a", memory_sha256: hashB, peer_sha256: hashA, suggestion_hash: "d".repeat(64) }], + ), WAIT); + await waitFor(() => expect(screen.getByText("1 of 1 loaded")).toBeInTheDocument(), WAIT); + + // This request began before acceptance and may include the retired pair. It must not + // overwrite the fresh post-decision count. + await act(async () => finishOldCount({ total: 3 })); + expect(screen.getByText("1 of 1 loaded")).toBeInTheDocument(); + }); + it("does not send a confirmed bulk action after the namespace visit changes", async () => { const hashA = "a".repeat(64); const hashB = "b".repeat(64); diff --git a/frontend/src/views/admin/ReviewQueue.tsx b/frontend/src/views/admin/ReviewQueue.tsx index 53803879b68..4a5d66094ed 100644 --- a/frontend/src/views/admin/ReviewQueue.tsx +++ b/frontend/src/views/admin/ReviewQueue.tsx @@ -627,6 +627,8 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void peer: ConflictRow; confidence: number; })[] = []; + // Audit rows arrive newest first. Resolver decisions are stored once per judged row, + // so use the unordered pair to keep only the latest direction of each decision. const latestPairSeen = new Set(); for (const event of resolverEvents) { if (!event.row_hash) continue; @@ -638,7 +640,7 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void if (!raw || typeof raw !== "object") continue; const p = raw as Record; const peerId = String(p.peer_id || ""); - const pairKey = `${memoryId}/${peerId}`; + const pairKey = [memoryId, peerId].sort().join("/"); if (latestPairSeen.has(pairKey)) continue; latestPairSeen.add(pairKey); const target = byId.get(memoryId); @@ -716,7 +718,9 @@ function ConflictsPanel({ onCount }: { onCount: (r: ReviewCounts | null) => void const dropped = removeResolvedRows(gone); if (dropped > 0) decided.current = true; setTotal((total) => (total === null ? total : Math.max(total - dropped, 0))); - for (const out of countsOut.current) out.taken += dropped; + // A count already in flight may have observed either side of this write. Discard + // every older answer and let the fresh read below become authoritative. + for (const out of countsOut.current) out.stale = true; refreshCounts(myVisit, myQueue); } } catch (e) { From 46a94ba3fdaeda7768ead6f4bb9b9f30cb48f8b2 Mon Sep 17 00:00:00 2001 From: Project Manager Date: Sat, 5 Dec 2026 23:32:39 +0545 Subject: [PATCH 07/11] Preserve captured conflict review policy across writes Carry authenticated capture provenance through namespace snapshots, gate captured policy until all live instances understand it, and enforce both reviewed heads and active delete locks at the bulk retirement fence. Signed-off-by: Project Manager --- docs/reference/operations.md | 2 +- docs/reference/status.md | 2 +- .../.claude-plugin/plugin.json | 2 +- .../codex-plugin/.codex-plugin/plugin.json | 2 +- .../125_captured_conflict_provenance.sql | 4 +- schemas/schema.sql | 7 +- sdk/python/loom/ops.py | 1 + sdk/ruby/lib/clickhouse/loom/generated/ops.rb | 2 +- sdk/typescript/src/generated/ops.ts | 3 +- server/identity/api/models.py | 1 + server/identity/app/namespace_snapshot.py | 39 +++++- server/memory/app/bulk_rows.py | 19 ++- server/memory/app/conflicts_ops.py | 36 ++++- server/memory/app/observe.py | 4 +- server/memory/app/provenance.py | 31 ++++- server/memory/app/set_commit.py | 1 + server/memory/app/snapshot_rows.py | 28 ++++ server/memory/app/update.py | 4 +- server/memory/app/write.py | 5 +- server/memory/store/conflicts.py | 9 +- .../integration/test_conflict_resolver_ch.py | 130 +++++++++++++++++- tests/unit/test_conflicts_bulk_accept.py | 21 +++ .../test_lineage_and_snapshot_fidelity.py | 40 +++++- tests/unit/test_provenance.py | 28 +++- 24 files changed, 387 insertions(+), 34 deletions(-) diff --git a/docs/reference/operations.md b/docs/reference/operations.md index 3f6c7813895..d8a65e1729b 100644 --- a/docs/reference/operations.md +++ b/docs/reference/operations.md @@ -124,7 +124,7 @@ python scripts/codegen/docs_reference.py --check # exit 1 when a region is stal -397 operations in 45 groups. Every op is served at `POST /v1/` and as the MCP tool `loom_` (dots become underscores). +398 operations in 45 groups. Every op is served at `POST /v1/` and as the MCP tool `loom_` (dots become underscores). Columns: **Role** is the minimum role (`viewer` < `writer` < `admin` < `org_admin` < `platform_admin`); **Kind** is `read` (idempotent, viewer, unaudited, writes nothing — MCP `readOnlyHint`), `idempotent` (safe to retry) or `write`; **Listed under `all`** says whether an MCP connection on the `all` toolset lists the op in `tools/list` (`code.*` ops only with `LOOM_MCP_CODE_TOOLS=true`); an op marked `no` is still callable by name or through `loom_op`, unless it is hidden from MCP; **Audit** marks ops that leave an `audit_log` row. diff --git a/docs/reference/status.md b/docs/reference/status.md index 86385949713..6c40eac39bd 100644 --- a/docs/reference/status.md +++ b/docs/reference/status.md @@ -25,7 +25,7 @@ serves is in the [MCP reference](./mcp.md#toolsets). -397 operations, 283 of them experimental. +398 operations, 284 of them experimental. | Group | Stable | Experimental | | --- | --- | --- | diff --git a/integrations/claude-code-plugin/.claude-plugin/plugin.json b/integrations/claude-code-plugin/.claude-plugin/plugin.json index 4613b267486..fca406319a7 100644 --- a/integrations/claude-code-plugin/.claude-plugin/plugin.json +++ b/integrations/claude-code-plugin/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "loom", "displayName": "ClickHouse Loom", - "version": "1.2.186", + "version": "1.2.188", "description": "Shared long-term memory and code intelligence for Claude Code, self-hosted on ClickHouse. MCP tools to save and recall decisions, preferences and corrections across sessions and teammates; lifecycle hooks that capture each session with no model call; a code index that answers where-is, who-calls and blast-radius questions with line-accurate units instead of whole-file reads.", "author": { "name": "ClickHouse" diff --git a/integrations/codex-plugin/.codex-plugin/plugin.json b/integrations/codex-plugin/.codex-plugin/plugin.json index 9da33aba97f..820e2267033 100644 --- a/integrations/codex-plugin/.codex-plugin/plugin.json +++ b/integrations/codex-plugin/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "loom", - "version": "1.2.186", + "version": "1.2.188", "description": "Shared long-term memory and code intelligence for Codex, self-hosted on ClickHouse. MCP tools to save and recall decisions, preferences and corrections across sessions and teammates; lifecycle hooks that capture each session with no model call; a code index that answers where-is, who-calls and blast-radius questions with line-accurate units instead of whole-file reads.", "author": { "name": "ClickHouse" diff --git a/schemas/migrations/125_captured_conflict_provenance.sql b/schemas/migrations/125_captured_conflict_provenance.sql index 73f77bc73a0..d87a6433875 100644 --- a/schemas/migrations/125_captured_conflict_provenance.sql +++ b/schemas/migrations/125_captured_conflict_provenance.sql @@ -6,7 +6,9 @@ ALTER TABLE loom.memory_versions ALTER TABLE loom.namespaces ADD COLUMN IF NOT EXISTS captured_conflict_policy LowCardinality(String) DEFAULT 'manual_review'; ALTER TABLE loom.namespaces - ADD COLUMN IF NOT EXISTS captured_conflict_confidence Float32 DEFAULT 0.98; + ADD COLUMN IF NOT EXISTS captured_conflict_confidence Float64 DEFAULT 0.98; +ALTER TABLE loom.namespace_snapshots + ADD COLUMN IF NOT EXISTS captured_origin_map String DEFAULT '{}'; -- Modify the insert trigger in place while adding provenance to its query. ALTER TABLE loom.memory_versions_mv MODIFY QUERY diff --git a/schemas/schema.sql b/schemas/schema.sql index 4b5ea894ffa..eab0ea0d652 100644 --- a/schemas/schema.sql +++ b/schemas/schema.sql @@ -3450,7 +3450,8 @@ CREATE TABLE IF NOT EXISTS loom.namespace_snapshots `memory_count` UInt32 DEFAULT 0, `type_count` UInt32 DEFAULT 0, `grant_count` UInt32 DEFAULT 0, - `audit_tail_count` UInt32 DEFAULT 0 + `audit_tail_count` UInt32 DEFAULT 0, + `captured_origin_map` String DEFAULT '{}' ) ENGINE = MergeTree PARTITION BY org @@ -3556,7 +3557,7 @@ CREATE TABLE IF NOT EXISTS loom.namespaces `budget_alert_inbox` String DEFAULT '', `curator_mode` LowCardinality(String) DEFAULT '', `captured_conflict_policy` LowCardinality(String) DEFAULT 'manual_review', - `captured_conflict_confidence` Float32 DEFAULT 0.98 + `captured_conflict_confidence` Float64 DEFAULT 0.98 ) ENGINE = ReplacingMergeTree(updated_at) PARTITION BY org @@ -4727,7 +4728,7 @@ FROM CAST(if(raw.mirror_marked != 0, CAST(0, 'UInt32'), raw.input_tokens), 'UInt32') AS input_tokens, CAST(if(raw.mirror_marked != 0, CAST(0, 'UInt32'), raw.output_tokens), 'UInt32') AS output_tokens, CAST(if(raw.mirror_marked != 0, CAST(0, 'UInt32'), raw.embedding_tokens), 'UInt32') AS embedding_tokens, - CAST(if(raw.mirror_marked != 0, CAST(0, 'Decimal(18, 6)'), raw.upstream_cost_usd), 'Decimal(18, 6)') AS upstream_cost_usd, + CAST(if(raw.mirror_marked != 0, CAST('0', 'Decimal(18, 6)'), raw.upstream_cost_usd), 'Decimal(18, 6)') AS upstream_cost_usd, CAST(if(raw.mirror_marked != 0, CAST(0, 'UInt64'), raw.bytes_written), 'UInt64') AS bytes_written, CAST(if(raw.mirror_marked != 0, CAST(false, 'Bool'), raw.success), 'Bool') AS success, CAST(if(raw.mirror_marked != 0, CAST('', 'LowCardinality(String)'), raw.error_code), 'LowCardinality(String)') AS error_code, diff --git a/sdk/python/loom/ops.py b/sdk/python/loom/ops.py index 9c85225289e..ef4d2ffda40 100644 --- a/sdk/python/loom/ops.py +++ b/sdk/python/loom/ops.py @@ -18786,6 +18786,7 @@ class SnapshotMemoryRow(TypedDict, total=False): locked_at: NotRequired[Optional[str]] on_expire: NotRequired[str] expire_reason: NotRequired[str] + capture_origin: NotRequired[str] files: NotRequired[list[str]] concepts: NotRequired[list[str]] diff --git a/sdk/ruby/lib/clickhouse/loom/generated/ops.rb b/sdk/ruby/lib/clickhouse/loom/generated/ops.rb index 490acb1ca04..bbe4eaab794 100644 --- a/sdk/ruby/lib/clickhouse/loom/generated/ops.rb +++ b/sdk/ruby/lib/clickhouse/loom/generated/ops.rb @@ -8,7 +8,7 @@ module Loom # Every served operation: its spec in OPS, and one method per op on the class # of its group (`client.memory.set(...)` is `memory.set`). module Generated - OP_COUNT = 397 + OP_COUNT = 398 # The declared spec of every served op, by name; the HTTP path is /v1/. OPS = { diff --git a/sdk/typescript/src/generated/ops.ts b/sdk/typescript/src/generated/ops.ts index 2a104b5b024..db79d7a87b8 100644 --- a/sdk/typescript/src/generated/ops.ts +++ b/sdk/typescript/src/generated/ops.ts @@ -9061,6 +9061,7 @@ export interface SnapshotMemoryRow { locked_at?: string | null; on_expire?: string; expire_reason?: string; + capture_origin?: string; files?: string[]; concepts?: string[]; } @@ -12790,4 +12791,4 @@ export const OP_BY_NAME: Readonly> = Object.fromEntries( OPS.map((o) => [o.name, o]), ) as Readonly>; -export const GENERATED_OP_COUNT = 397; +export const GENERATED_OP_COUNT = 398; diff --git a/server/identity/api/models.py b/server/identity/api/models.py index 13b2400f985..7734d9fef83 100644 --- a/server/identity/api/models.py +++ b/server/identity/api/models.py @@ -605,6 +605,7 @@ class _SnapshotMemoryRow(BaseModel): locked_at: datetime | None = None on_expire: str = "" expire_reason: str = "" + capture_origin: str = "" files: list[str] = Field(default_factory=list) concepts: list[str] = Field(default_factory=list) diff --git a/server/identity/app/namespace_snapshot.py b/server/identity/app/namespace_snapshot.py index 4abbebb0cef..d391b044aef 100644 --- a/server/identity/app/namespace_snapshot.py +++ b/server/identity/app/namespace_snapshot.py @@ -55,6 +55,22 @@ async def handle_namespace_snapshot( # Memories — active, non-tombstoned. memory_rows = await memory_snapshot.read_namespace(ch, org=input.org, namespace=input.namespace) memories = [snapshot_memory_row(r) for r in memory_rows] + from server.core.hashing import sha256_value + + captured_origins = { + str(m.memory_id): { + "origin": str(m.capture_origin), + "row_hash": sha256_value( + { + "content_sha256": str(m.content_sha256 or ""), + "value": str(m.value or ""), + "value_json": str(m.value_json or "{}"), + } + ), + } + for m in memories + if m.capture_origin in {"claude-code", "codex"} + } # Per-type configs. type_dicts = await list_type_configs(input.org, input.namespace) types = [_SnapshotTypeRow(**t) for t in type_dicts] @@ -124,6 +140,7 @@ async def handle_namespace_snapshot( "type_count": len(types), "grant_count": len(grants), "audit_tail_count": len(audit_tail), + "captured_origin_map": json.dumps(captured_origins, separators=(",", ":")), } ], settings={"async_insert": 0, "wait_for_async_insert": 1}, @@ -164,8 +181,28 @@ async def _restore_payload( input: NamespaceRestoreInput, version_base: int ) -> tuple[list[dict[str, Any]], int]: """Validate all restored values before the namespace or its grants change.""" + ch = get_client() + trusted = await ch.query_one( + """ + SELECT captured_origin_map + FROM loom.namespace_snapshots + WHERE org = {org:String} AND snapshot_id = {sid:UUID} + AND source_namespace = {source_ns:String} + ORDER BY created_at DESC + LIMIT 1 + """, + params={ + "org": input.org, + "sid": input.payload.snapshot_id, + "source_ns": input.payload.source_namespace, + }, + ) + origins = json.loads(str(trusted.get("captured_origin_map") or "{}")) if trusted else {} + if not isinstance(origins, dict): + origins = {} + memories = memory_snapshot.authenticated_capture_origins(input.payload.memories, origins) memories, erased = await memory_snapshot.without_erased( - input.org, input.target_namespace, input.payload.memories + input.org, input.target_namespace, memories ) rows = memory_snapshot.checked_rows( memory_snapshot.restore_rows( diff --git a/server/memory/app/bulk_rows.py b/server/memory/app/bulk_rows.py index 62af21f64a1..da97b2c2fe5 100644 --- a/server/memory/app/bulk_rows.py +++ b/server/memory/app/bulk_rows.py @@ -30,7 +30,11 @@ from server.memory.app.projections import ( resolved_entity_list, ) -from server.memory.app.provenance import capture_origin, revision_capture_origin, writer_actor +from server.memory.app.provenance import ( + capture_origin_for_write, + revision_capture_origin, + writer_actor, +) from server.memory.app.sensitivity_level import decoded_text, resolve_level from server.memory.app.set_commit import count_attribute_tags, set_next from server.memory.domain import lock as _lock @@ -287,7 +291,7 @@ def _bulk_carried(state: _BulkWriteState, memory_key: str) -> dict[str, Any]: def _full_version_row( - state: _BulkWriteState, memory_row: dict[str, Any], now: datetime + state: _BulkWriteState, memory_row: dict[str, Any], now: datetime, capture_origin: str ) -> dict[str, Any]: """Every row carries every column (one insert, one column list): a revision carries the live row forward (`build_revision_row`), a first write takes the @@ -300,10 +304,12 @@ def _full_version_row( live, memory_row, capture_origin=revision_capture_origin( - str(live.content_sha256 or ""), str(memory_row.get("content_sha256") or "") + str(live.content_sha256 or ""), + str(memory_row.get("content_sha256") or ""), + origin=capture_origin, ), ) - return memory_repo.build_first_version_row(memory_row, now=now, capture_origin=capture_origin()) + return memory_repo.build_first_version_row(memory_row, now=now, capture_origin=capture_origin) def _bulk_locked(state: _BulkWriteState, memory_key: str, action: _lock.LockAction) -> bool: @@ -752,6 +758,7 @@ async def _bulk_build_rows( item per kept entry to `state`.""" now_utc = state.now_utc + capture_origin = await capture_origin_for_write() read = 0 # characters the sensitivity detector read for the entries before this one for entry in input.entries: if entry.memory_key in state.unchecked_keys: @@ -896,7 +903,9 @@ async def _bulk_build_rows( "on_expire": entry_on_expire, "updated_at": now_utc.replace(tzinfo=None), } - memory_row = _full_version_row(state, memory_row, now_utc.replace(tzinfo=None)) + memory_row = _full_version_row( + state, memory_row, now_utc.replace(tzinfo=None), capture_origin + ) # created vs updated, decided per row rather than labelling the whole batch # "created". Only byte-identical restatements are diverted by the skip-gate above; an # entry whose key already exists with DIFFERENT content is inserted as a new version, diff --git a/server/memory/app/conflicts_ops.py b/server/memory/app/conflicts_ops.py index d8ca3bce122..e8b4dc039b8 100644 --- a/server/memory/app/conflicts_ops.py +++ b/server/memory/app/conflicts_ops.py @@ -6,6 +6,7 @@ import itertools import logging import time +from collections.abc import Mapping from contextlib import AsyncExitStack, nullcontext from datetime import datetime from typing import Any, Literal @@ -353,6 +354,13 @@ async def handle_conflicts_resolve( now, namespace=ns, expected_sha256=expected_sha256, + skip=( + lambda row: ( + _bulk_loser_is_locked(row, input.memory_id) + if expected_sha256 is not None + else None + ) + ), ) expected_peers = set(expected_sha256 or {}) & set(peers) if expected_sha256 is not None and len(tombstoned) != len(expected_peers): @@ -438,11 +446,7 @@ async def handle_conflicts_bulk_accept( if item.memory_id < item.peer_id else (item.peer_id, item.memory_id) ) - if pair in seen: - results.append(_bulk_accept_result(item, "failed", "Duplicate item")) - continue - seen.add(pair) - if selected[pair] is not item: + if not _bulk_item_selected(pair, item, selected, seen): results.append(_bulk_accept_result(item, "failed", "Duplicate item")) continue try: @@ -630,6 +634,28 @@ def _bulk_pair_is_protected(winner: Any, loser: Any) -> bool: return any(row.pinned or str(row.sensitivity or "") == "high" for row in (winner, loser)) +def _bulk_item_selected( + pair: tuple[str, str], + item: Any, + selected: Mapping[tuple[str, str], Any], + seen: set[tuple[str, str]], +) -> bool: + """Consume a pair only when its latest resolver direction is selected.""" + if pair in seen or selected[pair] is not item: + return False + seen.add(pair) + return True + + +def _bulk_loser_is_locked(row: Any, winner_id: str) -> bool: + """Recheck the losing head's deletion lock at the tombstone write fence.""" + if str(row.memory_id) == winner_id: + return False + from server.memory.domain.lock import refuses_retirement + + return refuses_retirement(row) + + async def _allow_pairs( input: ConflictsResolveInput, peers: list[str], *, now: datetime, by: str, reason: str ) -> None: diff --git a/server/memory/app/observe.py b/server/memory/app/observe.py index 3b605142c61..61ca74cfd12 100644 --- a/server/memory/app/observe.py +++ b/server/memory/app/observe.py @@ -34,7 +34,7 @@ ObserveRecordInput, ObserveRecordOutput, ) -from server.memory.app.provenance import capture_origin, writer_actor +from server.memory.app.provenance import capture_origin_for_write, writer_actor from server.memory.domain.observation_tags import ( BLACKLISTED_REASON, BLACKLISTED_TAG, @@ -358,7 +358,7 @@ async def handle_observe_record(input: ObserveRecordInput) -> ObserveRecordOutpu "content_sha256": content_sha, }, now=now_naive, - capture_origin=capture_origin(), + capture_origin=await capture_origin_for_write(), ) await insert_memory_versions([row], ch=ch) diff --git a/server/memory/app/provenance.py b/server/memory/app/provenance.py index 3935f6fbadb..9ec22bca904 100644 --- a/server/memory/app/provenance.py +++ b/server/memory/app/provenance.py @@ -5,9 +5,13 @@ from __future__ import annotations +import logging + from server.memory.domain import trust from server.memory.domain.provenance import pipeline_actor_var +log = logging.getLogger(__name__) + def writer_actor(fallback: str = "") -> str: """The writing principal as `kind:subject`, kind from the token; then the @@ -34,10 +38,33 @@ def capture_origin() -> str: return origin if origin in {"claude-code", "codex"} else "" -def revision_capture_origin(existing_sha256: str, new_sha256: str) -> str | None: +async def capture_origin_for_write() -> str: + """Enable captured-row provenance only after a fresh read sees no N-1 replica.""" + from server.core import instances + from server.core.ch import get_client + from server.settings import settings + + if settings.deployment: + try: + live = await instances.read_live(get_client()) + except Exception as e: # noqa: BLE001 — unknown replica versions disable capture provenance + log.warning("captured memory provenance disabled: replica versions unavailable: %s", e) + return "" + if not live or any(int(row.get("schema_version") or 0) < 125 for row in live): + return "" + return capture_origin() + + +def revision_capture_origin( + existing_sha256: str, new_sha256: str, *, origin: str | None = None +) -> str | None: """Use the verified writer origin for changed content; maintenance-only copies keep the row's stored origin through the version builder.""" - return capture_origin() if existing_sha256 != new_sha256 else None + return ( + (origin if origin is not None else capture_origin()) + if existing_sha256 != new_sha256 + else None + ) def label_actor() -> str: diff --git a/server/memory/app/set_commit.py b/server/memory/app/set_commit.py index 7b53b9be76f..15c8307d34e 100644 --- a/server/memory/app/set_commit.py +++ b/server/memory/app/set_commit.py @@ -261,6 +261,7 @@ class _SetWrite: writer_actor: str = "" source_class: str = "" memory_row: dict[str, Any] = field(default_factory=dict) + capture_origin: str = "" embedder: Any = None excerpt: str = "" embedding: list[float] = field(default_factory=list) diff --git a/server/memory/app/snapshot_rows.py b/server/memory/app/snapshot_rows.py index 0cdc6d97ca0..2e7d6c00785 100644 --- a/server/memory/app/snapshot_rows.py +++ b/server/memory/app/snapshot_rows.py @@ -59,6 +59,7 @@ def persisted_columns() -> tuple[str, ...]: "version", "tombstoned_at", "content_sha256", + "capture_origin", } ) @@ -126,6 +127,33 @@ def snapshot_fields(r: Mapping[str, Any], keep: Container[str]) -> dict[str, Any return data +def authenticated_capture_origins(memories: Sequence[Any], origins: Mapping[str, Any]) -> list[Any]: + """Apply only server-recorded capture provenance; restore payload values are untrusted.""" + from server.core.hashing import sha256_value + + def authenticated(memory: Any) -> str: + record = origins.get(str(memory.memory_id)) + if not isinstance(record, Mapping): + return "" + origin = record.get("origin") + digest = sha256_value( + { + "content_sha256": str(memory.content_sha256 or ""), + "value": str(memory.value or ""), + "value_json": str(memory.value_json or "{}"), + } + ) + return ( + str(origin) + if origin in {"claude-code", "codex"} and digest == record.get("row_hash") + else "" + ) + + return [ + memory.model_copy(update={"capture_origin": authenticated(memory)}) for memory in memories + ] + + def restore_rows( memories: Sequence[Any], *, diff --git a/server/memory/app/update.py b/server/memory/app/update.py index 3f6e9e116d5..644afbcafed 100644 --- a/server/memory/app/update.py +++ b/server/memory/app/update.py @@ -1072,7 +1072,9 @@ async def _write_revision( **( { "capture_origin": app_provenance.revision_capture_origin( - str(existing.content_sha256 or ""), new_sha + str(existing.content_sha256 or ""), + new_sha, + origin=await app_provenance.capture_origin_for_write(), ) } if existing.content_sha256 != new_sha diff --git a/server/memory/app/write.py b/server/memory/app/write.py index c4fc7525deb..79fad6574f5 100644 --- a/server/memory/app/write.py +++ b/server/memory/app/write.py @@ -624,13 +624,14 @@ def _set_build_memory_row(w: _SetWrite) -> None: capture_origin=app_provenance.revision_capture_origin( str(existing.content_sha256 or ""), str(memory_row.get("content_sha256") or ""), + origin=w.capture_origin, ), ) else: import server.memory.store as memory_repo memory_row = memory_repo.build_first_version_row( - memory_row, now=now_naive, capture_origin=app_provenance.capture_origin() + memory_row, now=now_naive, capture_origin=w.capture_origin ) w.memory_id = memory_id w.had_existing_row = had_existing_row @@ -745,6 +746,7 @@ async def _memory_set_once(input: MemorySetInput, *, embedder: Any = None) -> Me # under Postgres the commit keeps the newer head, a delete's tombstone too. if head is not None: w.version = version_over(head, w.version) + w.capture_origin = await app_provenance.capture_origin_for_write() _set_build_memory_row(w) # Non-searchable type, or a 'high' sensitivity row: single insert is the @@ -793,6 +795,7 @@ async def _memory_set_once(input: MemorySetInput, *, embedder: Any = None) -> Me raise AdmissionContendedError( f"commits to {input.namespace!r} kept changing this write's verdict" ) from None + w.capture_origin = await app_provenance.capture_origin_for_write() _set_build_memory_row(w) # the next verdict stamps a fresh row if conflict_result.verdict == "clear": peers_out = [] # a conflict the mark found no live peer for: none to resolve diff --git a/server/memory/store/conflicts.py b/server/memory/store/conflicts.py index ee64b2ca7b9..1bfb2591108 100644 --- a/server/memory/store/conflicts.py +++ b/server/memory/store/conflicts.py @@ -334,6 +334,7 @@ async def tombstone_ids( *, namespace: str, expected_sha256: dict[str, str] | None = None, + skip: Any = None, ch: _CHClient | None = None, ) -> list[dict[str, Any]]: """Tombstone N rows of `namespace` by memory_id. `audit_note` is appended to @@ -361,7 +362,13 @@ def _unchanged(row: memory_repo.MemoryRow) -> bool: memory_ids, when=when, update=_note, - skip=_unchanged if expected_sha256 is not None else None, + skip=( + (lambda row: _unchanged(row) or skip(row)) + if expected_sha256 is not None and skip is not None + else _unchanged + if expected_sha256 is not None + else skip + ), strong=expected_sha256 is not None, exact=expected_sha256 is not None, guard_sha256=expected_sha256, diff --git a/tests/integration/test_conflict_resolver_ch.py b/tests/integration/test_conflict_resolver_ch.py index ae0c2152071..4e0c3ce8c05 100644 --- a/tests/integration/test_conflict_resolver_ch.py +++ b/tests/integration/test_conflict_resolver_ch.py @@ -715,11 +715,18 @@ async def test_bulk_accept_uses_current_resolver_audit_and_is_retry_safe(ch: Any assert int(audit_rows[0]["n"]) == 1 -async def test_signed_capture_origin_reaches_conflicts_list_and_backlog(ch: Any) -> None: +@pytest.mark.parametrize(("schema_version", "expected_origin"), [(124, ""), (125, "claude-code")]) +async def test_signed_capture_origin_reaches_conflicts_list_and_backlog( + ch: Any, + monkeypatch: pytest.MonkeyPatch, + schema_version: int, + expected_origin: str, +) -> None: import server.memory.store as memory_repo from server.auth import revocation from server.auth.context import set_current_auth from server.auth.jwt import mint_token, verify_token + from server.core import instances from server.identity.domain.read_scope import WHOLE_NAMESPACE from server.insights.store.mentor import ProfileReads from server.memory.api.models_conflicts import ConflictsListInput @@ -728,6 +735,12 @@ async def test_signed_capture_origin_reaches_conflicts_list_and_backlog(ch: Any) from server.memory.store.conflicts import count_conflict_backlog from server.settings import settings + async def current_replicas(_ch: Any) -> list[dict[str, int]]: + return [{"schema_version": schema_version}] + + monkeypatch.setattr(instances, "read_live", current_replicas) + monkeypatch.setattr(settings, "deployment", "resolver-rollout-test") + org = unique_org("resolver-capture-origin") token = mint_token( "sa:capture-test", @@ -761,9 +774,10 @@ async def test_signed_capture_origin_reaches_conflicts_list_and_backlog(ch: Any) peer_sha256={old["id"]: str(old_row.content_sha256)}, ) listed = await handle_conflicts_list(ConflictsListInput(org=org, namespace=NS)) - assert listed.rows and all(row.capture_origin == "claude-code" for row in listed.rows) + assert listed.rows and all(row.capture_origin == expected_origin for row in listed.rows) backlog = await count_conflict_backlog(org, NS, scope=WHOLE_NAMESPACE, ch=ch) - assert sum(group["plugin_captured"] for group in backlog.values()) == 2 + expected_captured = 2 if expected_origin else 0 + assert sum(group["plugin_captured"] for group in backlog.values()) == expected_captured mentor_backlog = await ProfileReads( org, NS, @@ -780,11 +794,119 @@ async def test_signed_capture_origin_reaches_conflicts_list_and_backlog(ch: Any) }, ch=ch, ).conflict_backlog() - assert sum(group["plugin_captured"] for group in mentor_backlog.values()) == 2 + assert ( + sum(group["plugin_captured"] for group in mentor_backlog.values()) == expected_captured + ) finally: set_current_auth(None) +async def test_captured_conflict_confidence_round_trips_at_threshold(ch: Any) -> None: + org = unique_org("resolver-confidence-roundtrip") + await ch.insert( + "loom.namespaces", + [{"org": org, "namespace": NS, "captured_conflict_confidence": 0.98}], + ) + row = await ch.query_one( + "SELECT captured_conflict_confidence FROM loom.namespaces " + "WHERE org = {org:String} AND namespace = {ns:String} " + "ORDER BY updated_at DESC LIMIT 1", + params={"org": org, "ns": NS}, + ) + assert row is not None + assert float(row["captured_conflict_confidence"]) == 0.98 + assert 0.98 >= float(row["captured_conflict_confidence"]) + + +@pytest.mark.parametrize("lock_mode", ["no_delete", "read_only"]) +async def test_bulk_accept_respects_loser_delete_lock_at_write_fence( + ch: Any, lock_mode: str +) -> None: + import server.memory.store as memory_repo + from server.identity.domain.read_scope import WHOLE_NAMESPACE + from server.memory.api.models_conflicts import ( + ConflictsBulkAcceptInput, + ConflictsResolverAcceptItem, + ) + from server.memory.app.conflicts import mark_peers_conflicted + from server.memory.app.conflicts_ops import handle_conflicts_bulk_accept + from server.observability import audit + + org = unique_org("resolver-bulk-lock") + await _pair(ch, org, "locked_old", "locked_new", 157, gap=False) + rows = await _rows(ch, org) + old, new = rows["locked_old"], rows["locked_new"] + old_row, new_row = await asyncio.gather( + memory_repo.get_by_id( + old["id"], org=org, namespace=NS, scope=WHOLE_NAMESPACE, fresh=True, strong=True + ), + memory_repo.get_by_id( + new["id"], org=org, namespace=NS, scope=WHOLE_NAMESPACE, fresh=True, strong=True + ), + ) + assert old_row is not None and new_row is not None + await mark_peers_conflicted( + org=org, + namespace=NS, + new_memory_id=new["id"], + peer_ids=[old["id"]], + expected_sha256=str(new_row.content_sha256), + peer_sha256={old["id"]: str(old_row.content_sha256)}, + ) + suggestion_hash = await audit.emit( + "memory.conflict_resolver", + org=org, + namespace=NS, + actor="process:loom", + subject={ + "memory_id": new["id"], + "content_sha256": str(new_row.content_sha256), + "model": "scripted", + "prompt_version": PROMPT_VERSION, + "pairs": [ + { + "peer_id": old["id"], + "action": "flag", + "verdict": "update", + "confidence": 0.99, + "same_entity": True, + "same_attribute": True, + "memory_sha256": str(new_row.content_sha256), + "peer_sha256": str(old_row.content_sha256), + } + ], + }, + ) + await memory_repo.write_versions_by_ids( + org, + [old["id"]], + lambda _row: {"lock_mode": lock_mode, "lock_reason": "review guard"}, + namespace=NS, + strong=True, + ) + accepted = await handle_conflicts_bulk_accept( + ConflictsBulkAcceptInput( + org=org, + namespace=NS, + items=[ + ConflictsResolverAcceptItem( + memory_id=new["id"], + peer_id=old["id"], + memory_sha256=str(new_row.content_sha256), + peer_sha256=str(old_row.content_sha256), + suggestion_hash=suggestion_hash, + ) + ], + ) + ) + loser = await memory_repo.get_by_id( + old["id"], org=org, namespace=NS, scope=WHOLE_NAMESPACE, fresh=True, strong=True + ) + assert accepted.results[0].status == "stale" + assert loser is not None and loser.tombstoned_at is None + assert loser.lock_mode == lock_mode + + @pytest.mark.parametrize("replace_winner", [False, True]) async def test_bulk_accept_does_not_retire_a_replaced_pair_member_after_validation( ch: Any, monkeypatch: pytest.MonkeyPatch, replace_winner: bool diff --git a/tests/unit/test_conflicts_bulk_accept.py b/tests/unit/test_conflicts_bulk_accept.py index 9908b0a0144..9ea30e268f5 100644 --- a/tests/unit/test_conflicts_bulk_accept.py +++ b/tests/unit/test_conflicts_bulk_accept.py @@ -86,6 +86,27 @@ def test_bulk_accept_is_admin_only_and_hidden_from_mcp() -> None: assert not mcp_reach("conflicts.bulk_accept") +@pytest.mark.parametrize("stale_first", [False, True]) +def test_bulk_duplicate_pair_selects_current_direction_in_either_order(stale_first: bool) -> None: + from server.memory.app.conflicts_ops import _bulk_item_selected + + current, stale = object(), object() + selected = {("a", "z"): current} + seen: set[tuple[str, str]] = set() + ordered = [stale, current] if stale_first else [current, stale] + assert [_bulk_item_selected(("a", "z"), item, selected, seen) for item in ordered] == ( + [False, True] if stale_first else [True, False] + ) + + +@pytest.mark.parametrize("mode", ["no_delete", "read_only"]) +def test_bulk_accept_rechecks_loser_deletion_lock_at_write_fence(mode: str) -> None: + from server.memory.app.conflicts_ops import _bulk_loser_is_locked + + loser = SimpleNamespace(memory_id="loser", lock_mode=mode, lock_until=None) + assert _bulk_loser_is_locked(loser, "winner") + + @pytest.mark.asyncio async def test_bulk_accept_resolves_current_item_and_returns_stale_for_changed_suggestion( monkeypatch: pytest.MonkeyPatch, diff --git a/tests/unit/test_lineage_and_snapshot_fidelity.py b/tests/unit/test_lineage_and_snapshot_fidelity.py index 0fee4934fc6..2e025349929 100644 --- a/tests/unit/test_lineage_and_snapshot_fidelity.py +++ b/tests/unit/test_lineage_and_snapshot_fidelity.py @@ -23,6 +23,7 @@ "evidence", "tags", "valid_at", + "capture_origin", } @@ -80,6 +81,7 @@ def test_snapshot_query_and_restore_row_agree_with_the_model() -> None: valid_at=None, content_sha256="ab" * 32, tags=["t"], + capture_origin="claude-code", ) (out,) = restore_rows( [row], @@ -90,11 +92,47 @@ def test_snapshot_query_and_restore_row_agree_with_the_model() -> None: actor="process:restore", ) assert set(out) == set(MEMORY_PERSISTED_COLS) - for col in ("verified_by", "verified_sha256", "grounding", "evidence", "valid_at"): + for col in ( + "verified_by", + "verified_sha256", + "grounding", + "evidence", + "valid_at", + "capture_origin", + ): assert out[col] == getattr(row, col), col assert out["content_sha256"] == "ab" * 32 and out["tags"] == ["t"] and out["version"] == 7 +def test_restore_replaces_payload_capture_origin_with_snapshot_record() -> None: + from server.core.hashing import sha256_value + from server.memory.app.snapshot_rows import authenticated_capture_origins + + row = _SnapshotMemoryRow( + memory_id="55555555-5555-5555-5555-555555555555", + agent="a", + user_id="-", + session_id="-", + run_id="-", + memory_key="k", + memory_type="semantic", + value='"v"', + confidence=1.0, + source_trace="", + pinned=False, + capture_origin="codex", + ) + source = {"content_sha256": "", "value": row.value, "value_json": row.value_json} + record = {"origin": "claude-code", "row_hash": sha256_value(source)} + assert authenticated_capture_origins([row], {})[0].capture_origin == "" + assert ( + authenticated_capture_origins([row], {row.memory_id: record})[0].capture_origin + == "claude-code" + ) + changed = row.model_copy(update={"value": '"caller changed this"'}) + assert authenticated_capture_origins([changed], {row.memory_id: record})[0].capture_origin == "" + + def test_consolidation_writer_links_derived_from() -> None: src = (ROOT / "server/memory/app/consolidate.py").read_text() assert 'support_type="derived_from"' in src diff --git a/tests/unit/test_provenance.py b/tests/unit/test_provenance.py index f114fa626e1..d2cf52cc3b7 100644 --- a/tests/unit/test_provenance.py +++ b/tests/unit/test_provenance.py @@ -22,10 +22,14 @@ def test_writer_actor_kind_comes_from_the_token() -> None: assert writer_actor(fallback="process:consolidation") == "process:consolidation" -def test_capture_origin_is_signed_and_first_write_ignores_body_value() -> None: +def test_capture_origin_is_signed_and_first_write_ignores_body_value( + monkeypatch: pytest.MonkeyPatch, +) -> None: from datetime import UTC, datetime from server.auth.jwt import TokenError, mint_token, verify_token + from server.core import instances + from server.memory.app.provenance import capture_origin from server.memory.store.rows import build_first_version_row token = mint_token( @@ -47,6 +51,8 @@ def test_capture_origin_is_signed_and_first_write_ignores_body_value() -> None: ) set_current_auth(auth) + monkeypatch.setattr(instances, "every_live_replica_at", lambda migration: True) + assert capture_origin() == "claude-code" at = datetime(2026, 1, 1, tzinfo=UTC) row = build_first_version_row( { @@ -71,6 +77,26 @@ def test_capture_origin_is_signed_and_first_write_ignores_body_value() -> None: set_current_auth(None) +@pytest.mark.asyncio +@pytest.mark.parametrize(("schema_version", "expected"), [(124, ""), (125, "claude-code")]) +async def test_capture_origin_waits_until_every_live_replica_understands_it( + monkeypatch: pytest.MonkeyPatch, schema_version: int, expected: str +) -> None: + from server.core import instances + from server.memory.app.provenance import capture_origin_for_write + from server.settings import settings + + set_current_auth(SimpleNamespace(subject="test", org="o", capture_origin="claude-code")) + monkeypatch.setattr(settings, "deployment", "rolling-test") + + async def live_rows(_ch): + return [{"schema_version": schema_version}] + + monkeypatch.setattr(instances, "read_live", live_rows) + assert await capture_origin_for_write() == expected + set_current_auth(None) + + def test_memory_version_builder_carries_capture_origin() -> None: from datetime import datetime From 8ae03d670e7ecc554e545698d5c175f178e16057 Mon Sep 17 00:00:00 2001 From: Project Manager Date: Sun, 6 Dec 2026 11:27:37 +0545 Subject: [PATCH 08/11] Gate captured provenance on resolver capability Use the instance heartbeat ID to distinguish resolvers that understand captured provenance during mixed-version deployments. Return a protected result when a lock blocks bulk retirement at the write fence. Signed-off-by: Project Manager --- server/core/instances.py | 4 ++- server/memory/app/conflicts_ops.py | 27 +++++++++++++------ server/memory/app/provenance.py | 9 +++++-- .../integration/test_conflict_resolver_ch.py | 14 ++++++---- tests/unit/test_cell.py | 1 + tests/unit/test_conflicts_bulk_accept.py | 6 ++++- tests/unit/test_provenance.py | 17 +++++++++--- 7 files changed, 57 insertions(+), 21 deletions(-) diff --git a/server/core/instances.py b/server/core/instances.py index 136370d4067..7183a474ebb 100644 --- a/server/core/instances.py +++ b/server/core/instances.py @@ -52,6 +52,7 @@ TABLE = "loom.instances" CELL_TABLE = "loom.cell_heartbeats" QUERY_TAG = "instances.heartbeat" +CAPTURED_CONFLICT_PROVENANCE_MARKER = "ccp1-" # A row is live while its last beat is younger than this many intervals. _LIVE_INTERVALS = 3 @@ -93,7 +94,8 @@ def _this_process() -> tuple[int, str, datetime]: def instance_id() -> str: - return _this_process()[1] + # KeeperMap cannot gain a column during rollout; an opaque ID prefix advertises support. + return f"{CAPTURED_CONFLICT_PROVENANCE_MARKER}{_this_process()[1]}" def _host() -> str: diff --git a/server/memory/app/conflicts_ops.py b/server/memory/app/conflicts_ops.py index e8b4dc039b8..e221f916f91 100644 --- a/server/memory/app/conflicts_ops.py +++ b/server/memory/app/conflicts_ops.py @@ -308,6 +308,7 @@ async def handle_conflicts_resolve( input: ConflictsResolveInput, *, expected_sha256: dict[str, str] | None = None, + write_fence_locked: set[str] | None = None, ) -> ConflictsResolveOutput: """Three decision paths: @@ -347,6 +348,13 @@ async def handle_conflicts_resolve( # resolve keeps live change only their status, as on memory.verify: no event. ns = input.namespace if input.decision == "revise": + + def skip_locked(row: Any) -> bool: + locked = expected_sha256 is not None and _bulk_loser_is_locked(row, input.memory_id) + if locked and write_fence_locked is not None: + write_fence_locked.add(str(row.memory_id)) + return locked + tombstoned = await conflicts_repo.tombstone_ids( input.org, peers, @@ -354,13 +362,7 @@ async def handle_conflicts_resolve( now, namespace=ns, expected_sha256=expected_sha256, - skip=( - lambda row: ( - _bulk_loser_is_locked(row, input.memory_id) - if expected_sha256 is not None - else None - ) - ), + skip=skip_locked if expected_sha256 is not None else None, ) expected_peers = set(expected_sha256 or {}) & set(peers) if expected_sha256 is not None and len(tombstoned) != len(expected_peers): @@ -577,7 +579,8 @@ async def _resolve_current_bulk_pair( return _bulk_accept_result(item, "failed", "An Undo or erasure protects this pair") if await resolver_queue.under_erasure(input.org): return _bulk_accept_result(item, "failed", "An Undo or erasure protects this pair") - return await handle_conflicts_resolve( + write_fence_locked: set[str] = set() + resolved = await handle_conflicts_resolve( ConflictsResolveInput( org=input.org, namespace=input.namespace, @@ -591,7 +594,15 @@ async def _resolve_current_bulk_pair( item.memory_id: item.memory_sha256, item.peer_id: item.peer_sha256, }, + write_fence_locked=write_fence_locked, ) + if write_fence_locked: + return _bulk_accept_result( + item, + "failed", + "A memory lock protects this pair from bulk acceptance", + ) + return resolved async def _bulk_memory_pair( diff --git a/server/memory/app/provenance.py b/server/memory/app/provenance.py index 9ec22bca904..9c189d1ae9c 100644 --- a/server/memory/app/provenance.py +++ b/server/memory/app/provenance.py @@ -39,7 +39,7 @@ def capture_origin() -> str: async def capture_origin_for_write() -> str: - """Enable captured-row provenance only after a fresh read sees no N-1 replica.""" + """Enable captured-row provenance only after each live replica reports support.""" from server.core import instances from server.core.ch import get_client from server.settings import settings @@ -50,7 +50,12 @@ async def capture_origin_for_write() -> str: except Exception as e: # noqa: BLE001 — unknown replica versions disable capture provenance log.warning("captured memory provenance disabled: replica versions unavailable: %s", e) return "" - if not live or any(int(row.get("schema_version") or 0) < 125 for row in live): + if not live or any( + not str(row.get("instance_id") or "").startswith( + instances.CAPTURED_CONFLICT_PROVENANCE_MARKER + ) + for row in live + ): return "" return capture_origin() diff --git a/tests/integration/test_conflict_resolver_ch.py b/tests/integration/test_conflict_resolver_ch.py index 4e0c3ce8c05..af32b40045d 100644 --- a/tests/integration/test_conflict_resolver_ch.py +++ b/tests/integration/test_conflict_resolver_ch.py @@ -715,11 +715,14 @@ async def test_bulk_accept_uses_current_resolver_audit_and_is_retry_safe(ch: Any assert int(audit_rows[0]["n"]) == 1 -@pytest.mark.parametrize(("schema_version", "expected_origin"), [(124, ""), (125, "claude-code")]) +@pytest.mark.parametrize( + ("instance_ids", "expected_origin"), + [(["legacy"], ""), (["ccp1-current"], "claude-code"), (["ccp1-current", "legacy"], "")], +) async def test_signed_capture_origin_reaches_conflicts_list_and_backlog( ch: Any, monkeypatch: pytest.MonkeyPatch, - schema_version: int, + instance_ids: list[str], expected_origin: str, ) -> None: import server.memory.store as memory_repo @@ -735,8 +738,8 @@ async def test_signed_capture_origin_reaches_conflicts_list_and_backlog( from server.memory.store.conflicts import count_conflict_backlog from server.settings import settings - async def current_replicas(_ch: Any) -> list[dict[str, int]]: - return [{"schema_version": schema_version}] + async def current_replicas(_ch: Any) -> list[dict[str, Any]]: + return [{"schema_version": 128, "instance_id": instance_id} for instance_id in instance_ids] monkeypatch.setattr(instances, "read_live", current_replicas) monkeypatch.setattr(settings, "deployment", "resolver-rollout-test") @@ -902,7 +905,8 @@ async def test_bulk_accept_respects_loser_delete_lock_at_write_fence( loser = await memory_repo.get_by_id( old["id"], org=org, namespace=NS, scope=WHOLE_NAMESPACE, fresh=True, strong=True ) - assert accepted.results[0].status == "stale" + assert accepted.results[0].status == "failed" + assert accepted.results[0].reason == "A memory lock protects this pair from bulk acceptance" assert loser is not None and loser.tombstoned_at is None assert loser.lock_mode == lock_mode diff --git a/tests/unit/test_cell.py b/tests/unit/test_cell.py index 8cf86f17a11..29dcde969ea 100644 --- a/tests/unit/test_cell.py +++ b/tests/unit/test_cell.py @@ -338,6 +338,7 @@ def test_the_heartbeat_reports_the_cell_and_a_gated_process_is_not_serving( _cell_settings(monkeypatch) _view(monkeypatch) assert instances.row()["serving"] == 0 + assert instances.row()["instance_id"].startswith(instances.CAPTURED_CONFLICT_PROVENANCE_MARKER) _serving_view(monkeypatch) assert instances.row()["serving"] == 1 reported = instances.cell_row() diff --git a/tests/unit/test_conflicts_bulk_accept.py b/tests/unit/test_conflicts_bulk_accept.py index 9ea30e268f5..e5f332965bc 100644 --- a/tests/unit/test_conflicts_bulk_accept.py +++ b/tests/unit/test_conflicts_bulk_accept.py @@ -218,8 +218,12 @@ async def no_lease(*_key: str) -> AsyncIterator[None]: called: list[tuple[ConflictsResolveInput, dict[str, str] | None]] = [] async def resolve( - inp: ConflictsResolveInput, *, expected_sha256: dict[str, str] | None = None + inp: ConflictsResolveInput, + *, + expected_sha256: dict[str, str] | None = None, + write_fence_locked: set[str] | None = None, ) -> ConflictsResolveOutput: + assert write_fence_locked == set() called.append((inp, expected_sha256)) return ConflictsResolveOutput( resolved=True, decision="revise", affected_memory_ids=[inp.peer_id or ""] diff --git a/tests/unit/test_provenance.py b/tests/unit/test_provenance.py index d2cf52cc3b7..f939b18c947 100644 --- a/tests/unit/test_provenance.py +++ b/tests/unit/test_provenance.py @@ -78,9 +78,12 @@ def test_capture_origin_is_signed_and_first_write_ignores_body_value( @pytest.mark.asyncio -@pytest.mark.parametrize(("schema_version", "expected"), [(124, ""), (125, "claude-code")]) -async def test_capture_origin_waits_until_every_live_replica_understands_it( - monkeypatch: pytest.MonkeyPatch, schema_version: int, expected: str +@pytest.mark.parametrize( + ("instance_ids", "expected"), + [(["legacy"], ""), (["ccp1-current"], "claude-code"), (["ccp1-current", "legacy"], "")], +) +async def test_capture_origin_waits_until_every_live_replica_reports_support( + monkeypatch: pytest.MonkeyPatch, instance_ids: list[str], expected: str ) -> None: from server.core import instances from server.memory.app.provenance import capture_origin_for_write @@ -90,13 +93,19 @@ async def test_capture_origin_waits_until_every_live_replica_understands_it( monkeypatch.setattr(settings, "deployment", "rolling-test") async def live_rows(_ch): - return [{"schema_version": schema_version}] + return [{"instance_id": instance_id, "schema_version": 128} for instance_id in instance_ids] monkeypatch.setattr(instances, "read_live", live_rows) assert await capture_origin_for_write() == expected set_current_auth(None) +def test_instance_id_advertises_capture_provenance_capability() -> None: + from server.core.instances import CAPTURED_CONFLICT_PROVENANCE_MARKER, instance_id + + assert instance_id().startswith(CAPTURED_CONFLICT_PROVENANCE_MARKER) + + def test_memory_version_builder_carries_capture_origin() -> None: from datetime import datetime From 07ca202e8edc21de6c02ac99c09f625a34ce0dd0 Mon Sep 17 00:00:00 2001 From: Project Manager Date: Sun, 6 Dec 2026 11:41:35 +0545 Subject: [PATCH 09/11] Pause captured writes during resolver rollout An older resolver treats rows without a capture claim under its general policy. Return a retryable backend-unavailable response before writing a signed capture request until every live instance advertises resolver support. Signed-off-by: Project Manager --- server/memory/app/provenance.py | 20 ++++++++++++++----- .../integration/test_conflict_resolver_ch.py | 7 +++++++ tests/unit/test_provenance.py | 19 +++++++++++++----- 3 files changed, 36 insertions(+), 10 deletions(-) diff --git a/server/memory/app/provenance.py b/server/memory/app/provenance.py index 9c189d1ae9c..ac065bafe4d 100644 --- a/server/memory/app/provenance.py +++ b/server/memory/app/provenance.py @@ -39,25 +39,35 @@ def capture_origin() -> str: async def capture_origin_for_write() -> str: - """Enable captured-row provenance only after each live replica reports support.""" + """Refuse captured writes until each live replica's resolver reports support.""" from server.core import instances from server.core.ch import get_client + from server.core.errors import BackendUnavailableError from server.settings import settings + origin = capture_origin() + if not origin: + return "" if settings.deployment: try: live = await instances.read_live(get_client()) - except Exception as e: # noqa: BLE001 — unknown replica versions disable capture provenance + except Exception as e: # unknown ClickHouse state must refuse captured writes log.warning("captured memory provenance disabled: replica versions unavailable: %s", e) - return "" + raise BackendUnavailableError( + "captured memory writes are paused until resolver support is known; retry", + retry_after_s=5, + ) from e if not live or any( not str(row.get("instance_id") or "").startswith( instances.CAPTURED_CONFLICT_PROVENANCE_MARKER ) for row in live ): - return "" - return capture_origin() + raise BackendUnavailableError( + "captured memory writes are paused while an unsupported resolver is live; retry", + retry_after_s=5, + ) + return origin def revision_capture_origin( diff --git a/tests/integration/test_conflict_resolver_ch.py b/tests/integration/test_conflict_resolver_ch.py index af32b40045d..d01c6237348 100644 --- a/tests/integration/test_conflict_resolver_ch.py +++ b/tests/integration/test_conflict_resolver_ch.py @@ -730,11 +730,13 @@ async def test_signed_capture_origin_reaches_conflicts_list_and_backlog( from server.auth.context import set_current_auth from server.auth.jwt import mint_token, verify_token from server.core import instances + from server.core.errors import BackendUnavailableError from server.identity.domain.read_scope import WHOLE_NAMESPACE from server.insights.store.mentor import ProfileReads from server.memory.api.models_conflicts import ConflictsListInput from server.memory.app.conflicts import mark_peers_conflicted from server.memory.app.conflicts_ops import handle_conflicts_list + from server.memory.app.provenance import capture_origin_for_write from server.memory.store.conflicts import count_conflict_backlog from server.settings import settings @@ -756,6 +758,11 @@ async def current_replicas(_ch: Any) -> list[dict[str, Any]]: await revocation.refresh() set_current_auth(verify_token(token, secret=settings.jwt_secret)) try: + if not expected_origin: + with pytest.raises(BackendUnavailableError): + await capture_origin_for_write() + assert await _rows(ch, org) == {} + return await _pair(ch, org, "captured_old", "captured_new", 152, gap=False) rows = await _rows(ch, org) old, new = rows["captured_old"], rows["captured_new"] diff --git a/tests/unit/test_provenance.py b/tests/unit/test_provenance.py index f939b18c947..bd8bc2fc02c 100644 --- a/tests/unit/test_provenance.py +++ b/tests/unit/test_provenance.py @@ -79,13 +79,14 @@ def test_capture_origin_is_signed_and_first_write_ignores_body_value( @pytest.mark.asyncio @pytest.mark.parametrize( - ("instance_ids", "expected"), - [(["legacy"], ""), (["ccp1-current"], "claude-code"), (["ccp1-current", "legacy"], "")], + ("instance_ids", "blocked"), + [(["legacy"], True), (["ccp1-current"], False), (["ccp1-current", "legacy"], True)], ) async def test_capture_origin_waits_until_every_live_replica_reports_support( - monkeypatch: pytest.MonkeyPatch, instance_ids: list[str], expected: str + monkeypatch: pytest.MonkeyPatch, instance_ids: list[str], blocked: bool ) -> None: from server.core import instances + from server.core.errors import BackendUnavailableError from server.memory.app.provenance import capture_origin_for_write from server.settings import settings @@ -96,8 +97,16 @@ async def live_rows(_ch): return [{"instance_id": instance_id, "schema_version": 128} for instance_id in instance_ids] monkeypatch.setattr(instances, "read_live", live_rows) - assert await capture_origin_for_write() == expected - set_current_auth(None) + try: + if blocked: + with pytest.raises(BackendUnavailableError) as exc: + await capture_origin_for_write() + assert exc.value.status_code == 503 + assert exc.value.extra["retry_after_s"] == 5 + else: + assert await capture_origin_for_write() == "claude-code" + finally: + set_current_auth(None) def test_instance_id_advertises_capture_provenance_capability() -> None: From 8fa886c347330113b021ae785ba188248ec8dde2 Mon Sep 17 00:00:00 2001 From: Project Manager Date: Sun, 6 Dec 2026 12:40:38 +0545 Subject: [PATCH 10/11] Document Codex review notice hook boundary Signed-off-by: Project Manager --- integrations/claude-code-plugin/.claude-plugin/plugin.json | 2 +- integrations/codex-plugin/.codex-plugin/plugin.json | 2 +- integrations/codex-plugin/hooks/hooks.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integrations/claude-code-plugin/.claude-plugin/plugin.json b/integrations/claude-code-plugin/.claude-plugin/plugin.json index ef26da16a07..3713cd5752c 100644 --- a/integrations/claude-code-plugin/.claude-plugin/plugin.json +++ b/integrations/claude-code-plugin/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "loom", "displayName": "ClickHouse Loom", - "version": "1.2.189", + "version": "1.2.190", "description": "Shared long-term memory and code intelligence for Claude Code, self-hosted on ClickHouse. MCP tools to save and recall decisions, preferences and corrections across sessions and teammates; lifecycle hooks that capture each session with no model call; a code index that answers where-is, who-calls and blast-radius questions with line-accurate units instead of whole-file reads.", "author": { "name": "ClickHouse" diff --git a/integrations/codex-plugin/.codex-plugin/plugin.json b/integrations/codex-plugin/.codex-plugin/plugin.json index c361cc263db..d12cda0ad62 100644 --- a/integrations/codex-plugin/.codex-plugin/plugin.json +++ b/integrations/codex-plugin/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "loom", - "version": "1.2.189", + "version": "1.2.190", "description": "Shared long-term memory and code intelligence for Codex, self-hosted on ClickHouse. MCP tools to save and recall decisions, preferences and corrections across sessions and teammates; lifecycle hooks that capture each session with no model call; a code index that answers where-is, who-calls and blast-radius questions with line-accurate units instead of whole-file reads.", "author": { "name": "ClickHouse" diff --git a/integrations/codex-plugin/hooks/hooks.json b/integrations/codex-plugin/hooks/hooks.json index 623504ba5d1..9c68e5ad5c5 100644 --- a/integrations/codex-plugin/hooks/hooks.json +++ b/integrations/codex-plugin/hooks/hooks.json @@ -1,5 +1,5 @@ { - "description": "Loom ambient-capture hooks for Codex. The scripts under hooks/ and lib/ are byte-identical to the Claude Code plugin's (checked by `python scripts/codegen/agent_plugin_sync.py --check`); only this wiring differs. Each command names the client as the script's third argument (`codex`), which sets the default agent label, the run-id prefix (cx-), the `source:codex` tag and the consumer label. What differs from the Claude Code wiring, and why: - Codex has no Read or Grep tool: it reads files and searches through its shell tool, whose input may be an argv array. loom-code-shunt watches the shell tool only (its `cat` / `rg` / `grep` branch); the whole-file-Read branch has nothing to match. After a shell call loom-file-context looks up the files the command read. - Codex edits files with apply_patch: loom-file-context and loom-blast-radius read the target path out of the patch text. - Codex may hand the hooks no transcript (`transcript_path` null) or one in its own shape. loom-run journals every prompt (UserPromptSubmit), and loom-conversation journals every reply from `last_assistant_message` (Stop); the working-memory note, the run's final text, the conversation plane and the session memory read that journal. loom-usage needs the per-turn token counters only a Claude Code transcript carries, so it is not wired here. - Codex's SessionEnd hook budget is one second: only the fire-and-forget scripts (capture, run close, session memory hand-off) run there; the conversation hook does its work at Stop. - loom-record, which runs an event's recording scripts in one process (a detached one at a prompt, after a tool call, at Stop and at SessionEnd) and the scripts whose answer the host waits for in the hook, is not wired here: it has been measured under Claude Code only, so Codex still starts each script as a hook of its own, and loom-namespace-health asks its audit at the first Stop. - loom-test-report reads the result file pytest writes through the option the SessionStart hook adds to the file Claude Code names for the session's shell (CLAUDE_ENV_FILE). Codex names no such file, so no option is added and no result file exists: the script is not wired here. Each command runs its script through bin/loom-node, which finds Node 18+ when the PATH Codex hands the hook has none; Codex runs a hook through cmd.exe on Windows, where `commandWindows` calls `node` from the system PATH. Identity (org/namespace) is derived from the token — drop a writer JWT in ~/.loom/token or ~/.loom/config.json, or set LOOM_API_KEY. The server is ~/.loom/config.json's url, else the plugin's plugin-defaults.json; LOOM_BASE_URL overrides both. Every knob the Claude Code README lists (LOOM_INJECT_CONTEXT, LOOM_CODE_SHUNT, LOOM_TEST_GATE, …) works here; the test gate holds a stop only with LOOM_TEST_GATE=stop or block.", + "description": "Loom ambient-capture hooks for Codex. The scripts under hooks/ and lib/ are byte-identical to the Claude Code plugin's (checked by `python scripts/codegen/agent_plugin_sync.py --check`); only this wiring differs. Each command names the client as the script's third argument (`codex`), which sets the default agent label, the run-id prefix (cx-), the `source:codex` tag and the consumer label. What differs from the Claude Code wiring, and why: - Codex has no Read or Grep tool: it reads files and searches through its shell tool, whose input may be an argv array. loom-code-shunt watches the shell tool only (its `cat` / `rg` / `grep` branch); the whole-file-Read branch has nothing to match. After a shell call loom-file-context looks up the files the command read. - Codex edits files with apply_patch: loom-file-context and loom-blast-radius read the target path out of the patch text. - Codex may hand the hooks no transcript (`transcript_path` null) or one in its own shape. loom-run journals every prompt (UserPromptSubmit), and loom-conversation journals every reply from `last_assistant_message` (Stop); the working-memory note, the run's final text, the conversation plane and the session memory read that journal. loom-usage needs the per-turn token counters only a Claude Code transcript carries, so it is not wired here. loom-review-notice uses the Claude Code-specific user-visible systemMessage output, so it is not wired here. - Codex's SessionEnd hook budget is one second: only the fire-and-forget scripts (capture, run close, session memory hand-off) run there; the conversation hook does its work at Stop. - loom-record, which runs an event's recording scripts in one process (a detached one at a prompt, after a tool call, at Stop and at SessionEnd) and the scripts whose answer the host waits for in the hook, is not wired here: it has been measured under Claude Code only, so Codex still starts each script as a hook of its own, and loom-namespace-health asks its audit at the first Stop. - loom-test-report reads the result file pytest writes through the option the SessionStart hook adds to the file Claude Code names for the session's shell (CLAUDE_ENV_FILE). Codex names no such file, so no option is added and no result file exists: the script is not wired here. Each command runs its script through bin/loom-node, which finds Node 18+ when the PATH Codex hands the hook has none; Codex runs a hook through cmd.exe on Windows, where `commandWindows` calls `node` from the system PATH. Identity (org/namespace) is derived from the token — drop a writer JWT in ~/.loom/token or ~/.loom/config.json, or set LOOM_API_KEY. The server is ~/.loom/config.json's url, else the plugin's plugin-defaults.json; LOOM_BASE_URL overrides both. Every knob the Claude Code README lists (LOOM_INJECT_CONTEXT, LOOM_CODE_SHUNT, LOOM_TEST_GATE, …) works here; the test gate holds a stop only with LOOM_TEST_GATE=stop or block.", "hooks": { "SessionStart": [ { From 2dbd79abe330ad2028e1704bb0914339a7dc394e Mon Sep 17 00:00:00 2001 From: Project Manager Date: Sun, 6 Dec 2026 12:48:19 +0545 Subject: [PATCH 11/11] Gate snapshot restores on resolver support Signed-off-by: Project Manager --- server/identity/app/namespace_snapshot.py | 4 +- server/memory/app/provenance.py | 14 ++-- .../test_namespace_restore_existing_target.py | 70 +++++++++++++++++++ 3 files changed, 82 insertions(+), 6 deletions(-) diff --git a/server/identity/app/namespace_snapshot.py b/server/identity/app/namespace_snapshot.py index d391b044aef..1bb28826c99 100644 --- a/server/identity/app/namespace_snapshot.py +++ b/server/identity/app/namespace_snapshot.py @@ -29,7 +29,7 @@ from server.identity.store import namespaces as namespaces_repo from server.memory.app import blacklist_guard from server.memory.app import snapshot_rows as memory_snapshot -from server.memory.app.provenance import writer_actor +from server.memory.app.provenance import require_capture_resolver_support, writer_actor from server.observability import audit @@ -204,6 +204,8 @@ async def _restore_payload( memories, erased = await memory_snapshot.without_erased( input.org, input.target_namespace, memories ) + if any(memory.capture_origin for memory in memories): + await require_capture_resolver_support() rows = memory_snapshot.checked_rows( memory_snapshot.restore_rows( memories, diff --git a/server/memory/app/provenance.py b/server/memory/app/provenance.py index ac065bafe4d..f01e78df3fb 100644 --- a/server/memory/app/provenance.py +++ b/server/memory/app/provenance.py @@ -38,16 +38,13 @@ def capture_origin() -> str: return origin if origin in {"claude-code", "codex"} else "" -async def capture_origin_for_write() -> str: - """Refuse captured writes until each live replica's resolver reports support.""" +async def require_capture_resolver_support() -> None: + """Refuse captured memory writes until every live resolver reports support.""" from server.core import instances from server.core.ch import get_client from server.core.errors import BackendUnavailableError from server.settings import settings - origin = capture_origin() - if not origin: - return "" if settings.deployment: try: live = await instances.read_live(get_client()) @@ -67,6 +64,13 @@ async def capture_origin_for_write() -> str: "captured memory writes are paused while an unsupported resolver is live; retry", retry_after_s=5, ) + + +async def capture_origin_for_write() -> str: + """Return signed provenance only when each live replica's resolver reports support.""" + origin = capture_origin() + if origin: + await require_capture_resolver_support() return origin diff --git a/tests/unit/test_namespace_restore_existing_target.py b/tests/unit/test_namespace_restore_existing_target.py index 01a0e464162..eacdfd25663 100644 --- a/tests/unit/test_namespace_restore_existing_target.py +++ b/tests/unit/test_namespace_restore_existing_target.py @@ -550,3 +550,73 @@ async def _record(*_a: Any, subject: dict[str, Any], **_k: Any) -> str: assert out.restored is True and out.publication_pending is True counts = {"memories": 1, "types": 0, "grants": 0, "erased_skipped": 0} assert order == ["memories:1", f"audit:{counts}"] + + +@pytest.mark.asyncio +async def test_restore_of_authenticated_capture_waits_for_every_resolver(wire, monkeypatch) -> None: + """A restore must not introduce a captured row while a legacy resolver is live.""" + from server.core import ch as core_ch + from server.core import instances + from server.core.errors import BackendUnavailableError + from server.core.hashing import sha256_value + from server.identity.api.models import _SnapshotMemoryRow + from server.settings import settings + + install, grants = wire + grants[(ORG, NS, "owner@x")] = Role.ADMIN + ch = install(_deleted_row(active=True), "owner@x", Role.ADMIN) + monkeypatch.setattr(settings, "deployment", "rolling-test") + monkeypatch.setattr(core_ch, "get_client", lambda: ch) + + async def live_rows(_ch: Any) -> list[dict[str, Any]]: + return [{"instance_id": "legacy-resolver", "schema_version": 128}] + + monkeypatch.setattr(instances, "read_live", live_rows) + memory_id = "33333333-3333-3333-3333-333333333333" + value = '"captured"' + value_json = "{}" + content_sha256 = "ab" * 32 + origin_record = { + memory_id: { + "origin": "codex", + "row_hash": sha256_value( + { + "content_sha256": content_sha256, + "value": value, + "value_json": value_json, + } + ), + } + } + query_one = ch.query_one + + async def snapshot_lookup(sql: str, params: Any = None, **kwargs: Any) -> Any: + if "FROM loom.namespace_snapshots" in sql: + return {"captured_origin_map": json.dumps(origin_record)} + return await query_one(sql, params, **kwargs) + + ch.query_one = snapshot_lookup # type: ignore[method-assign] + inp = _restore_input() + memory = _SnapshotMemoryRow( + memory_id=memory_id, + agent="agent", + user_id="-", + session_id="-", + run_id="-", + memory_key="captured", + memory_type="semantic", + value=value, + value_json=value_json, + content_sha256=content_sha256, + confidence=1.0, + source_trace="", + pinned=False, + ) + payload = inp.payload.model_copy(update={"memories": [memory], "memory_count": 1}) + + with pytest.raises(BackendUnavailableError, match="unsupported resolver"): + await namespace_snapshot.handle_namespace_restore( + inp.model_copy(update={"payload": payload}) + ) + + assert ch.inserts == []