From 496bb77a846847a38da77ce0cebf70d91bac8ecf Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Sat, 28 Nov 2026 16:34:28 +0530 Subject: [PATCH 1/6] The test gate touches only the edited definitions and labels every test with its evidence code.test_gate picked its seeds from hunk-header names and new-side hunk spans, read no classes, and listed a touched definition as `untested` whenever the static graph held no test edge to it. Against SWE-bench Verified gold patches and per-test coverage that list flagged tested and untested code alike. - The touched definitions are the innermost function or class holding a changed old-side line (the revision the index holds). A hunk sent without its lines changes what its header's old range says, so the hooks' zero-context headers read the same. A header name is used only for a definition the index holds no body extent for. code.impact's diff shape shares the rule. - A class's callers credit its `__init__` and `__new__`, and the callers of a function credit the functions nested in it. - Each test row says its kind of evidence in `why`: `changed_test`, `coverage`, `static_call`, `file_neighbor` (new: the test files calling other definitions of the edited files, one grouped read), `test_map`. `graph_hop` and `stem_partner` are gone. - `untested` holds only definitions a verified coverage run measured unexecuted. `unlinked` holds the ones no run measured and no call chain links a test to; a file-level row never clears it, and it is no obligation. - `epistemic` is `measured` or `lower_bound`, never `exact`. - The plugins say "the index links no test to" for `unlinked`, "measured unexecuted at " for `untested`, ask for a test only for the latter, and ask for file neighbours only up to four tests in all. Signed-off-by: Lareb Zafar Co-Authored-By: Claude Fable 5.2 --- docs/features/code-index/operations.md | 41 +- docs/reference/operations.md | 2 +- docs/reference/operations/code.md | 29 +- .../.claude-plugin/plugin.json | 2 +- integrations/claude-code-plugin/README.md | 58 +- .../claude-code-plugin/hooks/HOOKS.md | 13 +- .../hooks/loom-test-gate.mjs | 2 +- .../claude-code-plugin/lib/test-gate.mjs | 130 +- .../skills/loom-code/reference.md | 2 +- .../tests/test-gate.test.mjs | 111 +- .../codex-plugin/.codex-plugin/plugin.json | 2 +- .../codex-plugin/hooks/loom-test-gate.mjs | 2 +- integrations/codex-plugin/lib/test-gate.mjs | 130 +- .../skills/loom-code/reference.md | 2 +- sdk/python/loom/code.py | 6 +- sdk/python/loom/ops.py | 7 +- sdk/ruby/lib/clickhouse/loom/generated/ops.rb | 2 +- sdk/rust/src/wire_models.rs | 6975 +++++++++-------- sdk/rust/tests/registry_contracts.rs | 15 + sdk/typescript/src/generated/ops.ts | 3 + server/cli/code_maintenance.py | 2 +- server/code/api/models_symbol.py | 10 +- server/code/api/models_testing.py | 88 +- server/code/app/coverage_freshness.py | 39 + server/code/app/symbol/diff.py | 233 +- server/code/app/symbol/gate.py | 120 +- server/code/app/symbol/impact.py | 29 +- server/code/app/symbol/test_links.py | 183 + server/code/domain/index/epistemic.py | 6 + server/code/domain/index/test_gate.py | 227 +- server/code/store/index/edges.py | 40 +- server/transport/mcp_descriptions.py | 26 +- tests/analyzer/cases/code.py | 2 + tests/analyzer/shapes.txt | 1 + tests/unit/test_code_epistemic_envelope.py | 10 +- tests/unit/test_code_impact_dispatch.py | 21 +- tests/unit/test_code_test_gate.py | 367 +- tests/unit/test_code_trace_and_diff_impact.py | 113 +- tests/unit/test_hook_diff_headers.py | 9 +- 39 files changed, 5026 insertions(+), 4034 deletions(-) create mode 100644 server/code/app/symbol/test_links.py diff --git a/docs/features/code-index/operations.md b/docs/features/code-index/operations.md index 4a483079b52..e0e8b782f99 100644 --- a/docs/features/code-index/operations.md +++ b/docs/features/code-index/operations.md @@ -403,7 +403,7 @@ exists. These call shapes are not captured output from a document/code qualifica | `code.callers` | who calls this, `depth` hops; an override also reports the base declaration's callers | | `code.callees` | what this calls, `depth` hops | | `code.impact` | blast radius of a symbol, or of `files` / a `diff`: callers, tests reaching the change, co-change partners | -| `code.test_gate` | which tests a change obliges, and which touched functions no test reaches | +| `code.test_gate` | which tests a change obliges, which touched definitions a coverage run measured unexecuted, and which the index links no test to | | `code.tests_for` | which tests cover something | | `code.test_home` | where a new test belongs | | `code.coverage_claim` | "is this already tested?" | @@ -436,7 +436,7 @@ for row in r.get("co_change_missing", []): print("usually changes with this diff:", row) ``` -The diff shape returns the symbols the hunks overlap, the tests that reach them, and +The diff shape returns the functions the changed lines sit in, the tests that reach them, and `co_change_missing`; `files` alone treats every function in those files as changed. Both shapes return `owners`: recency-weighted PR authors over the seed paths, with `exclude_authors` (normally the change's own author) removed. The index holds merged @@ -459,6 +459,43 @@ Report the indexed revision, the callers and tests found, the contract checks performed, and any consumers outside the available scope. A caller list identifies where to investigate; it does not establish that an API remains compatible. +### Find the tests a change obliges + +`code.test_gate` takes `files` and/or a `diff` against the revision the index holds: the +working tree against `HEAD`, a pull request against its merge base. Each changed line +touches the innermost function or class it sits in, so a diff with three lines of context +touches only the definitions it edits. A line outside every definition touches nothing +and adds `unmapped_changes` to `causes`. + +Each row of `tests` is one test file with the kind of evidence in `why`, strongest first: + +| `why` | The test file | Says about a touched definition | +| --------------- | ----------------------------------------------------------------------------- | ------------------------------------------- | +| `changed_test` | is in the diff | nothing; a changed test runs | +| `coverage` | executed it in an imported coverage run the index verified | it ran (`links_to`) | +| `static_call` | holds a test a call chain links to it (`hop`, `callers`, `confidence`, `via`) | a test reaches it (`links_to`) | +| `file_neighbor` | calls `callees` other definitions of the edited files | nothing; it is the nearest test of the file | +| `test_map` | is tied to the file by mined history | nothing | + +A `static_call` row carries `via` when the chain does not start at the definition itself: +`constructor` (the test calls the class of a touched `__init__` or `__new__`), `enclosing` +(it calls the function a touched nested function is defined in) or `fixture` (it reaches +through a fixture). Within a kind the nearest hop is first, then the file linked to more +of the touched definitions, then the one with more tests doing so. + +The touched definitions land in two lists with different meanings: + +- `untested` holds the definitions an imported coverage run measured unexecuted, with the + run's `commit`. It is empty unless such a run exists at a revision the index verified. +- `unlinked` holds the definitions no coverage run measured and no call chain links a test + to. It does not say that no test runs them: tests reach code through fixtures, + string-dispatched entry points and public APIs the call graph holds no edge for. A + `file_neighbor` or `test_map` row never takes a definition off this list. + +`obligations` is true while `tests` or `untested` is non-empty. `epistemic` is `measured` +when a verified coverage run settled every touched definition and every changed line sat +in one, and `lower_bound` otherwise; the op never answers `exact`. + ## History, PRs and releases These read the PR plane that the `code_pr_history` worker fills from GitHub diff --git a/docs/reference/operations.md b/docs/reference/operations.md index 47ec5b8deb5..5553701196a 100644 --- a/docs/reference/operations.md +++ b/docs/reference/operations.md @@ -234,7 +234,7 @@ Fields for every `code` op: [operations/code.md](operations/code.md). | [`code.setting_facts`](operations/code.md#codesetting_facts) | One ClickHouse setting, the four places that define it: its declaration and tier (production / important / beta / experimental / obsolete), every default change with the release it shipped in… | viewer | read | no | | | [`code.symbol`](operations/code.md#codesymbol) | Find an exact definition by name or path:line. | viewer | read | yes | | | [`code.symbol_history`](operations/code.md#codesymbol_history) | The regression history of one function: the merged PRs that touched it (with linked issues, reverts, inline review comments inside its span), and — through the tracker namespace bound to this code… | viewer | read | no | | -| [`code.test_gate`](operations/code.md#codetest_gate) | The pre-PR question in one call: for THIS change, which tests must run, and which touched code no test reaches. | viewer | read | no | | +| [`code.test_gate`](operations/code.md#codetest_gate) | The pre-PR question in one call: for THIS change, which tests must run, and which touched definitions no test is shown to run. | viewer | read | no | | | [`code.test_home`](operations/code.md#codetest_home) | Where does a new test case belong? | viewer | read | no | | | [`code.tests_for`](operations/code.md#codetests_for) | Which stateless tests carry EVERY named facet: the tests that `SET` a setting, call a function, create an `ENGINE`, read a `system.*` table, use a `FORMAT`, carry a `-- Tags:` tag, or expect an error… | viewer | read | no | | | [`code.trace`](operations/code.md#codetrace) | Paste a stack trace / backtrace; get each frame resolved to its definition in one call — the incident-workflow entry point. | viewer | read | yes | | diff --git a/docs/reference/operations/code.md b/docs/reference/operations/code.md index f2c2338c8a2..b31dcd6ca77 100644 --- a/docs/reference/operations/code.md +++ b/docs/reference/operations/code.md @@ -873,8 +873,8 @@ Symbol-shaped (name/symbol_id) or diff-shaped (files/diff) blast radius. | `name` | `str` | `''` | Symbol shape: the seed's bare, qualified or partly qualified name, or `path:line`. | | `symbol_id` | `str` | `''` | Symbol shape: an index symbol id for the seed; wins over `name`. | | `depth` | `int` | `2` | How many caller hops the radius walks from the seeds (1–2). | -| `files` | `list[str]` | *(computed)* | Diff shape: repo-relative changed paths, and/or a unified diff whose hunk line ranges narrow the touched set from whole files to the symbols actually edited. | -| `diff` | `str` | `''` | A unified diff (at most 200,000 chars); its hunk ranges pick the edited functions as seeds. | +| `files` | `list[str]` | *(computed)* | Diff shape: repo-relative changed paths, and/or a unified diff whose changed lines narrow the touched set from whole files to the symbols actually edited. | +| `diff` | `str` | `''` | A unified diff (at most 200,000 chars) against the revision the index holds; each changed line seeds the innermost function it sits in. | | `exclude_authors` | `list[str]` | *(computed)* | Left out of `owners`: the change's own author(s) are not its reviewers. | | `summary_only` | `bool` | `False` | Hub-safe ergonomics. | | `per_hop_limit` | `int` | `200` | At most this many `impacted_symbols` rows from each hop (1–500). | @@ -889,7 +889,7 @@ Symbol-shaped (name/symbol_id) or diff-shaped (files/diff) blast radius. | `impacted_tests` | `list[dict[str, Any]]` | Tests the test map ties to the seed and impacted paths: {test_path, src_path, confidence}. | | `co_change_files` | `list[dict[str, Any]]` | Files changed in the same merged PRs as the seed paths, most often first ({path, prs}, at most 20): the last 10 PRs for the symbol shape, 50 for the diff shape. | | `blast_radius_score` | `float` | impacted/50 + tests/40, capped at 1. | -| `touched_symbols` | `list[dict[str, Any]]` | Diff shape only: the symbols the change touches (hunk-overlap when a diff was given, else every function in the files), and the files that historically co-change with the touched set but are absent from it — the "did you forget to update… | +| `touched_symbols` | `list[dict[str, Any]]` | Diff shape only: the symbols the change touches (the functions its changed lines sit in when a diff was given, else every function in the files), and the files that historically co-change with the touched set but are absent from it — the… | | `co_change_missing` | `list[dict[str, Any]]` | Diff shape: co-change files absent from the change ({path, prs, of}, at most 5, support at least 4 PRs and 15%); empty for the symbol shape. | | `owners` | `list[dict[str, Any]]` | Who to ask: {author, share, prs, reviews, last_merged_at} from merged PRs over the seed paths — the PRs a person AUTHORED (`prs`) and the ones they REVIEWED (`reviews`, inline comments), recency-decayed (120-day half-life), share floor, at… | | `reverts` | `list[dict[str, Any]]` | Merged PRs over the seed paths that were REVERTS ({pr_number, title, merged_at}, newest first, <=5): the one kind of history that says what not to do, invisible to symbol lookups (the code is back) and to co-change (same files as the… | @@ -1720,7 +1720,7 @@ The regression history of one function: the merged PRs that touched it (with lin ## `code.test_gate` -The pre-PR question in one call: for THIS change, which tests must run, and which touched code no test reaches. +The pre-PR question in one call: for THIS change, which tests must run, and which touched definitions no test is shown to run. `POST /v1/code.test_gate` · MCP `loom_code_test_gate` · role `viewer` · read · not listed under the MCP `all` toolset @@ -1732,24 +1732,27 @@ The pre-PR question in one call: for THIS change, which tests must run, and whic | `user_id` | `str` | `'-'` | The end user the row belongs to; `'-'` for none. | | `consumer` | `str` | `''` | trace attribution: which integration is calling (clickgap\|claude-code\|…) | | `files` | `list[str]` | *(computed)* | Changed file paths; a test file here is itself a test to run. | -| `diff` | `str` | `''` | A unified diff; its hunks (line spans, hunk-header names) pick the touched functions. | +| `diff` | `str` | `''` | A unified diff against the revision the index holds (the working tree against HEAD, a pull request against its merge base). | | `depth` | `int` | `2` | Reverse-edge hops to look for tests through. | -| `limit` | `int` | `30` | At most this many rows in each of `tests` and `untested` (at most 200). | +| `limit` | `int` | `30` | At most this many rows in each of `tests`, `untested` and `unlinked` (at most 200). | | Output field | Type | Meaning | | --- | --- | --- | -| `tests` | `list[dict[str, Any]]` | {test_path, why, evidence, run, run_unknown, [src_path], [confidence], [hop]} why in {changed_test, stem_partner, test_map, graph_hop}, strongest first. | -| `untested` | `list[dict[str, Any]]` | Touched source symbols no test reaches by any evidence class: {qualified_name, path, start_line}. | +| `tests` | `list[dict[str, Any]]` | {test_path, why, evidence, run, run_unknown} per test file, strongest evidence first. | +| `untested` | `list[dict[str, Any]]` | Touched source definitions a coverage run measured unexecuted, at a commit the index verified: {qualified_name, path, start_line, commit}. | +| `unlinked` | `list[dict[str, Any]]` | Touched source definitions no coverage run measured and no call chain links a test to: {qualified_name, path, start_line}. | | `changed_files` | `list[str]` | The change as the gate saw it. | -| `touched_symbols` | `list[dict[str, Any]]` | The source symbols the change touches, {qualified_name, path, start_line, tier}, by path and line (first 200). | -| `obligations` | `bool` | True while either list is non-empty: run the tests, then rely on green; write a test for (or explain) the untested rows. | +| `touched_symbols` | `list[dict[str, Any]]` | The source definitions the change touches, {qualified_name, path, start_line, tier}, by path and line (first 200). | +| `obligations` | `bool` | True while `tests` or `untested` is non-empty: run the tests, then rely on green; write a test for (or explain) the untested rows. | | `tests_total` | `int` | Rows of `tests` before `limit`. | | `untested_total` | `int` | Rows of `untested` before `limit`. | +| `unlinked_total` | `int` | Rows of `unlinked` before `limit`. | | `tests_capped` | `bool` | True when `limit` cut `tests` short of `tests_total`. | | `untested_capped` | `bool` | True when `limit` cut `untested` short of `untested_total`. | -| `counts_floor` | `bool` | Same epistemic contract as code.callers: the graph is a floor, so "no test reaches this" means none the index can see. | -| `epistemic` | `str` | Epistemic envelope, as on code.callers: "exact" when the compiler tier covers every seed file, no call site named like a seed was declined, and no override seed lacks its base; otherwise "lower_bound" with `causes` from {unresolved_calls… | -| `causes` | `list[str]` | Why `epistemic` is lower_bound (values above); [] when it is exact. | +| `unlinked_capped` | `bool` | True when `limit` cut `unlinked` short of `unlinked_total`. | +| `counts_floor` | `bool` | Same epistemic contract as code.callers: the graph is a floor, so a test missing from `tests` is one the index cannot see. | +| `epistemic` | `str` | `measured` when a verified coverage run settled every touched definition and every changed line sat in one; otherwise `lower_bound` with `causes`. | +| `causes` | `list[str]` | Why `epistemic` is lower_bound, from code.callers' causes (unresolved_calls, ambiguous_calls, treesitter_only_files, external_calls, truncated: a hop read hit its row limit) and two of its own: `unmapped_changes` (a changed line of an… | | `by_hop_counts` | `dict[int, int]` | Distinct symbols reached per hop BEFORE any slicing: {1: n, 2: m}. | | `trace_run_id` | `str` | Id of this call's row in `loom.code_search_trace`. | diff --git a/integrations/claude-code-plugin/.claude-plugin/plugin.json b/integrations/claude-code-plugin/.claude-plugin/plugin.json index e04778b8382..6a73d761302 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.73", + "version": "1.2.75", "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/README.md b/integrations/claude-code-plugin/README.md index 9fc773ed8b8..83d5cba8476 100644 --- a/integrations/claude-code-plugin/README.md +++ b/integrations/claude-code-plugin/README.md @@ -185,41 +185,43 @@ the duplicate, run `claude mcp remove -s user`. ## What it wires -| Lifecycle event | Script | What it does | -| --------------------------------------------------------- | --------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `UserPromptSubmit` | `loom-record.mjs` | The prompt's one process. Runs the two lookups the prompt waits for (`loom-prompt-pack`, `loom-prompt-recall`) in the hook itself and prints what they found as one `additionalContext`; writes the run's begin to the session's run state and hands the prompt's recording scripts (`loom-run`, `loom-namespace-health`'s audit) to a detached process and exits, as after a tool call. | -| `PostToolUse`, `PostToolUseFailure`, `Stop`, `SessionEnd` | `loom-record.mjs` | Runs the event's recording scripts (`loom-capture`, `loom-conversation`, `loom-usage`, `loom-working-memory`, `loom-run`'s close, `loom-session-memory`, `loom-session-brief`) in one process. After a tool call and at `Stop` that process is detached and the hook exits, so the session does not wait for their requests. At `SessionEnd` it is the hook itself, which exits when they have returned: a host torn down when the client exits would end a detached process first. | -| `PostToolUse` | `loom-capture.mjs` | Records one episodic observation of the tool action (heuristic type, file list). | -| `PostToolUseFailure` | `loom-capture.mjs` | Same, typed `error` — the bug-triage signal (errors + the subsequent fix). | -| `SessionStart` | `loom-session-start.mjs` | **First session, no credential:** signs this machine up (see `LOOM_AUTO_SIGNUP`) and points the user to the claim page for the namespace; nothing to paste. Then: injects a token-budgeted context primer (profile + relevant memories) via `context.pack`, so the agent starts knowing your context. Beside it, one line names the checkout's code namespace and the repository's memory tag, or says why no index was looked up, so a session start that prints nothing is a fault unless `LOOM_CODE_MAP=false`. How to route a lookup is in the MCP entry's startup instructions on a toolset with a `coding` part; any other toolset, and a wiring whose entry the plugin does not mount (Codex, a hand-wired client), gets it in the primer. **On by default**, once per session; `LOOM_INJECT_CONTEXT=false` to disable. | -| `PreToolUse` (Edit / Write / MultiEdit / NotebookEdit) | `loom-file-context.mjs` | Asks `memory.for_file` what loom knows about the target file (its files facet) and injects the rendered block as additional context — a constraint arrives **before** the edit, not as a review comment. One lookup per (session, file) per 30 min; never a permission decision. `LOOM_FILE_CONTEXT=off` disables. | -| `PostToolUse` (loom tools) | `loom-mentor-hint.mjs` | **The store's advice reaches the model**: a loom tool result may carry one `hint` — the plane this agent is not using, named from the call it just made (a `memory.get` that missed, a search that abstained where the code index answers, a stack trace written as a memory, a duplicate write). The hook lifts it out of the result JSON into additional context, once per code per session. No request of its own. `LOOM_MENTOR_HINTS=off` disables. | -| `PostToolUse` (Edit / Write / MultiEdit) | `loom-blast-radius.mjs` | In a loom-indexed repo, diffs the edited file against HEAD and asks `code.impact` (depth 1) what the touched symbols reach. Injects **one line**: callers, tests reaching the change, and the co-change partner files this session has not touched — the sibling-file miss, surfaced while the edit is still open. Same touched set reported once per session. The first edit of a file in a session also carries the test gate's line (next row), which stands in for the radius's count of tests where it names the file's tests, so an edit gets one line. `LOOM_BLAST_RADIUS=off` disables the radius. | -| `PostToolUse` (Bash / PowerShell) | `loom-test-gate.mjs` | **The tests are named when the file changes.** After a shell command in a loom-indexed repo, asks `code.test_gate` about each file the command changed (a dirty path it names, written since the session began) and attaches **one line** per file with the command of the tests the index links to it, or of the file itself when it is a test: `Loom tests for src/a.py: .venv/bin/python -m pytest tests/test_a.py`. Once per file and once per test per session, on the tool result, so it costs no model request; an edit tool's call gets the same line from `loom-blast-radius.mjs`. A file with no such test gets the changed functions the index links no test to: `Loom tests for src/a.py: the index links no test to Router::match`. A comment-only change names nothing (**Tests at edit time**, below). `LOOM_TEST_GATE=off` disables; `LOOM_TEST_GATE_DEPTH` sets the hops (1–3). | -| `UserPromptSubmit` | `loom-prompt-recall.mjs` | **Default `first`**: one bounded recall on the first qualifying prompt of a session, including empty or abstaining answers. Clear named code-only questions skip default recall without consuming the attempt; mixed memory requests still qualify. `LOOM_PROMPT_RECALL=on` for every prompt, `off` to disable. One `context.pack` per prompt restricted to `memories`, `decisions`, `procedures` with the prompt as the query; injects the plane-tagged blocks the session has not seen, only when memory is not abstaining and `retrieval_confidence ≥ 0.5`, capped at 1,200 chars (`LOOM_PROMPT_RECALL_MAX_CHARS`). The memory-side sibling of the prompt pack: active retrieval — the model gets what memory knows about the prompt without asking — done per prompt, never per tool turn. | -| `UserPromptSubmit` | `loom-prompt-pack.mjs` | On by default (`LOOM_PROMPT_PACK=off` turns it off). One bounded lookup: `code.symbol`, `code.callers` or `code.impact` for an explicit named question, otherwise `code.search` (top 3, no bodies). Self-contained requests, local-only changes and explicit memory questions skip code retrieval. Search emits only where the index labels its own answer low-risk (or, with `LOOM_PROMPT_PACK_MIN_CONF` set, from that confidence), and without abstention; its pointers are candidates, and nothing tells the model to stop searching; typed answers preserve ambiguity and static-analysis limits. Named implementation or behavior questions request a whole definition body within 600 server-budget tokens; location/signature requests stay pointer-only and oversized bodies stay elided. No fallback request follows an empty typed answer. Pointers are deduplicated within the current answer, so later prompts can receive changed evidence. | -| `Stop` | `loom-test-gate.mjs` | **Holds a session that ran no test since its last code change.** With uncommitted changes **this session made** in a loom-indexed repo (the dirty paths the transcript shows an edit tool targeted or a shell command named, written since the session began, by the file's modification time; a tree left dirty before the session gates nothing, even when a command reads or runs its files), asks `code.test_gate` what the change obliges — the tests that reach it, in evidence order with a `run` command when the harness is derivable, and the touched functions no test reaches — and blocks the stop **once** per distinct change with a reason that names them. The second stop on the same change passes. By default any test run since the last code change lets the stop pass, and nothing is asked (**Stops that pass**, below); with `LOOM_TEST_GATE=block` only a run of the named tests does (**Answered stops**, below). `LOOM_TEST_GATE=off` disables. | -| `Stop` | `loom-validate-gate.mjs` | **Compile green before done**: collects the memory keys this session wrote from the transcript, asks `namespace.validate` for a report scoped to exactly those keys, and blocks the stop **once** per distinct key set with the error and warning findings that name them (a conflict you opened, a fact whose `valid_to` has passed, an attestation your edit made stale) and each check's remedy. `info` findings never block; the second stop on the same keys passes. `LOOM_VALIDATE_GATE=off` disables. | -| `Stop` | `loom-namespace-health.mjs` | **The store tells you when the namespace is misused**: once per session, one `namespace.audit` over the last day (no samples) for the session's namespace, asked by the first prompt's detached process so that a stop does not wait for it (a stop asks in place only when that process died before its answer); when it carries a critical finding — exact-key reads dwarfing searches, double-encoded values, rows the embedder gave up on, leases in the memory plane — you get **one line** naming the codes and `/loom-optimize`, once per session, at the first stop that finds the verdict, as a block-once reason (the one channel a Stop hook has to the model). Healthy namespace, no token, slow or down server: nothing. The same summary rides `context.pack` as the `namespace_health` section at session start. `LOOM_NAMESPACE_HEALTH=off` disables. | -| `Stop` | `loom-usage.mjs` | Posts the session's own model usage (input, cache read, cache creation by TTL, output; deduped by message id, sidechains skipped) to `cost.record_turns`; the **server** prices it into `loom.agent_turn_usage` from the same table it prices its own upstream spend with. Turns "did loom make this session cheaper" into a standing series instead of a hand-run paired experiment. Needs a writer token. `LOOM_USAGE=off` disables. | -| `UserPromptSubmit` | `loom-run.mjs` | Opens the session's **run** on the first prompt (`run.begin`: goal = the prompt, `run_id = cc-`, or the id `run.begin` answers instead; the prompt does not wait for that answer, so the SessionStart primer, the prompt's recall and a first tool observation keep the derived id, or on a resumed session the previous run's id). Later prompts are no-ops once a begin was answered or refused; after a timeout, a 408, 429 or 5xx the next prompt asks again with the same id, and SessionEnd closes it if no answer ever came. Until then the session's run-state file in the temp directory (readable by you only) holds that begin's body, which every retry re-sends: the prompt, redacted and cut to 8000 characters. One row per session in `loom.agent_runs`; every observation the capture hook records carries the same `run_id`, so `run.get` replays the session — goal, observations, memories written, cost. `LOOM_RUN_LEDGER=off` disables. | -| `SessionEnd` | `loom-run.mjs` | Closes the run (`run.complete`) with the transcript's last assistant text as `final_response` and `outcome: none` — the hook knows the run ended, not whether it succeeded, and never guesses which memories were used; that stays the agent's own `run.complete` call (`memories_used`, `reflection`). | -| `PreCompact` | `loom-capture.mjs` | Crystallizes the session before the context window is dropped. | -| `Stop`, `PreCompact` | `loom-working-memory.mjs` | Writes the session's **working-memory note** — one `working_memory.set` per project (`session:`, agent scope): the goal (first prompt), `git status --short --branch`, the files edited this session, the last reply — framed as a bookmark, not a source of facts (the next session's model answered a fact question from this line without searching). Deduped on content, so an unchanged turn writes nothing. `context.pack` loads working memory first in the SessionStart primer and Claude Code fires SessionStart again after a compaction, so the note written a moment before the drop is the first thing the agent reads after it. Not retrieval memory: never embedded or ranked. `LOOM_WORKING_MEMORY=off` disables. With `LOOM_PLUGIN_SCRATCHPAD=1` the Stop hook also appends the turn's one-line conclusion to the run's `scratchpad` block at run scope. | -| `Stop` / `SessionEnd` | `loom-capture.mjs` | Crystallizes the finished session. | -| `PreCompact`, `SessionEnd` | `loom-session-brief.mjs` | Revises the branch's **session brief**: the transcript since the last save becomes typed events (asks, replies, edits, commands with their descriptions, errors, reads, todo lists, PR/commit identifiers a command printed; zero model tokens) posted to `session.brief_save`, which condenses them under a budget and revises `auto//` — goal, status, next steps, decisions and why, what was tried and dropped, what was done, open questions, files, the rules you set, pointers. The `loom-session` skill restores one on request: you pick which (a number from `list`, a key, or a session) and restores it with the client's compaction summary (or `--transcript` for every recorded turn as well). Not retrieval memory: never embedded or ranked. Detached flusher; per-session cursor; a first save needs an ask and some work behind it. `LOOM_SESSION_BRIEF=off` disables. | -| `SessionEnd` | `loom-session-memory.mjs` | Hands the session's real turns (last 200, bounded) to `memory.set_from_messages(defer=true)` once, so loom extracts the facts, writes the **session summary**, judges the outcome and distils reflections. The turns are kept as the facts' source evidence. A session with under 40 bytes (UTF-8) of user and assistant text is not sent, because the extraction call's fixed prompt outweighs what it can yield: a rule stated in it is not extracted, and it gets no session summary, outcome judgement or reflections. `LOOM_SESSION_MEMORY=off` disables. | -| `Stop` / `SessionEnd` | `loom-conversation.mjs` | Appends new chat turns from the transcript to the conversation plane (→ the dashboard's Conversations page). Deterministic, every turn; per-session cursor + `msg_id`=transcript uuid dedup. Text blocks only — an image the user pasted becomes a `[image: ]` placeholder beside its text, and a tool result that returned images leaves one `tool` turn `[image: N image results returned by a tool]`; the bytes never leave the machine. Off-switch: `LOOM_CAPTURE_CONVERSATIONS=false`. | +| Lifecycle event | Script | What it does | +| --------------------------------------------------------- | --------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `UserPromptSubmit` | `loom-record.mjs` | The prompt's one process. Runs the two lookups the prompt waits for (`loom-prompt-pack`, `loom-prompt-recall`) in the hook itself and prints what they found as one `additionalContext`; writes the run's begin to the session's run state and hands the prompt's recording scripts (`loom-run`, `loom-namespace-health`'s audit) to a detached process and exits, as after a tool call. | +| `PostToolUse`, `PostToolUseFailure`, `Stop`, `SessionEnd` | `loom-record.mjs` | Runs the event's recording scripts (`loom-capture`, `loom-conversation`, `loom-usage`, `loom-working-memory`, `loom-run`'s close, `loom-session-memory`, `loom-session-brief`) in one process. After a tool call and at `Stop` that process is detached and the hook exits, so the session does not wait for their requests. At `SessionEnd` it is the hook itself, which exits when they have returned: a host torn down when the client exits would end a detached process first. | +| `PostToolUse` | `loom-capture.mjs` | Records one episodic observation of the tool action (heuristic type, file list). | +| `PostToolUseFailure` | `loom-capture.mjs` | Same, typed `error` — the bug-triage signal (errors + the subsequent fix). | +| `SessionStart` | `loom-session-start.mjs` | **First session, no credential:** signs this machine up (see `LOOM_AUTO_SIGNUP`) and points the user to the claim page for the namespace; nothing to paste. Then: injects a token-budgeted context primer (profile + relevant memories) via `context.pack`, so the agent starts knowing your context. Beside it, one line names the checkout's code namespace and the repository's memory tag, or says why no index was looked up, so a session start that prints nothing is a fault unless `LOOM_CODE_MAP=false`. How to route a lookup is in the MCP entry's startup instructions on a toolset with a `coding` part; any other toolset, and a wiring whose entry the plugin does not mount (Codex, a hand-wired client), gets it in the primer. **On by default**, once per session; `LOOM_INJECT_CONTEXT=false` to disable. | +| `PreToolUse` (Edit / Write / MultiEdit / NotebookEdit) | `loom-file-context.mjs` | Asks `memory.for_file` what loom knows about the target file (its files facet) and injects the rendered block as additional context — a constraint arrives **before** the edit, not as a review comment. One lookup per (session, file) per 30 min; never a permission decision. `LOOM_FILE_CONTEXT=off` disables. | +| `PostToolUse` (loom tools) | `loom-mentor-hint.mjs` | **The store's advice reaches the model**: a loom tool result may carry one `hint` — the plane this agent is not using, named from the call it just made (a `memory.get` that missed, a search that abstained where the code index answers, a stack trace written as a memory, a duplicate write). The hook lifts it out of the result JSON into additional context, once per code per session. No request of its own. `LOOM_MENTOR_HINTS=off` disables. | +| `PostToolUse` (Edit / Write / MultiEdit) | `loom-blast-radius.mjs` | In a loom-indexed repo, diffs the edited file against HEAD and asks `code.impact` (depth 1) what the touched symbols reach. Injects **one line**: callers, tests reaching the change, and the co-change partner files this session has not touched — the sibling-file miss, surfaced while the edit is still open. Same touched set reported once per session. The first edit of a file in a session also carries the test gate's line (next row), which stands in for the radius's count of tests where it names the file's tests, so an edit gets one line. `LOOM_BLAST_RADIUS=off` disables the radius. | +| `PostToolUse` (Bash / PowerShell) | `loom-test-gate.mjs` | **The tests are named when the file changes.** After a shell command in a loom-indexed repo, asks `code.test_gate` about each file the command changed (a dirty path it names, written since the session began) and attaches **one line** per file with the command of the tests the index links to it, or of the file itself when it is a test: `Loom tests for src/a.py: .venv/bin/python -m pytest tests/test_a.py`. Once per file and once per test per session, on the tool result, so it costs no model request; an edit tool's call gets the same line from `loom-blast-radius.mjs`. A file with no such test gets the changed functions the index links no test to: `Loom tests for src/a.py: the index links no test to Router::match`. A comment-only change names nothing (**Tests at edit time**, below). `LOOM_TEST_GATE=off` disables; `LOOM_TEST_GATE_DEPTH` sets the hops (1–3). | +| `UserPromptSubmit` | `loom-prompt-recall.mjs` | **Default `first`**: one bounded recall on the first qualifying prompt of a session, including empty or abstaining answers. Clear named code-only questions skip default recall without consuming the attempt; mixed memory requests still qualify. `LOOM_PROMPT_RECALL=on` for every prompt, `off` to disable. One `context.pack` per prompt restricted to `memories`, `decisions`, `procedures` with the prompt as the query; injects the plane-tagged blocks the session has not seen, only when memory is not abstaining and `retrieval_confidence ≥ 0.5`, capped at 1,200 chars (`LOOM_PROMPT_RECALL_MAX_CHARS`). The memory-side sibling of the prompt pack: active retrieval — the model gets what memory knows about the prompt without asking — done per prompt, never per tool turn. | +| `UserPromptSubmit` | `loom-prompt-pack.mjs` | On by default (`LOOM_PROMPT_PACK=off` turns it off). One bounded lookup: `code.symbol`, `code.callers` or `code.impact` for an explicit named question, otherwise `code.search` (top 3, no bodies). Self-contained requests, local-only changes and explicit memory questions skip code retrieval. Search emits only where the index labels its own answer low-risk (or, with `LOOM_PROMPT_PACK_MIN_CONF` set, from that confidence), and without abstention; its pointers are candidates, and nothing tells the model to stop searching; typed answers preserve ambiguity and static-analysis limits. Named implementation or behavior questions request a whole definition body within 600 server-budget tokens; location/signature requests stay pointer-only and oversized bodies stay elided. No fallback request follows an empty typed answer. Pointers are deduplicated within the current answer, so later prompts can receive changed evidence. | +| `Stop` | `loom-test-gate.mjs` | **Holds a session that ran no test since its last code change.** With uncommitted changes **this session made** in a loom-indexed repo (the dirty paths the transcript shows an edit tool targeted or a shell command named, written since the session began, by the file's modification time; a tree left dirty before the session gates nothing, even when a command reads or runs its files), asks `code.test_gate` what the change obliges — the tests to run, in evidence order with a `run` command when the harness is derivable, and the touched definitions a coverage run measured unexecuted — and blocks the stop **once** per distinct change with a reason that names them. The second stop on the same change passes. By default any test run since the last code change lets the stop pass, and nothing is asked (**Stops that pass**, below); with `LOOM_TEST_GATE=block` only a run of the named tests does (**Answered stops**, below). `LOOM_TEST_GATE=off` disables. | +| `Stop` | `loom-validate-gate.mjs` | **Compile green before done**: collects the memory keys this session wrote from the transcript, asks `namespace.validate` for a report scoped to exactly those keys, and blocks the stop **once** per distinct key set with the error and warning findings that name them (a conflict you opened, a fact whose `valid_to` has passed, an attestation your edit made stale) and each check's remedy. `info` findings never block; the second stop on the same keys passes. `LOOM_VALIDATE_GATE=off` disables. | +| `Stop` | `loom-namespace-health.mjs` | **The store tells you when the namespace is misused**: once per session, one `namespace.audit` over the last day (no samples) for the session's namespace, asked by the first prompt's detached process so that a stop does not wait for it (a stop asks in place only when that process died before its answer); when it carries a critical finding — exact-key reads dwarfing searches, double-encoded values, rows the embedder gave up on, leases in the memory plane — you get **one line** naming the codes and `/loom-optimize`, once per session, at the first stop that finds the verdict, as a block-once reason (the one channel a Stop hook has to the model). Healthy namespace, no token, slow or down server: nothing. The same summary rides `context.pack` as the `namespace_health` section at session start. `LOOM_NAMESPACE_HEALTH=off` disables. | +| `Stop` | `loom-usage.mjs` | Posts the session's own model usage (input, cache read, cache creation by TTL, output; deduped by message id, sidechains skipped) to `cost.record_turns`; the **server** prices it into `loom.agent_turn_usage` from the same table it prices its own upstream spend with. Turns "did loom make this session cheaper" into a standing series instead of a hand-run paired experiment. Needs a writer token. `LOOM_USAGE=off` disables. | +| `UserPromptSubmit` | `loom-run.mjs` | Opens the session's **run** on the first prompt (`run.begin`: goal = the prompt, `run_id = cc-`, or the id `run.begin` answers instead; the prompt does not wait for that answer, so the SessionStart primer, the prompt's recall and a first tool observation keep the derived id, or on a resumed session the previous run's id). Later prompts are no-ops once a begin was answered or refused; after a timeout, a 408, 429 or 5xx the next prompt asks again with the same id, and SessionEnd closes it if no answer ever came. Until then the session's run-state file in the temp directory (readable by you only) holds that begin's body, which every retry re-sends: the prompt, redacted and cut to 8000 characters. One row per session in `loom.agent_runs`; every observation the capture hook records carries the same `run_id`, so `run.get` replays the session — goal, observations, memories written, cost. `LOOM_RUN_LEDGER=off` disables. | +| `SessionEnd` | `loom-run.mjs` | Closes the run (`run.complete`) with the transcript's last assistant text as `final_response` and `outcome: none` — the hook knows the run ended, not whether it succeeded, and never guesses which memories were used; that stays the agent's own `run.complete` call (`memories_used`, `reflection`). | +| `PreCompact` | `loom-capture.mjs` | Crystallizes the session before the context window is dropped. | +| `Stop`, `PreCompact` | `loom-working-memory.mjs` | Writes the session's **working-memory note** — one `working_memory.set` per project (`session:`, agent scope): the goal (first prompt), `git status --short --branch`, the files edited this session, the last reply — framed as a bookmark, not a source of facts (the next session's model answered a fact question from this line without searching). Deduped on content, so an unchanged turn writes nothing. `context.pack` loads working memory first in the SessionStart primer and Claude Code fires SessionStart again after a compaction, so the note written a moment before the drop is the first thing the agent reads after it. Not retrieval memory: never embedded or ranked. `LOOM_WORKING_MEMORY=off` disables. With `LOOM_PLUGIN_SCRATCHPAD=1` the Stop hook also appends the turn's one-line conclusion to the run's `scratchpad` block at run scope. | +| `Stop` / `SessionEnd` | `loom-capture.mjs` | Crystallizes the finished session. | +| `PreCompact`, `SessionEnd` | `loom-session-brief.mjs` | Revises the branch's **session brief**: the transcript since the last save becomes typed events (asks, replies, edits, commands with their descriptions, errors, reads, todo lists, PR/commit identifiers a command printed; zero model tokens) posted to `session.brief_save`, which condenses them under a budget and revises `auto//` — goal, status, next steps, decisions and why, what was tried and dropped, what was done, open questions, files, the rules you set, pointers. The `loom-session` skill restores one on request: you pick which (a number from `list`, a key, or a session) and restores it with the client's compaction summary (or `--transcript` for every recorded turn as well). Not retrieval memory: never embedded or ranked. Detached flusher; per-session cursor; a first save needs an ask and some work behind it. `LOOM_SESSION_BRIEF=off` disables. | +| `SessionEnd` | `loom-session-memory.mjs` | Hands the session's real turns (last 200, bounded) to `memory.set_from_messages(defer=true)` once, so loom extracts the facts, writes the **session summary**, judges the outcome and distils reflections. The turns are kept as the facts' source evidence. A session with under 40 bytes (UTF-8) of user and assistant text is not sent, because the extraction call's fixed prompt outweighs what it can yield: a rule stated in it is not extracted, and it gets no session summary, outcome judgement or reflections. `LOOM_SESSION_MEMORY=off` disables. | +| `Stop` / `SessionEnd` | `loom-conversation.mjs` | Appends new chat turns from the transcript to the conversation plane (→ the dashboard's Conversations page). Deterministic, every turn; per-session cursor + `msg_id`=transcript uuid dedup. Text blocks only — an image the user pasted becomes a `[image: ]` placeholder beside its text, and a tool result that returned images leaves one `tool` turn `[image: N image results returned by a tool]`; the bytes never leave the machine. Off-switch: `LOOM_CAPTURE_CONVERSATIONS=false`. | **Team file rules.** The file-context hook reads two places in one `memory.for_file` request: your own namespace, and the repository's **primary code namespace** (its trunk branch's — `code-clickhouse` for every ClickHouse branch), named by the checkout's cached `code.repos` entry. A namespace you cannot read is skipped silently, so access follows repository access. Rules from the code namespace render as `Team rule (by alice, 3 days ago) [constraint]: … [id: ]` and design decisions (typed or tagged `decision`) as `Decision (by alice, 3 days ago) (pinned): … — source: [id: ]` (`(pinned)` only when someone pinned it, else no mark; `(source changed)` once its source document no longer says it), a newer rule the conflict check linked to an older one sits above it (`supersedes rule by …`, or `supersedes decision by …`), and one footer line says how to remove a wrong one. Every member of the repository may add a rule there (`memory.set` with `files` and the tag `constraint`) and revise or delete the rules they wrote; a maintainer may delete any — from an agent (`memory.delete` on the `[id:]` key) or from the dashboard (pick the code namespace under _show system_, open the memory, Delete). A refused delete answers a `hint` naming the author and what to do instead. `memory.set` fills `files` from the value when you do not pass it. Auto-extracted session facts never go to the code namespace. -**Tests at edit time.** The test gate names a file's tests on the tool call that changes it, where the agent is still working on the file. For a source file they are the tests the index links to it through its name, the test map or the call graph, each of them present in the checkout, with the tests that have no known runner listed by path; for a test file, the file's own command. A file with no test to name in the checkout gets the changed functions the index links no test to instead (`the index links no test to Router::match`), worded as the index's view, because its call graph is a floor. A file is asked about once per session, at its first change, so a function changed later in the same file is not named; a file the server gave no answer for is asked about once more, at the next call that names it; at most four files are asked about per tool call. A test is named once per session, so the test you edit after its source file adds no second line. A test the tool call's own command runs is not named on the result of that run: its command stands there whole, in this checkout, so `pytest tests/test_a.py::test_one`, `docker exec app pytest tests/test_a.py` and `echo "pytest tests/test_a.py"` still get the line. +**Tests at edit time.** The test gate names a file's tests on the tool call that changes it, where the agent is still working on the file. For a source file they are the asked tests (**Asked tests**, below), each of them present in the checkout, with the tests that have no known runner listed by path; for a test file, the file's own command. A file with no test to name in the checkout gets the changed definitions the index links no test to instead (`the index links no test to Router::match`), worded as the index's view, because its call graph is a floor. A file is asked about once per session, at its first change, so a function changed later in the same file is not named; a file the server gave no answer for is asked about once more, at the next call that names it; at most four files are asked about per tool call. A test is named once per session, so the test you edit after its source file adds no second line. A test the tool call's own command runs is not named on the result of that run: its command stands there whole, in this checkout, so `pytest tests/test_a.py::test_one`, `docker exec app pytest tests/test_a.py` and `echo "pytest tests/test_a.py"` still get the line. **Stops that pass.** By default the test gate holds the end of a session only when the session ran no test since its last code change. Whether a session ran the right tests, and how they went, cannot be read reliably from its shell commands: a session that runs the whole suite, compares against a stashed tree in one command or pipes pytest through `grep` has run the tests in a way no fixed rule reads, and a gate that holds the stop on that reading holds sessions that did the work. So the stop passes, before anything is asked of the server, when the transcript holds a shell command that starts a test runner and finished no earlier than the newest write among the code files the session changed. A changed file that is documentation or prose by its name is left out of that comparison, so a note written after the run holds nothing; so is a deleted file. Such a name ends in `.md`, `.mdx`, `.markdown`, `.rst`, `.adoc` or `.asciidoc`, or is `CHANGELOG`, `CHANGES`, `HISTORY` or `NEWS`. A `.txt` file is one when it has one of those four names or is `README.txt`, `LICENSE.txt`, `NOTICE.txt` or `AUTHORS.txt`, or lies under a `docs` or `doc` directory with no `requirements` or `constraints` in its path below it (`docs/releases/5.2.txt`); any other `.txt` file is code, as a requirements file or a test fixture is. A `git stash pop` in a later command than the run rewrites the changed files, so that stop is held. A runner is `pytest`, `unittest`, `tox`, `nox`, `jest`, `vitest`, `mocha`, `nextest`, `rspec`, `phpunit`, `ctest` or `clickhouse-test`, or `go`, `cargo`, `npm`, `pnpm`, `yarn`, `bun`, `deno`, `make`, `mvn`, `gradle`, `gradlew`, `dotnet`, `swift`, `bazel`, `mix`, `rake` or `node` with an argument in which `test` or `tests` follows no letter and no lower-case letter follows it (`make test-unit`, `node --test`, `gradle :app:test`, `gradlew testDebugUnitTest`, but not `make latest`, `go vet ./internal/testutil/...` or `cargo build -p testcontainers`); or `make`, `npm`, `pnpm`, `yarn`, `bun` or `rake` with a target or a script whose name starts with `test` (`make testall`, `npm run testci`); or `gradle` or `gradlew` with a task that ends in `Test` after a lower-case letter (`gradlew integrationTest`, but not `gradlew compileTestJava`). A name after `install`, `uninstall`, `add`, `i`, `ci`, `get`, `remove`, `rm`, `update`, `upgrade`, `download` or `require` in the same simple command is a package, not a run (`pip install -U pytest`, `npm i -D @types/jest`, `yarn remove jest`), and neither the word after `-x` (`gradle build -x test`) nor `test.skip` (`mvn package -Dmaven.test.skip=true`) is one. A backslash at a line's end joins the next line to the command. Two shapes are misread: a build tool's target that has a verb's name hides the run after it, so `make install test` and `mvn clean install test` are taken for no run and that stop is held once; and a target that only builds counts when its name reads as a run (`gradlew assembleAndroidTest`, `make testdata`). The command's output is not read: a run that failed, ran other tests or ran in a container passes, and so does a command that only names a runner, such as `grep -rn pytest .`. A session that wrote a changed code file after its last such command, or that ran none, is held once per distinct change with the tests to run and the functions the index links no test to; a harness the list does not name is not seen, and that stop is held once too. A latest prompt that ends with "Do not run the tests" passes when the gate names tests the checkout has. With no transcript the stop is not held. In a Codex rollout the session's changes are read from `apply_patch` and from the shell tool under each of its names (`exec`, `exec_command`, `shell`, `shell_command`, `container.exec`), so a rollout that changed a file through any of them is held, with `LOOM_TEST_GATE=block` too. A team that wants the stop held until the named tests ran on the final tree sets `LOOM_TEST_GATE=block` in the environment Claude Code starts in; the two paragraphs below describe that mode, which names nothing at edit time. -**Untested functions.** The index's call graph is a floor: a test may reach a function the graph holds no edge to, such as a constructor the test calls by building the object. Beside tests to run that the checkout has, the reason of a held stop therefore lists the functions as the index's view, `the index links no test to: … (the tests named here may still reach it)`. With no such test it reads `no test reaches: …` and asks for a test. +**Unlinked and untested definitions.** The index's call graph is a floor: a test may reach a definition the graph holds no edge to, through a fixture, a string-dispatched entry point or a public API. The reason of a held stop therefore lists a touched definition with no linked test as the index's view, `the index links no test to: … (the tests named here may still reach it)`, and such a definition alone holds no stop and asks for no test. Only a definition an imported coverage run measured unexecuted reads `measured unexecuted at : …` and asks for a test. -**Answered stops.** With `LOOM_TEST_GATE=block`, the test gate does not block, and so names no untested function, when it names tests, each of them is in the checkout and the transcript already answers the ask to run them, in one of two ways. Your latest prompt ends with the sentence "Do not run the tests" (also `don't` or `never`, and `tests`, `any tests` or `the test suite`). Or the transcript shows a Bash command that ran pytest on each named test, by its file or a directory above it that is below the checkout root, and whose output holds a whole summary line for each pytest in it: one that counts tests failed or passed and none deselected. A run that failed answers, since the session has read its failures; a collection that stopped at an error (`1 error in 0.12s`) does not, and neither does a line that counts a failure or an error when a pytest in the command has `--exitfirst`, `--maxfail` or a short flag holding `x` (`-x`, `-qx`, also `-rx`), since that run stopped before the files after it. No output answers that holds the line pytest prints above the summary of a run it ended early (`stopping after 1 failures`, `Interrupted: …`), which also shows a limit or `--sw` set in a configuration file or in `PYTEST_ADDOPTS`; `| tail -1` cuts that line, and such a run then answers. The command has no `--ignore`, `--deselect`, `--lf`, `--sw` or `--continue-on-collection-errors` and no quote in pytest's arguments; its runs count from the first pytest after which it runs only pytest, `tail`, `head`, `grep` and `echo` and holds no backquote and no redirect to a file other than `/dev/null`, so the second run of `git stash; pytest tests; git stash pop; pytest tests` answers and no run of `pytest tests; git stash; pytest tests; git stash pop` or of `pytest tests; git diff --stat` does; the transcript shows no edit-tool call and no other Bash or PowerShell call after that; no tracked file is deleted; and no uncommitted or untracked file was modified later. A run of the whole checkout names no path below the root, so a bare `pytest` and `pytest .` do not answer. Before pytest in its simple command only variable assignments, `env`, `timeout`, `uv run` or `poetry run`, an interpreter's `-m` and a path may stand: `python -u -m pytest tests` and `docker exec app pytest tests` do not answer. Runs in several commands add up only while each later command holds nothing before the first of its runs that count but what launches it: one that does anything else first, a `cd` included, answers for its own runs alone. The word after a pytest flag written without `=` is read as that flag's value, not as a path that ran, unless the flag is a cluster of `-q`, `-v`, `-x`, `-s` and `-l`: `pytest --no-header tests` does not answer. Quotes in the rest of the command are not read, so a `|`, `;` or `>` inside one counts as if unquoted: a run piped into `grep -E "passed|failed"` does not answer. +**Asked tests.** The gate asks for every test `code.test_gate` lists on evidence about the change (a test the session edited, a test a coverage run measured executing a touched definition, a test a call chain links to one, the test map), then for the tests that call other definitions of the edited files, up to four tests in all. + +**Answered stops.** With `LOOM_TEST_GATE=block`, the test gate does not block, and so names no unexecuted definition, when it asks for tests, each of them is in the checkout and the transcript already answers the ask to run them, in one of two ways. Your latest prompt ends with the sentence "Do not run the tests" (also `don't` or `never`, and `tests`, `any tests` or `the test suite`). Or the transcript shows a Bash command that ran pytest on each named test, by its file or a directory above it that is below the checkout root, and whose output holds a whole summary line for each pytest in it: one that counts tests failed or passed and none deselected. A run that failed answers, since the session has read its failures; a collection that stopped at an error (`1 error in 0.12s`) does not, and neither does a line that counts a failure or an error when a pytest in the command has `--exitfirst`, `--maxfail` or a short flag holding `x` (`-x`, `-qx`, also `-rx`), since that run stopped before the files after it. No output answers that holds the line pytest prints above the summary of a run it ended early (`stopping after 1 failures`, `Interrupted: …`), which also shows a limit or `--sw` set in a configuration file or in `PYTEST_ADDOPTS`; `| tail -1` cuts that line, and such a run then answers. The command has no `--ignore`, `--deselect`, `--lf`, `--sw` or `--continue-on-collection-errors` and no quote in pytest's arguments; its runs count from the first pytest after which it runs only pytest, `tail`, `head`, `grep` and `echo` and holds no backquote and no redirect to a file other than `/dev/null`, so the second run of `git stash; pytest tests; git stash pop; pytest tests` answers and no run of `pytest tests; git stash; pytest tests; git stash pop` or of `pytest tests; git diff --stat` does; the transcript shows no edit-tool call and no other Bash or PowerShell call after that; no tracked file is deleted; and no uncommitted or untracked file was modified later. A run of the whole checkout names no path below the root, so a bare `pytest` and `pytest .` do not answer. Before pytest in its simple command only variable assignments, `env`, `timeout`, `uv run` or `poetry run`, an interpreter's `-m` and a path may stand: `python -u -m pytest tests` and `docker exec app pytest tests` do not answer. Runs in several commands add up only while each later command holds nothing before the first of its runs that count but what launches it: one that does anything else first, a `cd` included, answers for its own runs alone. The word after a pytest flag written without `=` is read as that flag's value, not as a path that ran, unless the flag is a cluster of `-q`, `-v`, `-x`, `-s` and `-l`: `pytest --no-header tests` does not answer. Quotes in the rest of the command are not read, so a `|`, `;` or `>` inside one counts as if unquoted: a run piped into `grep -E "passed|failed"` does not answer. The scripts are standalone Node ESM (`.mjs`) with **zero dependencies** — no Loom SDK, no `node_modules`. They run on any Node ≥ 18 (global `fetch` + diff --git a/integrations/claude-code-plugin/hooks/HOOKS.md b/integrations/claude-code-plugin/hooks/HOOKS.md index 00b0c2bbfe7..737eb7349ef 100644 --- a/integrations/claude-code-plugin/hooks/HOOKS.md +++ b/integrations/claude-code-plugin/hooks/HOOKS.md @@ -399,10 +399,11 @@ record: the run and its usage counters. asked about yet this session (`adviceFiles`, `adviceLines` in lib/test-gate.mjs; at most four per call; a comment-only change is not asked about) and prints one line per file as additionalContext on that - tool result: the commands of the tests the index links to the file that - the checkout has, or the file's own command when it is a test. A file - with no such test gets the changed functions the index links no test - to. A file is asked about at its first change only, so a function + tool result: the commands of the asked tests (`askedTests`: every test + code.test_gate lists on evidence about the change, then tests that call + other definitions of the file, up to four in all) that the checkout + has, or the file's own command when it is a test. A file with no such + test gets the changed definitions the index links no test to. A file is asked about at its first change only, so a function changed later in it is not named; one the server gave no answer for is asked about once more. A test is named once per session, and not when the call's own command runs it in this checkout as a whole command @@ -417,7 +418,9 @@ record: the run and its usage counters. in either mode), it sends the change's paths, hunk ranges and function names only (`diffHeaders`) to code.test_gate for its obligations and blocks the stop once per distinct change with a reason - naming them. By default a stop passes, and asks the server nothing, when + naming them: the asked tests and the definitions a coverage run measured + unexecuted. A definition the index links no test to is named beside the + tests ("the index links no test to") and holds no stop by itself. By default a stop passes, and asks the server nothing, when the transcript holds a shell command that starts a test runner and finished no earlier than the newest write among the changed code files, documentation and prose left out by name diff --git a/integrations/claude-code-plugin/hooks/loom-test-gate.mjs b/integrations/claude-code-plugin/hooks/loom-test-gate.mjs index 532b2be3784..222cd71fee2 100644 --- a/integrations/claude-code-plugin/hooks/loom-test-gate.mjs +++ b/integrations/claude-code-plugin/hooks/loom-test-gate.mjs @@ -13,7 +13,7 @@ // // Stop: if the working tree has uncommitted changes THIS SESSION made // in a loom-indexed repo, ask `code.test_gate` for the change's obligations -// (tests to run, untested touched functions) and block the stop ONCE per +// (tests to run, touched definitions measured unexecuted) and block the stop ONCE per // distinct change with a reason that names them. "This session's" is read // from the transcript: dirty paths an edit tool targeted or a shell command // named, written since the session began (by the file's modification time); diff --git a/integrations/claude-code-plugin/lib/test-gate.mjs b/integrations/claude-code-plugin/lib/test-gate.mjs index 5457eb9f899..6e4ebf2a4c2 100644 --- a/integrations/claude-code-plugin/lib/test-gate.mjs +++ b/integrations/claude-code-plugin/lib/test-gate.mjs @@ -10,12 +10,14 @@ // At Stop it holds a session that ran no test since its last code change. // When the agent is about to stop with uncommitted changes in a // loom-indexed repo, it asks -// `code.test_gate` what the change obliges: the tests that reach -// it (evidence-ordered, with a run command when derivable) and the touched -// functions no test reaches. If either list is non-empty and this exact -// change has not been gated yet this session, block the stop ONCE with a -// reason that names them: the tests are named before "done", not discovered -// in review. The second stop on the +// `code.test_gate` what the change obliges: the tests to run +// (evidence-ordered, with a run command when derivable) and the touched +// definitions a coverage run measured unexecuted. If either list is non-empty +// and this exact change has not been gated yet this session, block the stop +// ONCE with a reason that names them: the tests are named before "done", not +// discovered in review. A touched definition the index links no test to is +// named beside the tests and asks for nothing by itself: a call graph cannot +// show that no test runs it. The second stop on the // same change passes: the agent has seen the obligation and either ran the // tests or chose not to, and a gate that nags is a gate that gets disabled. // A block costs the session one more model request, so by default any test @@ -96,14 +98,35 @@ function short(qname) { return parts.length > 2 ? parts.slice(-2).join("::") : String(qname || ""); } +/** + * The tests the gate asks to run: every test it lists on evidence about the + * change (a changed test, a coverage run, a call chain, the test map), then + * the tests that call other definitions of the edited files, up to `maxRuns` + * tests in all. A file neighbour says nothing about the touched definitions, + * so thirty of them are not thirty obligations. + */ +export function askedTests(gate, maxRuns = 4) { + const tests = gate && Array.isArray(gate.tests) ? gate.tests : []; + const linked = tests.filter((t) => t && t.why !== "file_neighbor"); + const neighbors = tests.filter((t) => t && t.why === "file_neighbor"); + return [...linked, ...neighbors.slice(0, Math.max(0, maxRuns - linked.length))]; +} + +/** `names` as a bounded list: the first `max`, then how many more of `total`. */ +function listed(names, max, total = names.length) { + const shown = names.slice(0, max); + return `${shown.join(", ")}${total > shown.length ? ` (+${total - shown.length})` : ""}`; +} + /** * Render the obligation text, or "" when there is nothing to say. * Runnable commands first (deduped), then tests with no derivable command, - * then the untested functions. Bounded: maxRuns commands, maxNames names. + * then the definitions the index links no test to and the ones a coverage + * run measured unexecuted. Bounded: maxRuns commands, maxNames names. */ export function renderGate(gate, { maxRuns = 4, maxNames = 4, python, testExists } = {}) { if (!gate || !gate.obligations) return ""; - const indexed = Array.isArray(gate.tests) ? gate.tests : []; + const indexed = askedTests(gate, maxRuns); // A test map may retain a deleted path, or the checkout may differ from // the indexed revision. Never prescribe a command whose target is absent. // Keep that evidence visible: an unavailable test is not a green test. @@ -117,57 +140,54 @@ export function renderGate(gate, { maxRuns = 4, maxNames = 4, python, testExists .filter((t) => !t.run) .map((t) => String(t.test_path || "")) .filter(Boolean); - const untested = Array.isArray(gate.untested) ? gate.untested : []; + // A measurement names its run: a row without a commit is no coverage result. + const untested = (Array.isArray(gate.untested) ? gate.untested : []).filter((u) => u && u.commit); const parts = []; if (runs) parts.push(`run: ${runs}`); - if (unknown.length) { - const shown = unknown.slice(0, maxNames); - const more = unknown.length - shown.length; - parts.push(`also reached (no known runner): ${shown.join(", ")}${more > 0 ? ` (+${more})` : ""}`); - } - if (missing.length) { - const shown = missing.slice(0, maxNames); - const more = missing.length - shown.length; - parts.push(`indexed tests not present in this checkout: ${shown.join(", ")}${more > 0 ? ` (+${more})` : ""}`); + if (unknown.length) parts.push(`also reached (no known runner): ${listed(unknown, maxNames)}`); + if (missing.length) parts.push(`indexed tests not present in this checkout: ${listed(missing, maxNames)}`); + const unlinked = unlinkedNames(gate, maxNames); + if (unlinked.list) { + // A statement about the index, never about the tests: a test that + // reaches the definition through a fixture or an entry point leaves no + // edge in the graph. + const hedge = + runs || unknown.length ? ` (the tests named here may still reach ${unlinked.total > 1 ? "them" : "it"})` : ""; + parts.push(`the index links no test to: ${unlinked.list}${hedge}`); } if (untested.length) { - const { list, total } = untestedNames(gate, maxNames); - // Beside tests to run, "no test reaches" reads as a fact about them, and - // a test that builds an object reaches a constructor the graph holds no - // edge to. - parts.push( - runs || unknown.length - ? `the index links no test to: ${list} (the tests named here may still reach ${total > 1 ? "them" : "it"})` - : `no test reaches: ${list}`, - ); + const names = [...new Set(untested.map((u) => short(u.qualified_name)))].filter(Boolean); + const commits = [...new Set(untested.map((u) => String(u.commit).slice(0, 10)))]; + const at = commits.length === 1 ? ` at ${commits[0]}` : ""; + parts.push(`measured unexecuted${at}: ${listed(names, maxNames, gate.untested_total || names.length)}`); } if (!parts.length) return ""; const floor = gate.counts_floor ? " (graph is a floor)" : ""; // Nothing to run is not "run the tests" — a session told // that went hunting for a runner. Say what the obligation actually is. + const add = untested.length ? "Add a test that runs the unexecuted code, or say why none is needed." : ""; const tail = missing.length ? "Run the available tests and check the missing paths against the indexed revision (deleted, renamed or different checkout); use current equivalent tests or say why not. Missing tests are not passes." : runs || unknown.length ? "Run the tests before finishing, or say why not." - : "Add a test that reaches it, or say why none is needed."; + : ""; const env = python === "" && raw.some(isPytest) ? " No Python was found for this checkout (no .venv, venv or VIRTUAL_ENV, no python3 or python on PATH): name the test you would run instead of searching for one." : ""; - return `Loom test gate${floor}: ${parts.join(" · ")}. ${tail}${env}`; + return `Loom test gate${floor}: ${parts.join(" · ")}. ${[tail, add].filter(Boolean).join(" ")}${env}`.trimEnd(); } const isPytest = (run) => /^pytest(\s|$)/.test(String(run || "")); -/** The functions of a gate's `untested`, by short name: the first `maxNames` - * as `list`, with a count of the rest, and how many there are in `total`. */ -function untestedNames(gate, maxNames = 4) { - const untested = gate && Array.isArray(gate.untested) ? gate.untested : []; - const names = [...new Set(untested.map((u) => short(u.qualified_name)))].filter(Boolean); - const shown = names.slice(0, maxNames); - const total = (gate && gate.untested_total) || names.length; - const more = total > shown.length ? ` (+${total - shown.length})` : ""; - return { list: shown.length ? `${shown.join(", ")}${more}` : "", total }; +/** The definitions of a gate's `unlinked`, by short name: the first + * `maxNames` as `list`, with a count of the rest, and how many there are in + * `total`. */ +function unlinkedNames(gate, maxNames = 4) { + const unlinked = gate && Array.isArray(gate.unlinked) ? gate.unlinked : []; + const names = [...new Set(unlinked.map((u) => short(u.qualified_name)))].filter(Boolean); + const total = (gate && gate.unlinked_total) || names.length; + return { list: listed(names, maxNames, total), total }; } /** The distinct run commands of `tests` (`raw`) and the first `maxRuns` of @@ -181,13 +201,14 @@ function runList(tests, { maxRuns, python }) { /** * The tests of a `code.test_gate` answer about `rel` alone that the - * edit-time line names: the ones the checkout has. For a source file they - * are the tests the index links to it; for a test file, the file itself. + * edit-time line names: the asked ones (`askedTests`) the checkout has. For + * a source file they are the tests the index links to it, then tests that + * call other definitions of the file; for a test file, the file itself. * A file under a tests directory that no runner takes (a fixture, a * conftest) is not a test to run for its own change. */ export function adviceTests(rel, gate, testExists) { - return (gate && Array.isArray(gate.tests) ? gate.tests : []).filter( + return askedTests(gate).filter( (t) => t && t.test_path && (t.run || String(t.test_path) !== rel) && (!testExists || testExists(String(t.test_path))), ); @@ -196,18 +217,18 @@ export function adviceTests(rel, gate, testExists) { /** * The edit-time line for `rel` from `tests` (see `adviceTests`): their * commands, then the tests no runner is known for. With no test, it names - * `untested`, the changed functions the index links no test to, as the + * `unlinked`, the changed definitions the index links no test to, as the * index's view: the graph is a floor, and the line has no reply in which the * agent could say that a test does reach them. "" when there is neither. */ -export function renderAdvice(rel, tests, { maxRuns = 4, maxNames = 4, python, untested = "" } = {}) { +export function renderAdvice(rel, tests, { maxRuns = 4, maxNames = 4, python, unlinked = "" } = {}) { const parts = [runList(tests, { maxRuns, python }).text].filter(Boolean); const unknown = [...new Set(tests.filter((t) => !t.run).map((t) => String(t.test_path)))]; if (unknown.length) { const more = unknown.length - maxNames; parts.push(`no known runner: ${unknown.slice(0, maxNames).join(", ")}${more > 0 ? ` (+${more})` : ""}`); } - if (!parts.length && untested) parts.push(`the index links no test to ${untested}`); + if (!parts.length && unlinked) parts.push(`the index links no test to ${unlinked}`); return parts.length ? `Loom tests for ${rel}: ${parts.join(" · ")}` : ""; } @@ -570,9 +591,9 @@ export async function adviceLines(payload, files, { root, repo, token, depth = g const tests = adviceTests(rel, gates[i], testExists); const fresh = tests.filter((t) => !named[t.test_path] && !(t.run && runsHere(command, String(t.run)))); if (python === undefined && fresh.some((t) => isPytest(t.run))) python = checkoutPython(root); - // Functions are named only for a file with no test to run in this checkout. - const untested = tests.length ? "" : untestedNames(gates[i]).list; - const text = renderAdvice(rel, fresh, { python, untested }); + // Definitions are named only for a file with no test to run in this checkout. + const unlinked = tests.length ? "" : unlinkedNames(gates[i]).list; + const text = renderAdvice(rel, fresh, { python, unlinked }); if (!text) continue; // A test folded into "(+N more)" was not shown, so its own change still names it. for (const t of printedTests(fresh)) { @@ -901,15 +922,16 @@ function wholeRuns(objs, { root, cwd, since } = {}) { /** * True when the gate's ask is to run tests this checkout has and the * transcript already answers it: the person's latest prompt ends by saying - * not to run tests, or `wholeRuns` holds every named test (its file, or a - * directory above it); `lastModified()` is the tree's newest file time in - * epoch ms. The stop then names no untested function either. A gate that - * names a test missing from the checkout, or only untested functions, still - * asks; so does one whose tests another runner runs, unless the person - * ruled the run out. A Codex rollout answers nothing, so its stop blocks. + * not to run tests, or `wholeRuns` holds every asked test (`askedTests`: its + * file, or a directory above it); `lastModified()` is the tree's newest file + * time in epoch ms. The stop then names no unexecuted definition either. A + * gate that names a test missing from the checkout, or only unexecuted + * definitions, still asks; so does one whose tests another runner runs, + * unless the person ruled the run out. A Codex rollout answers nothing, so + * its stop blocks. */ export function runAnswered(gate, objs, { root, cwd, testExists, lastModified } = {}) { - const tests = gate && Array.isArray(gate.tests) ? gate.tests : []; + const tests = askedTests(gate); const paths = [...new Set(tests.map((t) => String(t.test_path || "")))]; if (!paths.length || !paths.every((p) => p && testExists(p))) return false; if (declinesTests(objs)) return true; diff --git a/integrations/claude-code-plugin/skills/loom-code/reference.md b/integrations/claude-code-plugin/skills/loom-code/reference.md index ff172daaf24..1b114bd42ed 100644 --- a/integrations/claude-code-plugin/skills/loom-code/reference.md +++ b/integrations/claude-code-plugin/skills/loom-code/reference.md @@ -31,7 +31,7 @@ that needs no thought. Catch these: | Answer "**who calls X**" by grepping the name | `code.callers` | compiler-exact (scip tier); grep cannot tell a call from a comment, string, or same-named overload | | Judge "**is it safe to change X**" | `code.impact` | transitive radius + tests that reach it + files that usually co-change | | Review your **own uncommitted diff** before finishing | `code.impact` with `files=[...]` and/or `diff=` | the index can't see your working tree, but it computes what the diff touches against the base graph — blast radius, tests to run, and co-change partners your change did NOT touch | -| Say **"done"** on a change without naming its tests | `code.test_gate` with `files=[...]` and/or `diff=` | the tests that reach your change in evidence order — a test you edited, the stem partner of a file you changed, the mined test map, call-graph hops — each with a `run` command when derivable (never guessed), plus `untested`: touched functions no test reaches. Run the tests and rely on green; write a test for the untested rows or say why not | +| Say **"done"** on a change without naming its tests | `code.test_gate` with `files=[...]` and/or `diff=` | the tests to run in evidence order — a test you edited, a test a coverage run measured executing a touched definition, a test a call chain links to one, tests that call other definitions of the edited files, the mined test map — each with a `run` command when derivable (never guessed), plus `untested`: touched definitions a coverage run measured unexecuted, and `unlinked`: ones the index links no test to (not proof that none runs them). Run the tests and rely on green; write a test for the untested rows or say why not | | Run **`gh pr create`** on a change | `code.pr_check` with the title, body, changed paths, symbols and the issues it closes | a verdict over loom's PR ledgers — `duplicate_of` when an open PR is already doing this or a merged one already did (check main before you push), `related` to read first, `none` to open it — each item with state and evidence lines (files shared, same issue closed, a backport of yours); a title alone never reads as a duplicate | | Paste-and-eyeball a **stack trace** | `code.trace` | every frame resolved to its definition in one call, trace order preserved | | Convince yourself a **claim about the code is true** ("nothing calls X", "A reaches B", "this file defines Y") before acting on it | `code.verify` | a three-valued verdict with evidence — and it will NOT say "refuted" from an absence (the graph is a floor); it says "not_established" and names what it couldn't see, so you don't act on a false negative | diff --git a/integrations/claude-code-plugin/tests/test-gate.test.mjs b/integrations/claude-code-plugin/tests/test-gate.test.mjs index 9a90c8395a9..9a1d0b31f90 100644 --- a/integrations/claude-code-plugin/tests/test-gate.test.mjs +++ b/integrations/claude-code-plugin/tests/test-gate.test.mjs @@ -7,6 +7,7 @@ import path from "node:path"; import { advicePayload, adviceTests, + askedTests, checkoutPython, decideBlock, gateMode, @@ -25,16 +26,17 @@ const GATE = { obligations: true, counts_floor: true, tests: [ - { test_path: "tests/unit/test_a.py", why: "stem_partner", run: "pytest tests/unit/test_a.py", run_unknown: false }, + { test_path: "tests/unit/test_a.py", why: "changed_test", run: "pytest tests/unit/test_a.py", run_unknown: false }, { test_path: "tests/unit/test_a.py", why: "test_map", run: "pytest tests/unit/test_a.py", run_unknown: false }, - { test_path: "src/x/tests/gtest_parts.cpp", why: "graph_hop", run: "", run_unknown: true }, + { test_path: "src/x/tests/gtest_parts.cpp", why: "static_call", run: "", run_unknown: true }, ], - untested: [ + untested: [], + unlinked: [ { qualified_name: "DB::MergeTreeData::renameTempPartAndAdd", path: "src/a.cpp" }, { qualified_name: "DB::MergeTreeData::renameTempPartAndAdd", path: "src/a.cpp" }, { qualified_name: "DB::Foo::bar", path: "src/b.cpp" }, ], - untested_total: 2, + unlinked_total: 2, }; test("the gate advises at edit time unless LOOM_TEST_GATE says block or off", () => { @@ -54,7 +56,7 @@ test("the edit-time line names the commands of the tests the index links to the // Beside tests to run no function is named: the graph is a floor, and the line asks for no reply. assert.doesNotMatch(text, /renameTempPartAndAdd|no test reaches|links no test/); assert.equal( - renderAdvice("src/a.py", adviceTests("src/a.py", GATE), { python: ".venv/bin/python", untested: "Foo::bar" }), + renderAdvice("src/a.py", adviceTests("src/a.py", GATE), { python: ".venv/bin/python", unlinked: "Foo::bar" }), text, ); assert.deepEqual(advicePayload(text), { @@ -78,7 +80,7 @@ test("a changed test names its own command; a file no runner takes, a test the c line("src/a.py", gone, () => true), "Loom tests for src/a.py: pytest tests/gone.py", ); - for (const none of [null, {}, { tests: [] }, { untested: [{ qualified_name: "m::f" }] }]) { + for (const none of [null, {}, { tests: [] }, { unlinked: [{ qualified_name: "m::f" }] }]) { assert.equal(line("src/a.py", none), ""); } assert.equal(advicePayload(""), null); @@ -86,16 +88,16 @@ test("a changed test names its own command; a file no runner takes, a test the c test("a file with no test to name gets the functions the index links no test to, as the index's view", () => { assert.equal( - renderAdvice("src/a.py", [], { untested: "MergeTreeData::renameTempPartAndAdd, Foo::bar" }), + renderAdvice("src/a.py", [], { unlinked: "MergeTreeData::renameTempPartAndAdd, Foo::bar" }), "Loom tests for src/a.py: the index links no test to MergeTreeData::renameTempPartAndAdd, Foo::bar", ); - assert.equal(renderAdvice("src/a.py", [], { untested: "" }), ""); + assert.equal(renderAdvice("src/a.py", [], { unlinked: "" }), ""); }); test("the edit-time line folds pytest files into one command and counts the commands it leaves out", () => { const many = ["a", "b", "c", "d", "e", "f"].map((n) => ({ test_path: `tests/test_${n}.py`, - why: "graph_hop", + why: "static_call", run: `pytest tests/test_${n}.py`, })); assert.equal( @@ -124,7 +126,7 @@ test("blocks once per signature, then lets the stop through", () => { assert.equal(other.block, true); }); -test("render dedupes commands, lists unknown-runner tests and untested names", () => { +test("render dedupes commands, lists unknown-runner tests and unlinked names", () => { const text = renderGate(GATE); assert.match(text, /^Loom test gate \(graph is a floor\): run: pytest tests\/unit\/test_a\.py · /); assert.equal((text.match(/pytest tests\/unit\/test_a\.py/g) || []).length, 1); @@ -133,29 +135,74 @@ test("render dedupes commands, lists unknown-runner tests and untested names", ( assert.match(text, /\. Run the tests before finishing, or say why not\.$/); }); -test("beside tests to run, an untested function is the index's view, not a fact about those tests", () => { +test("an unlinked definition is the index's view, never a fact about the tests", () => { // A constructor, and a test file whose every test builds the object: the graph holds no edge between them. const built = { obligations: true, counts_floor: true, tests: [{ test_path: "tests/test_widgets.py", why: "changed_test", run: "pytest tests/test_widgets.py" }], - untested: [{ qualified_name: "src.pkg.widgets::Widget::__init__", path: "src/pkg/widgets.py" }], - untested_total: 1, + unlinked: [{ qualified_name: "src.pkg.widgets::Widget::__init__", path: "src/pkg/widgets.py" }], + unlinked_total: 1, }; assert.equal( renderGate(built, { python: "python3", testExists: () => true }), "Loom test gate (graph is a floor): run: python3 -m pytest tests/test_widgets.py · the index links no test to: Widget::__init__ (the tests named here may still reach it). Run the tests before finishing, or say why not.", ); - assert.doesNotMatch(renderGate(GATE, { testExists: () => true }), /no test reaches/); assert.match( renderGate(GATE, { testExists: () => true }), /Foo::bar \(the tests named here may still reach them\)\. /, ); - // With no test to run there is none to hedge about. + // With no test to run there is none to hedge about, and nothing to add: no run measured the code unexecuted. for (const none of [renderGate({ ...GATE, tests: [] }), renderGate(GATE, { testExists: () => false })]) { - assert.match(none, /no test reaches: MergeTreeData::renameTempPartAndAdd, Foo::bar\. /); + assert.match(none, /the index links no test to: MergeTreeData::renameTempPartAndAdd, Foo::bar[ .]/); + assert.doesNotMatch(none, /may still reach|Add a test/); } - assert.match(renderGate({ ...GATE, tests: [] }), /Foo::bar\. Add a test that reaches it/); + assert.equal( + renderGate({ ...GATE, tests: [] }), + "Loom test gate (graph is a floor): the index links no test to: MergeTreeData::renameTempPartAndAdd, Foo::bar.", + ); + for (const text of [renderGate(GATE), renderGate(built), renderGate({ ...GATE, tests: [] })]) { + assert.doesNotMatch(text, /no test reaches/); + } +}); + +test("a definition a coverage run measured unexecuted asks for a test", () => { + const measured = { + obligations: true, + tests: [{ test_path: "tests/test_a.py", why: "static_call", run: "pytest tests/test_a.py" }], + untested: [ + { qualified_name: "pkg.mod::Parser::reset", commit: "0123456789abcdef0123456789abcdef01234567" }, + { qualified_name: "pkg.mod::Parser::close", commit: "0123456789abcdef0123456789abcdef01234567" }, + ], + untested_total: 2, + unlinked: [{ qualified_name: "pkg.mod::helper" }], + }; + assert.equal( + renderGate(measured), + "Loom test gate: run: pytest tests/test_a.py · the index links no test to: pkg.mod::helper (the tests named here may still reach it) · measured unexecuted at 0123456789: Parser::reset, Parser::close. Run the tests before finishing, or say why not. Add a test that runs the unexecuted code, or say why none is needed.", + ); + // A row that names no run is no measurement, and asks for nothing. + assert.equal(renderGate({ obligations: true, untested: [{ qualified_name: "pkg.mod::f" }] }), ""); + // Runs at two commits name neither. + const mixed = { ...measured, untested: [measured.untested[0], { qualified_name: "pkg.mod::f", commit: "ffff" }] }; + assert.match(renderGate(mixed), /measured unexecuted: Parser::reset, pkg\.mod::f\. /); +}); + +test("a stop asks for the tests about the change, and for file neighbours only up to the cap", () => { + const t = (why, i) => ({ test_path: `tests/test_${why}_${i}.py`, why, run: `pytest tests/test_${why}_${i}.py` }); + const neighbors = Array.from({ length: 30 }, (_, i) => t("file_neighbor", i)); + const paths = (tests) => tests.map((x) => x.test_path); + // No test is linked to the change: the four neighbours that call the most of the file. + assert.deepEqual(paths(askedTests({ tests: neighbors })), paths(neighbors.slice(0, 4))); + // One linked test leaves room for three; five leave none, and all five are asked. + const one = [t("static_call", 0), ...neighbors]; + assert.deepEqual(paths(askedTests({ tests: one })), paths([one[0], ...neighbors.slice(0, 3)])); + const five = [t("changed_test", 0), ...[1, 2, 3].map((i) => t("static_call", i)), ...neighbors, t("test_map", 4)]; + assert.deepEqual(paths(askedTests({ tests: five })), paths(five.filter((x) => x.why !== "file_neighbor"))); + const text = renderGate({ obligations: true, tests: one }); + assert.match(text, /run: pytest tests\/test_static_call_0\.py tests\/test_file_neighbor_0\.py /); + assert.doesNotMatch(text, /test_file_neighbor_3|more\)/); + assert.deepEqual(askedTests(null), []); }); test("plain pytest runs fold into one command; a run with an option stays its own", () => { @@ -418,10 +465,10 @@ test("pytest runs use the checkout's interpreter; none found is said plainly", ( test("nothing to run asks for a test, not for running tests", () => { const text = renderGate({ obligations: true, - untested: [{ qualified_name: "server.naming::validate_namespace_name" }], + untested: [{ qualified_name: "server.naming::validate_namespace_name", commit: "abc1234" }], }); - assert.match(text, /no test reaches: server\.naming::validate_namespace_name/); - assert.match(text, /Add a test that reaches it, or say why none is needed\.$/); + assert.match(text, /measured unexecuted at abc1234: server\.naming::validate_namespace_name/); + assert.match(text, /Add a test that runs the unexecuted code, or say why none is needed\.$/); assert.doesNotMatch(text, /Run the tests/); }); @@ -556,7 +603,7 @@ const HEREDOC = const RUN_GATE = { obligations: true, tests: [{ test_path: "tests/test_a.py", run: "pytest tests/test_a.py" }], - untested: [{ qualified_name: "m::f" }], + unlinked: [{ qualified_name: "m::f" }], }; const answered = (objs, gate = RUN_GATE, cwd = ROOT) => runAnswered(gate, objs.flat(), { @@ -828,6 +875,22 @@ test("a run of a subset or of another file answers nothing", () => { ); }); +test("file neighbours past the cap do not keep a run from answering the gate", () => { + const neighbors = Array.from({ length: 30 }, (_, i) => ({ + test_path: `tests/test_n${i}.py`, + why: "file_neighbor", + run: `pytest tests/test_n${i}.py`, + })); + const gate = { + obligations: true, + tests: [{ test_path: "tests/test_a.py", why: "static_call", run: "pytest tests/test_a.py" }, ...neighbors], + }; + const ran = (paths) => [edit(), bash(`pytest ${paths.join(" ")}`, "===== 9 passed in 0.12s =====")]; + const asked = ["tests/test_a.py", "tests/test_n0.py", "tests/test_n1.py", "tests/test_n2.py"]; + assert.equal(answered(ran(asked), gate), true); + assert.equal(answered(ran(asked.slice(0, 3)), gate), false); +}); + test("a gate that asks for more than a pytest run of present tests still asks", () => { const no = [said("Fix f. Do not run the test suite."), edit()]; const ran = [edit(), bash(SUITE, PASSED)]; @@ -836,7 +899,7 @@ test("a gate that asks for more than a pytest run of present tests still asks", tests: [...RUN_GATE.tests, { test_path: "tests/gone_test.py", run: "pytest tests/gone_test.py" }], }; const other = { ...RUN_GATE, tests: [{ test_path: "tests/a.test.ts", run: "npx vitest run tests/a.test.ts" }] }; - const untested = { ...RUN_GATE, tests: [] }; + const untested = { ...RUN_GATE, tests: [], untested: [{ qualified_name: "m::f", commit: "abc1234" }] }; assert.equal(answered(ran, missing), false); assert.equal(answered(no, missing), false); assert.equal(answered(ran, other), false); @@ -1322,11 +1385,11 @@ test("a changed file's tests ride the tool call that changed it, once", async () .map((f) => ({ test_path: f, why: "changed_test", run: `pytest ${f}` })), ...stem.map((n) => ({ test_path: `tests/test_${n}.py`, - why: "stem_partner", + why: "test_map", run: `pytest tests/test_${n}.py`, })), ], - untested: stem.length ? [{ qualified_name: "m::g" }] : [], + unlinked: stem.length ? [{ qualified_name: "m::g" }] : [], }, "/v1/code.impact": { touched_symbols: [{ qualified_name: "m::g" }], diff --git a/integrations/codex-plugin/.codex-plugin/plugin.json b/integrations/codex-plugin/.codex-plugin/plugin.json index f5135f747ff..390aeaf2b9f 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.73", + "version": "1.2.75", "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-test-gate.mjs b/integrations/codex-plugin/hooks/loom-test-gate.mjs index 532b2be3784..222cd71fee2 100644 --- a/integrations/codex-plugin/hooks/loom-test-gate.mjs +++ b/integrations/codex-plugin/hooks/loom-test-gate.mjs @@ -13,7 +13,7 @@ // // Stop: if the working tree has uncommitted changes THIS SESSION made // in a loom-indexed repo, ask `code.test_gate` for the change's obligations -// (tests to run, untested touched functions) and block the stop ONCE per +// (tests to run, touched definitions measured unexecuted) and block the stop ONCE per // distinct change with a reason that names them. "This session's" is read // from the transcript: dirty paths an edit tool targeted or a shell command // named, written since the session began (by the file's modification time); diff --git a/integrations/codex-plugin/lib/test-gate.mjs b/integrations/codex-plugin/lib/test-gate.mjs index 5457eb9f899..6e4ebf2a4c2 100644 --- a/integrations/codex-plugin/lib/test-gate.mjs +++ b/integrations/codex-plugin/lib/test-gate.mjs @@ -10,12 +10,14 @@ // At Stop it holds a session that ran no test since its last code change. // When the agent is about to stop with uncommitted changes in a // loom-indexed repo, it asks -// `code.test_gate` what the change obliges: the tests that reach -// it (evidence-ordered, with a run command when derivable) and the touched -// functions no test reaches. If either list is non-empty and this exact -// change has not been gated yet this session, block the stop ONCE with a -// reason that names them: the tests are named before "done", not discovered -// in review. The second stop on the +// `code.test_gate` what the change obliges: the tests to run +// (evidence-ordered, with a run command when derivable) and the touched +// definitions a coverage run measured unexecuted. If either list is non-empty +// and this exact change has not been gated yet this session, block the stop +// ONCE with a reason that names them: the tests are named before "done", not +// discovered in review. A touched definition the index links no test to is +// named beside the tests and asks for nothing by itself: a call graph cannot +// show that no test runs it. The second stop on the // same change passes: the agent has seen the obligation and either ran the // tests or chose not to, and a gate that nags is a gate that gets disabled. // A block costs the session one more model request, so by default any test @@ -96,14 +98,35 @@ function short(qname) { return parts.length > 2 ? parts.slice(-2).join("::") : String(qname || ""); } +/** + * The tests the gate asks to run: every test it lists on evidence about the + * change (a changed test, a coverage run, a call chain, the test map), then + * the tests that call other definitions of the edited files, up to `maxRuns` + * tests in all. A file neighbour says nothing about the touched definitions, + * so thirty of them are not thirty obligations. + */ +export function askedTests(gate, maxRuns = 4) { + const tests = gate && Array.isArray(gate.tests) ? gate.tests : []; + const linked = tests.filter((t) => t && t.why !== "file_neighbor"); + const neighbors = tests.filter((t) => t && t.why === "file_neighbor"); + return [...linked, ...neighbors.slice(0, Math.max(0, maxRuns - linked.length))]; +} + +/** `names` as a bounded list: the first `max`, then how many more of `total`. */ +function listed(names, max, total = names.length) { + const shown = names.slice(0, max); + return `${shown.join(", ")}${total > shown.length ? ` (+${total - shown.length})` : ""}`; +} + /** * Render the obligation text, or "" when there is nothing to say. * Runnable commands first (deduped), then tests with no derivable command, - * then the untested functions. Bounded: maxRuns commands, maxNames names. + * then the definitions the index links no test to and the ones a coverage + * run measured unexecuted. Bounded: maxRuns commands, maxNames names. */ export function renderGate(gate, { maxRuns = 4, maxNames = 4, python, testExists } = {}) { if (!gate || !gate.obligations) return ""; - const indexed = Array.isArray(gate.tests) ? gate.tests : []; + const indexed = askedTests(gate, maxRuns); // A test map may retain a deleted path, or the checkout may differ from // the indexed revision. Never prescribe a command whose target is absent. // Keep that evidence visible: an unavailable test is not a green test. @@ -117,57 +140,54 @@ export function renderGate(gate, { maxRuns = 4, maxNames = 4, python, testExists .filter((t) => !t.run) .map((t) => String(t.test_path || "")) .filter(Boolean); - const untested = Array.isArray(gate.untested) ? gate.untested : []; + // A measurement names its run: a row without a commit is no coverage result. + const untested = (Array.isArray(gate.untested) ? gate.untested : []).filter((u) => u && u.commit); const parts = []; if (runs) parts.push(`run: ${runs}`); - if (unknown.length) { - const shown = unknown.slice(0, maxNames); - const more = unknown.length - shown.length; - parts.push(`also reached (no known runner): ${shown.join(", ")}${more > 0 ? ` (+${more})` : ""}`); - } - if (missing.length) { - const shown = missing.slice(0, maxNames); - const more = missing.length - shown.length; - parts.push(`indexed tests not present in this checkout: ${shown.join(", ")}${more > 0 ? ` (+${more})` : ""}`); + if (unknown.length) parts.push(`also reached (no known runner): ${listed(unknown, maxNames)}`); + if (missing.length) parts.push(`indexed tests not present in this checkout: ${listed(missing, maxNames)}`); + const unlinked = unlinkedNames(gate, maxNames); + if (unlinked.list) { + // A statement about the index, never about the tests: a test that + // reaches the definition through a fixture or an entry point leaves no + // edge in the graph. + const hedge = + runs || unknown.length ? ` (the tests named here may still reach ${unlinked.total > 1 ? "them" : "it"})` : ""; + parts.push(`the index links no test to: ${unlinked.list}${hedge}`); } if (untested.length) { - const { list, total } = untestedNames(gate, maxNames); - // Beside tests to run, "no test reaches" reads as a fact about them, and - // a test that builds an object reaches a constructor the graph holds no - // edge to. - parts.push( - runs || unknown.length - ? `the index links no test to: ${list} (the tests named here may still reach ${total > 1 ? "them" : "it"})` - : `no test reaches: ${list}`, - ); + const names = [...new Set(untested.map((u) => short(u.qualified_name)))].filter(Boolean); + const commits = [...new Set(untested.map((u) => String(u.commit).slice(0, 10)))]; + const at = commits.length === 1 ? ` at ${commits[0]}` : ""; + parts.push(`measured unexecuted${at}: ${listed(names, maxNames, gate.untested_total || names.length)}`); } if (!parts.length) return ""; const floor = gate.counts_floor ? " (graph is a floor)" : ""; // Nothing to run is not "run the tests" — a session told // that went hunting for a runner. Say what the obligation actually is. + const add = untested.length ? "Add a test that runs the unexecuted code, or say why none is needed." : ""; const tail = missing.length ? "Run the available tests and check the missing paths against the indexed revision (deleted, renamed or different checkout); use current equivalent tests or say why not. Missing tests are not passes." : runs || unknown.length ? "Run the tests before finishing, or say why not." - : "Add a test that reaches it, or say why none is needed."; + : ""; const env = python === "" && raw.some(isPytest) ? " No Python was found for this checkout (no .venv, venv or VIRTUAL_ENV, no python3 or python on PATH): name the test you would run instead of searching for one." : ""; - return `Loom test gate${floor}: ${parts.join(" · ")}. ${tail}${env}`; + return `Loom test gate${floor}: ${parts.join(" · ")}. ${[tail, add].filter(Boolean).join(" ")}${env}`.trimEnd(); } const isPytest = (run) => /^pytest(\s|$)/.test(String(run || "")); -/** The functions of a gate's `untested`, by short name: the first `maxNames` - * as `list`, with a count of the rest, and how many there are in `total`. */ -function untestedNames(gate, maxNames = 4) { - const untested = gate && Array.isArray(gate.untested) ? gate.untested : []; - const names = [...new Set(untested.map((u) => short(u.qualified_name)))].filter(Boolean); - const shown = names.slice(0, maxNames); - const total = (gate && gate.untested_total) || names.length; - const more = total > shown.length ? ` (+${total - shown.length})` : ""; - return { list: shown.length ? `${shown.join(", ")}${more}` : "", total }; +/** The definitions of a gate's `unlinked`, by short name: the first + * `maxNames` as `list`, with a count of the rest, and how many there are in + * `total`. */ +function unlinkedNames(gate, maxNames = 4) { + const unlinked = gate && Array.isArray(gate.unlinked) ? gate.unlinked : []; + const names = [...new Set(unlinked.map((u) => short(u.qualified_name)))].filter(Boolean); + const total = (gate && gate.unlinked_total) || names.length; + return { list: listed(names, maxNames, total), total }; } /** The distinct run commands of `tests` (`raw`) and the first `maxRuns` of @@ -181,13 +201,14 @@ function runList(tests, { maxRuns, python }) { /** * The tests of a `code.test_gate` answer about `rel` alone that the - * edit-time line names: the ones the checkout has. For a source file they - * are the tests the index links to it; for a test file, the file itself. + * edit-time line names: the asked ones (`askedTests`) the checkout has. For + * a source file they are the tests the index links to it, then tests that + * call other definitions of the file; for a test file, the file itself. * A file under a tests directory that no runner takes (a fixture, a * conftest) is not a test to run for its own change. */ export function adviceTests(rel, gate, testExists) { - return (gate && Array.isArray(gate.tests) ? gate.tests : []).filter( + return askedTests(gate).filter( (t) => t && t.test_path && (t.run || String(t.test_path) !== rel) && (!testExists || testExists(String(t.test_path))), ); @@ -196,18 +217,18 @@ export function adviceTests(rel, gate, testExists) { /** * The edit-time line for `rel` from `tests` (see `adviceTests`): their * commands, then the tests no runner is known for. With no test, it names - * `untested`, the changed functions the index links no test to, as the + * `unlinked`, the changed definitions the index links no test to, as the * index's view: the graph is a floor, and the line has no reply in which the * agent could say that a test does reach them. "" when there is neither. */ -export function renderAdvice(rel, tests, { maxRuns = 4, maxNames = 4, python, untested = "" } = {}) { +export function renderAdvice(rel, tests, { maxRuns = 4, maxNames = 4, python, unlinked = "" } = {}) { const parts = [runList(tests, { maxRuns, python }).text].filter(Boolean); const unknown = [...new Set(tests.filter((t) => !t.run).map((t) => String(t.test_path)))]; if (unknown.length) { const more = unknown.length - maxNames; parts.push(`no known runner: ${unknown.slice(0, maxNames).join(", ")}${more > 0 ? ` (+${more})` : ""}`); } - if (!parts.length && untested) parts.push(`the index links no test to ${untested}`); + if (!parts.length && unlinked) parts.push(`the index links no test to ${unlinked}`); return parts.length ? `Loom tests for ${rel}: ${parts.join(" · ")}` : ""; } @@ -570,9 +591,9 @@ export async function adviceLines(payload, files, { root, repo, token, depth = g const tests = adviceTests(rel, gates[i], testExists); const fresh = tests.filter((t) => !named[t.test_path] && !(t.run && runsHere(command, String(t.run)))); if (python === undefined && fresh.some((t) => isPytest(t.run))) python = checkoutPython(root); - // Functions are named only for a file with no test to run in this checkout. - const untested = tests.length ? "" : untestedNames(gates[i]).list; - const text = renderAdvice(rel, fresh, { python, untested }); + // Definitions are named only for a file with no test to run in this checkout. + const unlinked = tests.length ? "" : unlinkedNames(gates[i]).list; + const text = renderAdvice(rel, fresh, { python, unlinked }); if (!text) continue; // A test folded into "(+N more)" was not shown, so its own change still names it. for (const t of printedTests(fresh)) { @@ -901,15 +922,16 @@ function wholeRuns(objs, { root, cwd, since } = {}) { /** * True when the gate's ask is to run tests this checkout has and the * transcript already answers it: the person's latest prompt ends by saying - * not to run tests, or `wholeRuns` holds every named test (its file, or a - * directory above it); `lastModified()` is the tree's newest file time in - * epoch ms. The stop then names no untested function either. A gate that - * names a test missing from the checkout, or only untested functions, still - * asks; so does one whose tests another runner runs, unless the person - * ruled the run out. A Codex rollout answers nothing, so its stop blocks. + * not to run tests, or `wholeRuns` holds every asked test (`askedTests`: its + * file, or a directory above it); `lastModified()` is the tree's newest file + * time in epoch ms. The stop then names no unexecuted definition either. A + * gate that names a test missing from the checkout, or only unexecuted + * definitions, still asks; so does one whose tests another runner runs, + * unless the person ruled the run out. A Codex rollout answers nothing, so + * its stop blocks. */ export function runAnswered(gate, objs, { root, cwd, testExists, lastModified } = {}) { - const tests = gate && Array.isArray(gate.tests) ? gate.tests : []; + const tests = askedTests(gate); const paths = [...new Set(tests.map((t) => String(t.test_path || "")))]; if (!paths.length || !paths.every((p) => p && testExists(p))) return false; if (declinesTests(objs)) return true; diff --git a/integrations/codex-plugin/skills/loom-code/reference.md b/integrations/codex-plugin/skills/loom-code/reference.md index ff172daaf24..1b114bd42ed 100644 --- a/integrations/codex-plugin/skills/loom-code/reference.md +++ b/integrations/codex-plugin/skills/loom-code/reference.md @@ -31,7 +31,7 @@ that needs no thought. Catch these: | Answer "**who calls X**" by grepping the name | `code.callers` | compiler-exact (scip tier); grep cannot tell a call from a comment, string, or same-named overload | | Judge "**is it safe to change X**" | `code.impact` | transitive radius + tests that reach it + files that usually co-change | | Review your **own uncommitted diff** before finishing | `code.impact` with `files=[...]` and/or `diff=` | the index can't see your working tree, but it computes what the diff touches against the base graph — blast radius, tests to run, and co-change partners your change did NOT touch | -| Say **"done"** on a change without naming its tests | `code.test_gate` with `files=[...]` and/or `diff=` | the tests that reach your change in evidence order — a test you edited, the stem partner of a file you changed, the mined test map, call-graph hops — each with a `run` command when derivable (never guessed), plus `untested`: touched functions no test reaches. Run the tests and rely on green; write a test for the untested rows or say why not | +| Say **"done"** on a change without naming its tests | `code.test_gate` with `files=[...]` and/or `diff=` | the tests to run in evidence order — a test you edited, a test a coverage run measured executing a touched definition, a test a call chain links to one, tests that call other definitions of the edited files, the mined test map — each with a `run` command when derivable (never guessed), plus `untested`: touched definitions a coverage run measured unexecuted, and `unlinked`: ones the index links no test to (not proof that none runs them). Run the tests and rely on green; write a test for the untested rows or say why not | | Run **`gh pr create`** on a change | `code.pr_check` with the title, body, changed paths, symbols and the issues it closes | a verdict over loom's PR ledgers — `duplicate_of` when an open PR is already doing this or a merged one already did (check main before you push), `related` to read first, `none` to open it — each item with state and evidence lines (files shared, same issue closed, a backport of yours); a title alone never reads as a duplicate | | Paste-and-eyeball a **stack trace** | `code.trace` | every frame resolved to its definition in one call, trace order preserved | | Convince yourself a **claim about the code is true** ("nothing calls X", "A reaches B", "this file defines Y") before acting on it | `code.verify` | a three-valued verdict with evidence — and it will NOT say "refuted" from an absence (the graph is a floor); it says "not_established" and names what it couldn't see, so you don't act on a false negative | diff --git a/sdk/python/loom/code.py b/sdk/python/loom/code.py index 07f768ed0ea..044215ffd2e 100644 --- a/sdk/python/loom/code.py +++ b/sdk/python/loom/code.py @@ -460,8 +460,10 @@ async def test_gate( ) -> dict[str, Any]: """Pre-PR obligations for a change: `tests` to run in evidence order (each with `why`, and `run` or `run_unknown`), `untested` touched - symbols no test reaches, and `obligations` — true while either list - is non-empty. Pass the unified diff for hunk-level touched symbols; + definitions a coverage run measured unexecuted, `unlinked` ones the + index links no test to, and `obligations` — true while `tests` or + `untested` is non-empty. Pass the unified diff against the indexed + revision to touch only the definitions its changed lines sit in; files alone means every function in them.""" body: dict[str, Any] = {"depth": depth, "limit": limit} if files: diff --git a/sdk/python/loom/ops.py b/sdk/python/loom/ops.py index 3d16c65c8b9..5b5c21b9d6e 100644 --- a/sdk/python/loom/ops.py +++ b/sdk/python/loom/ops.py @@ -8091,7 +8091,7 @@ class CodeSymbolHistoryOutput(TypedDict, total=False): class CodeTestGateInput(TypedDict, total=False): - "The pre-PR question in one call: for THIS change, which tests must" + "The pre-PR question in one call: for THIS change, which tests must run, and" org: NotRequired[str] namespace: NotRequired[str] @@ -8105,7 +8105,7 @@ class CodeTestGateInput(TypedDict, total=False): class CodeTestGateBody(TypedDict, total=False): - "The pre-PR question in one call: for THIS change, which tests must" + "The pre-PR question in one call: for THIS change, which tests must run, and" org: NotRequired[str] namespace: NotRequired[str] @@ -8121,13 +8121,16 @@ class CodeTestGateBody(TypedDict, total=False): class CodeTestGateOutput(TypedDict, total=False): tests: NotRequired[list[dict[str, Any]]] untested: NotRequired[list[dict[str, Any]]] + unlinked: NotRequired[list[dict[str, Any]]] changed_files: NotRequired[list[str]] touched_symbols: NotRequired[list[dict[str, Any]]] obligations: NotRequired[bool] tests_total: NotRequired[int] untested_total: NotRequired[int] + unlinked_total: NotRequired[int] tests_capped: NotRequired[bool] untested_capped: NotRequired[bool] + unlinked_capped: NotRequired[bool] counts_floor: NotRequired[bool] epistemic: NotRequired[str] causes: NotRequired[list[str]] diff --git a/sdk/ruby/lib/clickhouse/loom/generated/ops.rb b/sdk/ruby/lib/clickhouse/loom/generated/ops.rb index 78a4a630688..5f7d108f73a 100644 --- a/sdk/ruby/lib/clickhouse/loom/generated/ops.rb +++ b/sdk/ruby/lib/clickhouse/loom/generated/ops.rb @@ -753,7 +753,7 @@ def symbol_history(body = nil, request_options: nil, **fields) end # `code.test_gate` (viewer, read-only, experimental). - # The pre-PR question in one call: for THIS change, which tests must + # The pre-PR question in one call: for THIS change, which tests must run, and def test_gate(body = nil, request_options: nil, **fields) call_op("code.test_gate", body, fields, request_options) end diff --git a/sdk/rust/src/wire_models.rs b/sdk/rust/src/wire_models.rs index 55d1ac43899..e9d7ca29390 100644 --- a/sdk/rust/src/wire_models.rs +++ b/sdk/rust/src/wire_models.rs @@ -15469,28 +15469,34 @@ pub struct CodeTestGateOutput { #[serde(default = "default_805")] pub untested: Vec>, #[serde(default = "default_806")] - pub changed_files: Vec, + pub unlinked: Vec>, #[serde(default = "default_807")] - pub touched_symbols: Vec>, + pub changed_files: Vec, #[serde(default = "default_808")] - pub obligations: bool, + pub touched_symbols: Vec>, #[serde(default = "default_809")] - pub tests_total: Integer, + pub obligations: bool, #[serde(default = "default_810")] - pub untested_total: Integer, + pub tests_total: Integer, #[serde(default = "default_811")] - pub tests_capped: bool, + pub untested_total: Integer, #[serde(default = "default_812")] - pub untested_capped: bool, + pub unlinked_total: Integer, #[serde(default = "default_813")] - pub counts_floor: bool, + pub tests_capped: bool, #[serde(default = "default_814")] - pub epistemic: String, + pub untested_capped: bool, #[serde(default = "default_815")] - pub causes: Vec, + pub unlinked_capped: bool, #[serde(default = "default_816")] - pub by_hop_counts: std::collections::HashMap, + pub counts_floor: bool, #[serde(default = "default_817")] + pub epistemic: String, + #[serde(default = "default_818")] + pub causes: Vec, + #[serde(default = "default_819")] + pub by_hop_counts: std::collections::HashMap, + #[serde(default = "default_820")] pub trace_run_id: String, } @@ -15619,21 +15625,21 @@ impl CodeTestGateInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct CodeTestHomeOutput { - #[serde(default = "default_818")] + #[serde(default = "default_821")] pub verdict: String, - #[serde(default = "default_819")] + #[serde(default = "default_822")] pub home: String, - #[serde(default = "default_820")] + #[serde(default = "default_823")] pub candidates: Vec>, - #[serde(default = "default_821")] + #[serde(default = "default_824")] pub parts: Vec, - #[serde(default = "default_822")] + #[serde(default = "default_825")] pub src_paths: Vec, - #[serde(default = "default_823")] + #[serde(default = "default_826")] pub next_free_stateless_number: Integer, - #[serde(default = "default_824")] + #[serde(default = "default_827")] pub control: std::collections::HashMap, - #[serde(default = "default_825")] + #[serde(default = "default_828")] pub trace_run_id: String, } @@ -15773,27 +15779,27 @@ impl CodeTestHomeInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct CodeTestsForOutput { - #[serde(default = "default_826")] + #[serde(default = "default_829")] pub tests: Vec>, - #[serde(default = "default_827")] + #[serde(default = "default_830")] pub total: Integer, - #[serde(default = "default_828")] + #[serde(default = "default_831")] pub truncated: bool, - #[serde(default = "default_829")] + #[serde(default = "default_832")] pub facets: Vec>, - #[serde(default = "default_830")] + #[serde(default = "default_833")] pub verdict: String, - #[serde(default = "default_831")] + #[serde(default = "default_834")] pub abstain: bool, - #[serde(default = "default_832")] + #[serde(default = "default_835")] pub uncovered_kinds: Vec, - #[serde(default = "default_833")] + #[serde(default = "default_836")] pub as_of: std::collections::HashMap, - #[serde(default = "default_834")] + #[serde(default = "default_837")] pub tokens_returned: Integer, - #[serde(default = "default_835")] + #[serde(default = "default_838")] pub took_ms: Integer, - #[serde(default = "default_836")] + #[serde(default = "default_839")] pub trace_run_id: String, } @@ -15899,9 +15905,9 @@ impl CodeTestsForInput { pub struct CodeTraceOutput { pub frames: Vec>, pub definitions: Vec, - #[serde(default = "default_837")] + #[serde(default = "default_840")] pub tokens_returned: Integer, - #[serde(default = "default_838")] + #[serde(default = "default_841")] pub trace_run_id: String, } @@ -16017,16 +16023,16 @@ pub enum CodeVerifyOutputVerdict { #[non_exhaustive] pub struct CodeVerifyOutput { pub verdict: CodeVerifyOutputVerdict, - #[serde(default = "default_839")] + #[serde(default = "default_842")] pub reason: String, pub explanation: String, - #[serde(default = "default_840")] + #[serde(default = "default_843")] pub evidence: Vec>, - #[serde(default = "default_841")] + #[serde(default = "default_844")] pub floors: std::collections::HashMap, - #[serde(default = "default_842")] + #[serde(default = "default_845")] pub index_verdict: String, - #[serde(default = "default_843")] + #[serde(default = "default_846")] pub trace_run_id: String, } @@ -16148,29 +16154,29 @@ impl CodeVerifyInput { #[non_exhaustive] pub struct CodeVerifyCitationsOutput { pub verdict: String, - #[serde(default = "default_844")] + #[serde(default = "default_847")] pub counts: std::collections::HashMap, - #[serde(default = "default_845")] + #[serde(default = "default_848")] pub citations: Vec>, - #[serde(default = "default_846")] + #[serde(default = "default_849")] pub skipped: Vec>, - #[serde(default = "default_847")] + #[serde(default = "default_850")] pub truncated: bool, - #[serde(default = "default_848")] + #[serde(default = "default_851")] pub epistemic: std::collections::HashMap, - #[serde(default = "default_849")] + #[serde(default = "default_852")] pub at_commit: std::collections::HashMap, - #[serde(default = "default_850")] + #[serde(default = "default_853")] pub pr_diff: std::collections::HashMap, - #[serde(default = "default_851")] + #[serde(default = "default_854")] pub namespaces: Vec, - #[serde(default = "default_852")] + #[serde(default = "default_855")] pub took_ms: Integer, - #[serde(default = "default_853")] + #[serde(default = "default_856")] pub as_of: std::collections::HashMap, - #[serde(default = "default_854")] + #[serde(default = "default_857")] pub note: String, - #[serde(default = "default_855")] + #[serde(default = "default_858")] pub trace_run_id: String, } @@ -16343,7 +16349,7 @@ pub struct CollectionCreateOutput { pub namespace: String, pub parent: String, pub created: bool, - #[serde(default = "default_856")] + #[serde(default = "default_859")] pub title: String, } @@ -16441,9 +16447,9 @@ impl CollectionCreateInput { pub struct CollectionDeleteOutput { pub namespace: String, pub deleted: bool, - #[serde(default = "default_857")] + #[serde(default = "default_860")] pub erasure_id: String, - #[serde(default = "default_858")] + #[serde(default = "default_861")] pub erasure_status: String, } @@ -16485,11 +16491,11 @@ pub struct CollectionEntry { pub parent: String, pub personal: bool, pub role: String, - #[serde(default = "default_859")] + #[serde(default = "default_862")] pub description: String, - #[serde(default = "default_860")] + #[serde(default = "default_863")] pub title: String, - #[serde(default = "default_861")] + #[serde(default = "default_864")] pub document_count: Option, } @@ -16497,7 +16503,7 @@ pub struct CollectionEntry { #[non_exhaustive] pub struct CollectionListOutput { pub collections: Vec, - #[serde(default = "default_862")] + #[serde(default = "default_865")] pub next_cursor: Option, } @@ -16839,11 +16845,11 @@ pub struct ConflictRow { #[non_exhaustive] pub struct ConflictsListOutput { pub rows: Vec, - #[serde(default = "default_863")] + #[serde(default = "default_866")] pub next_before_version: Option, - #[serde(default = "default_864")] + #[serde(default = "default_867")] pub total: Option, - #[serde(default = "default_865")] + #[serde(default = "default_868")] pub keys: Option>, } @@ -16995,7 +17001,7 @@ pub struct ConflictRevisionSuggestion { pub target_local_id: Integer, pub peer_local_ids: Vec, pub rationale: String, - #[serde(default = "default_867")] + #[serde(default = "default_870")] pub apply_operation: String, } @@ -17003,11 +17009,11 @@ pub struct ConflictRevisionSuggestion { #[non_exhaustive] pub struct ConflictsProposeRevisionOutput { pub found: bool, - #[serde(default = "default_866")] + #[serde(default = "default_869")] pub memories: Vec, - #[serde(default = "default_868")] + #[serde(default = "default_871")] pub suggestions: Vec, - #[serde(default = "default_869")] + #[serde(default = "default_872")] pub note: String, } @@ -17087,9 +17093,9 @@ pub struct ConflictsResolveOutput { pub resolved: bool, pub decision: ConflictsResolveOutputDecision, pub affected_memory_ids: Vec, - #[serde(default = "default_870")] + #[serde(default = "default_873")] pub resolved_at: Option, - #[serde(default = "default_871")] + #[serde(default = "default_874")] pub total: Option, } @@ -17246,9 +17252,9 @@ pub enum ConnectionEntryKind { pub struct ConnectionEntry { pub kind: ConnectionEntryKind, pub connected: bool, - #[serde(default = "default_872")] + #[serde(default = "default_875")] pub account_email: Option, - #[serde(default = "default_873")] + #[serde(default = "default_876")] pub scopes: Vec, pub connect_url: String, } @@ -17423,23 +17429,23 @@ impl ConsolidationsListInput { pub struct ContextFetchOutput { pub found: bool, pub blob_key: String, - #[serde(default = "default_874")] + #[serde(default = "default_877")] pub content: String, - #[serde(default = "default_875")] + #[serde(default = "default_878")] pub content_type: String, - #[serde(default = "default_876")] + #[serde(default = "default_879")] pub summary: String, - #[serde(default = "default_877")] + #[serde(default = "default_880")] pub total_chars: Integer, - #[serde(default = "default_878")] + #[serde(default = "default_881")] pub total_lines: Integer, - #[serde(default = "default_879")] + #[serde(default = "default_882")] pub offset: Integer, - #[serde(default = "default_880")] + #[serde(default = "default_883")] pub next_offset: Integer, - #[serde(default = "default_881")] + #[serde(default = "default_884")] pub matched_lines: Integer, - #[serde(default = "default_882")] + #[serde(default = "default_885")] pub expires_at: Option, } @@ -17733,9 +17739,9 @@ pub enum ConversationAppendOutputReason { pub struct ConversationAppendOutput { pub msg_id: String, pub ts: String, - #[serde(default = "default_883")] + #[serde(default = "default_886")] pub stored: bool, - #[serde(default = "default_884")] + #[serde(default = "default_887")] pub reason: ConversationAppendOutputReason, } @@ -17884,13 +17890,13 @@ impl ConversationAppendInput { pub struct ConversationCompactOutput { pub compacted: bool, pub messages_summarized: Integer, - #[serde(default = "default_885")] + #[serde(default = "default_888")] pub summary_msg_id: String, - #[serde(default = "default_886")] + #[serde(default = "default_889")] pub tokens_in: Integer, - #[serde(default = "default_887")] + #[serde(default = "default_890")] pub tokens_out: Integer, - #[serde(default = "default_888")] + #[serde(default = "default_891")] pub reason: String, } @@ -18154,7 +18160,7 @@ pub enum ConversationEntryRole { #[non_exhaustive] pub struct ConversationEntry { pub msg_id: String, - #[serde(default = "default_897")] + #[serde(default = "default_900")] pub agent: String, pub role: ConversationEntryRole, pub content: String, @@ -18171,25 +18177,25 @@ pub struct ConversationEntry { pub struct ConversationGetOutput { pub found: bool, pub thread_id: String, - #[serde(default = "default_889")] + #[serde(default = "default_892")] pub title: String, - #[serde(default = "default_890")] + #[serde(default = "default_893")] pub metadata: std::collections::HashMap, - #[serde(default = "default_891")] + #[serde(default = "default_894")] pub run_id: String, - #[serde(default = "default_892")] + #[serde(default = "default_895")] pub user_id: String, - #[serde(default = "default_893")] + #[serde(default = "default_896")] pub agent: String, - #[serde(default = "default_894")] + #[serde(default = "default_897")] pub created_at: Option, - #[serde(default = "default_895")] + #[serde(default = "default_898")] pub updated_at: Option, - #[serde(default = "default_896")] + #[serde(default = "default_899")] pub msg_count: Integer, - #[serde(default = "default_898")] + #[serde(default = "default_901")] pub messages: Vec, - #[serde(default = "default_899")] + #[serde(default = "default_902")] pub next_cursor: Option, } @@ -18303,7 +18309,7 @@ impl ConversationGetInput { #[non_exhaustive] pub struct ConversationListOutput { pub rows: Vec, - #[serde(default = "default_900")] + #[serde(default = "default_903")] pub next_cursor: Option, } @@ -18449,7 +18455,7 @@ pub struct SavedMessageHit { #[non_exhaustive] pub struct ConversationListSavedMessagesOutput { pub rows: Vec, - #[serde(default = "default_901")] + #[serde(default = "default_904")] pub next_cursor: Option, } @@ -18589,7 +18595,7 @@ pub struct ConversationSaveMessageOutput { pub conversation_id: String, pub message_id: String, pub indexed: bool, - #[serde(default = "default_902")] + #[serde(default = "default_905")] pub reason: ConversationSaveMessageOutputReason, pub ts: String, } @@ -18762,7 +18768,7 @@ pub struct ConversationHit { pub role: ConversationHitRole, pub content_excerpt: String, pub ts: String, - #[serde(default = "default_903")] + #[serde(default = "default_906")] pub namespace: String, } @@ -18770,7 +18776,7 @@ pub struct ConversationHit { #[non_exhaustive] pub struct ConversationSearchOutput { pub hits: Vec, - #[serde(default = "default_904")] + #[serde(default = "default_907")] pub namespaces_skipped: Vec, } @@ -19303,7 +19309,7 @@ pub struct ConversationUnsaveMessageOutput { pub conversation_id: String, pub message_id: String, pub found: bool, - #[serde(default = "default_905")] + #[serde(default = "default_908")] pub removed: bool, pub ts: String, } @@ -19376,7 +19382,7 @@ impl ConversationUnsaveMessageInput { pub struct ConversationUpdateOutput { pub updated: bool, pub thread_id: String, - #[serde(default = "default_906")] + #[serde(default = "default_909")] pub updated_at: Option, } @@ -19481,17 +19487,17 @@ impl ConversationUpdateInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct CostAgentSummaryRow { - #[serde(default = "default_907")] + #[serde(default = "default_910")] pub namespace: Option, - #[serde(default = "default_908")] + #[serde(default = "default_911")] pub agent: Option, - #[serde(default = "default_909")] + #[serde(default = "default_912")] pub day: Option, - #[serde(default = "default_910")] + #[serde(default = "default_913")] pub model: Option, - #[serde(default = "default_911")] + #[serde(default = "default_914")] pub consumer: Option, - #[serde(default = "default_912")] + #[serde(default = "default_915")] pub session_id: Option, pub turns: Integer, pub sessions: Integer, @@ -19640,18 +19646,18 @@ pub enum BudgetStatusOutputCapSource { #[non_exhaustive] pub struct BudgetStatusOutput { pub namespace: String, - #[serde(default = "default_913")] + #[serde(default = "default_916")] 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_914")] + #[serde(default = "default_917")] pub namespace_over_cap: Option, - #[serde(default = "default_915")] + #[serde(default = "default_918")] pub pct_of_cap: Option, - #[serde(default = "default_916")] + #[serde(default = "default_919")] pub namespaces_with_spend: Integer, } @@ -19724,11 +19730,11 @@ impl BudgetStatusInput { pub struct CostRecordTurnsOutput { pub recorded: Integer, pub priced: Integer, - #[serde(default = "default_917")] + #[serde(default = "default_920")] pub unpriced_models: Vec, - #[serde(default = "default_918")] + #[serde(default = "default_921")] pub cost_usd: f64, - #[serde(default = "default_919")] + #[serde(default = "default_922")] pub turns_dated_ahead: Integer, } @@ -19899,25 +19905,25 @@ impl CostRecordTurnsInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct CostSummaryRow { - #[serde(default = "default_920")] + #[serde(default = "default_923")] pub namespace: Option, - #[serde(default = "default_921")] + #[serde(default = "default_924")] pub agent: Option, - #[serde(default = "default_922")] + #[serde(default = "default_925")] pub day: Option, - #[serde(default = "default_923")] + #[serde(default = "default_926")] pub operation: Option, - #[serde(default = "default_924")] + #[serde(default = "default_927")] pub memory_key: Option, - #[serde(default = "default_925")] + #[serde(default = "default_928")] pub user_id: Option, - #[serde(default = "default_926")] + #[serde(default = "default_929")] pub model: Option, - #[serde(default = "default_927")] + #[serde(default = "default_930")] pub traffic_class: Option, - #[serde(default = "default_928")] + #[serde(default = "default_931")] pub instance_label: Option, - #[serde(default = "default_929")] + #[serde(default = "default_932")] pub build_commit: Option, pub ops: Integer, pub errors: Integer, @@ -19927,9 +19933,9 @@ pub struct CostSummaryRow { pub latency_p50_ms: f64, pub latency_p95_ms: f64, pub latency_p99_ms: f64, - #[serde(default = "default_930")] + #[serde(default = "default_933")] pub cache_hits: Integer, - #[serde(default = "default_931")] + #[serde(default = "default_934")] pub cache_saved_usd: f64, } @@ -19940,9 +19946,9 @@ pub struct CostSummaryOutput { pub total_ops: Integer, pub total_errors: Integer, pub total_cost_usd: f64, - #[serde(default = "default_932")] + #[serde(default = "default_935")] pub cache_hits: Integer, - #[serde(default = "default_933")] + #[serde(default = "default_936")] pub cache_saved_usd: f64, } @@ -20129,31 +20135,31 @@ pub enum DecisionRowStage { #[non_exhaustive] pub struct DecisionRow { pub memory_key: String, - #[serde(default = "default_934")] + #[serde(default = "default_937")] pub category: String, - #[serde(default = "default_935")] + #[serde(default = "default_938")] pub scenario: String, - #[serde(default = "default_936")] + #[serde(default = "default_939")] pub reasoning: String, - #[serde(default = "default_937")] + #[serde(default = "default_940")] pub outcome: String, - #[serde(default = "default_938")] + #[serde(default = "default_941")] pub alternatives: Vec, - #[serde(default = "default_939")] + #[serde(default = "default_942")] pub confidence: Option, - #[serde(default = "default_940")] + #[serde(default = "default_943")] pub decision_maker: String, - #[serde(default = "default_941")] + #[serde(default = "default_944")] pub run_id: String, - #[serde(default = "default_942")] + #[serde(default = "default_945")] pub realized_outcome: String, - #[serde(default = "default_943")] + #[serde(default = "default_946")] pub success: Option, - #[serde(default = "default_944")] + #[serde(default = "default_947")] pub made_at: String, - #[serde(default = "default_945")] + #[serde(default = "default_948")] pub stage: DecisionRowStage, - #[serde(default = "default_946")] + #[serde(default = "default_949")] pub similarity: f64, } @@ -20165,7 +20171,7 @@ pub struct ChainNodeRow { pub relation: String, pub direction: String, pub via: String, - #[serde(default = "default_948")] + #[serde(default = "default_951")] pub decision: Option, } @@ -20173,7 +20179,7 @@ pub struct ChainNodeRow { #[non_exhaustive] pub struct DecisionChainOutput { pub seed: String, - #[serde(default = "default_947")] + #[serde(default = "default_950")] pub seed_decision: Option, pub nodes: Vec, } @@ -20258,7 +20264,7 @@ impl DecisionChainInput { pub struct DecisionOutcomeOutput { pub memory_key: String, pub updated: bool, - #[serde(default = "default_949")] + #[serde(default = "default_952")] pub memories_credited: Integer, } @@ -20336,7 +20342,7 @@ impl DecisionOutcomeInput { #[non_exhaustive] pub struct DecisionPrecedentsOutput { pub precedents: Vec, - #[serde(default = "default_950")] + #[serde(default = "default_953")] pub embedding_model: String, } @@ -20431,11 +20437,11 @@ impl DecisionPrecedentsInput { pub struct DecisionRecordOutput { pub memory_key: String, pub record_id: String, - #[serde(default = "default_951")] + #[serde(default = "default_954")] pub superseded_prior: bool, - #[serde(default = "default_952")] + #[serde(default = "default_955")] pub edges_written: Integer, - #[serde(default = "default_953")] + #[serde(default = "default_956")] pub next: String, } @@ -20711,7 +20717,7 @@ pub enum ErasureExportOutputScopeType { pub struct ErasureExportSection { pub rows: Vec>, pub count: Integer, - #[serde(default = "default_954")] + #[serde(default = "default_957")] pub truncated: bool, } @@ -20824,17 +20830,17 @@ pub struct ErasureListRow { pub requester: String, pub status: ErasureListRowStatus, pub requested_at: String, - #[serde(default = "default_955")] + #[serde(default = "default_958")] pub completed_at: Option, - #[serde(default = "default_956")] + #[serde(default = "default_959")] pub failure_reason: String, - #[serde(default = "default_957")] + #[serde(default = "default_960")] pub steps_completed_count: Integer, - #[serde(default = "default_958")] + #[serde(default = "default_961")] pub reversals_count: Integer, - #[serde(default = "default_959")] + #[serde(default = "default_962")] pub residue_count: Integer, - #[serde(default = "default_960")] + #[serde(default = "default_963")] pub verified_at: Option, } @@ -20931,7 +20937,7 @@ pub enum ErasureRequestOutputStatus { pub struct ErasureStepResult { pub step: String, pub rows_affected: Integer, - #[serde(default = "default_961")] + #[serde(default = "default_964")] pub notes: String, } @@ -20942,21 +20948,21 @@ pub struct ErasureRequestOutput { pub status: ErasureRequestOutputStatus, pub steps: Vec, pub requested_at: String, - #[serde(default = "default_962")] + #[serde(default = "default_965")] pub completed_at: Option, - #[serde(default = "default_963")] + #[serde(default = "default_966")] pub residue_count: Integer, - #[serde(default = "default_964")] + #[serde(default = "default_967")] pub residue: std::collections::HashMap, - #[serde(default = "default_965")] + #[serde(default = "default_968")] pub verified_at: Option, - #[serde(default = "default_966")] + #[serde(default = "default_969")] pub census: Option>, - #[serde(default = "default_967")] + #[serde(default = "default_970")] pub purge: bool, - #[serde(default = "default_968")] + #[serde(default = "default_971")] pub failure_reason: String, - #[serde(default = "default_969")] + #[serde(default = "default_972")] pub steps_completed: Vec, } @@ -21068,33 +21074,33 @@ pub enum ErasureStatusOutputStatus { pub struct ErasureStatusOutput { pub found: bool, pub erasure_id: String, - #[serde(default = "default_970")] + #[serde(default = "default_973")] pub org: Option, - #[serde(default = "default_971")] + #[serde(default = "default_974")] pub scope_type: Option, - #[serde(default = "default_972")] + #[serde(default = "default_975")] pub scope_value: Option, - #[serde(default = "default_973")] + #[serde(default = "default_976")] pub requester: Option, - #[serde(default = "default_974")] + #[serde(default = "default_977")] pub status: Option, - #[serde(default = "default_975")] + #[serde(default = "default_978")] pub current_step: Option, - #[serde(default = "default_976")] + #[serde(default = "default_979")] pub requested_at: Option, - #[serde(default = "default_977")] + #[serde(default = "default_980")] pub completed_at: Option, - #[serde(default = "default_978")] + #[serde(default = "default_981")] pub failure_reason: Option, - #[serde(default = "default_979")] + #[serde(default = "default_982")] pub residue_count: Integer, - #[serde(default = "default_980")] + #[serde(default = "default_983")] pub residue: std::collections::HashMap, - #[serde(default = "default_981")] + #[serde(default = "default_984")] pub verified_at: Option, - #[serde(default = "default_982")] + #[serde(default = "default_985")] pub census: Option>, - #[serde(default = "default_983")] + #[serde(default = "default_986")] pub purge: bool, } @@ -21131,9 +21137,9 @@ pub enum ExtractionPolicyOutputScope { #[non_exhaustive] pub struct NamespacePolicy { pub namespace: String, - #[serde(default = "default_989")] + #[serde(default = "default_992")] pub updated_by: String, - #[serde(default = "default_990")] + #[serde(default = "default_993")] pub updated_at: Option, } @@ -21142,17 +21148,17 @@ pub struct NamespacePolicy { pub struct ExtractionPolicyOutput { pub org: String, pub scope: ExtractionPolicyOutputScope, - #[serde(default = "default_984")] + #[serde(default = "default_987")] pub namespace: String, - #[serde(default = "default_985")] + #[serde(default = "default_988")] pub policy: String, - #[serde(default = "default_986")] + #[serde(default = "default_989")] pub updated_by: String, - #[serde(default = "default_987")] + #[serde(default = "default_990")] pub updated_at: Option, - #[serde(default = "default_988")] - pub effective: String, #[serde(default = "default_991")] + pub effective: String, + #[serde(default = "default_994")] pub namespace_policies: Vec, } @@ -21386,13 +21392,13 @@ pub struct FactRow { pub object: String, pub co_occur: Integer, pub last_seen: String, - #[serde(default = "default_992")] + #[serde(default = "default_995")] pub provenance: String, - #[serde(default = "default_993")] + #[serde(default = "default_996")] pub source_keys: Vec, - #[serde(default = "default_994")] + #[serde(default = "default_997")] pub sources: Vec, - #[serde(default = "default_995")] + #[serde(default = "default_998")] pub stale: bool, } @@ -21400,7 +21406,7 @@ pub struct FactRow { #[non_exhaustive] pub struct FactsListOutput { pub rows: Vec, - #[serde(default = "default_996")] + #[serde(default = "default_999")] pub truncated: bool, } @@ -21619,14 +21625,14 @@ impl FactsListInput { pub struct PathEdge { pub entity_a: String, pub entity_b: String, - #[serde(default = "default_997")] + #[serde(default = "default_1000")] pub relation: String, - #[serde(default = "default_998")] + #[serde(default = "default_1001")] pub direction: String, pub co_occur: Integer, - #[serde(default = "default_999")] + #[serde(default = "default_1002")] pub valid_from: Option, - #[serde(default = "default_1000")] + #[serde(default = "default_1003")] pub valid_to: Option, } @@ -21857,23 +21863,23 @@ pub struct TraversalNode { pub hop: Integer, pub cumulative_weight: f64, pub via_co_occur: Integer, - #[serde(default = "default_1002")] + #[serde(default = "default_1005")] pub hub: bool, - #[serde(default = "default_1003")] + #[serde(default = "default_1006")] pub degree: Integer, - #[serde(default = "default_1004")] + #[serde(default = "default_1007")] pub via_relation: String, - #[serde(default = "default_1005")] + #[serde(default = "default_1008")] pub via_direction: String, - #[serde(default = "default_1006")] + #[serde(default = "default_1009")] pub via_provenance: String, - #[serde(default = "default_1007")] + #[serde(default = "default_1010")] pub valid_from: String, - #[serde(default = "default_1008")] + #[serde(default = "default_1011")] pub valid_to: String, - #[serde(default = "default_1009")] + #[serde(default = "default_1012")] pub community_id: Option, - #[serde(default = "default_1010")] + #[serde(default = "default_1013")] pub path: Vec, } @@ -21881,12 +21887,12 @@ pub struct TraversalNode { #[non_exhaustive] pub struct FactsTraverseOutput { pub seed: String, - #[serde(default = "default_1001")] + #[serde(default = "default_1004")] pub seed_community_id: Option, pub nodes: Vec, - #[serde(default = "default_1011")] + #[serde(default = "default_1014")] pub truncated: bool, - #[serde(default = "default_1012")] + #[serde(default = "default_1015")] pub hubs: Vec, } @@ -22095,7 +22101,7 @@ pub struct GrantsApproveOutput { pub subject: String, pub namespace: String, pub decision: GrantsApproveOutputDecision, - #[serde(default = "default_1013")] + #[serde(default = "default_1016")] pub role: Option, pub decided_at: String, } @@ -22374,9 +22380,9 @@ pub struct GrantEntry { #[non_exhaustive] pub struct GrantsListOutput { pub rows: Vec, - #[serde(default = "default_1014")] + #[serde(default = "default_1017")] pub next_cursor: Option, - #[serde(default = "default_1015")] + #[serde(default = "default_1018")] pub truncated: bool, } @@ -22492,12 +22498,12 @@ pub enum PendingForMeEntryRequestedRole { #[non_exhaustive] pub struct PendingForMeEntry { pub namespace: String, - #[serde(default = "default_1016")] + #[serde(default = "default_1019")] pub kind: String, pub subject: String, pub current_role: PendingForMeEntryCurrentRole, pub requested_role: PendingForMeEntryRequestedRole, - #[serde(default = "default_1017")] + #[serde(default = "default_1020")] pub pending_since: Option, } @@ -22556,7 +22562,7 @@ impl GrantsPendingForMeInput { #[non_exhaustive] pub struct GrantsRevokeOutput { pub revoked: bool, - #[serde(default = "default_1018")] + #[serde(default = "default_1021")] pub revoked_at: Option, } @@ -22686,7 +22692,7 @@ impl GrantsShareAgentInput { #[non_exhaustive] pub struct GrantsUnshareAgentOutput { pub revoked: bool, - #[serde(default = "default_1019")] + #[serde(default = "default_1022")] pub revoked_at: Option, } @@ -22746,7 +22752,7 @@ pub enum HelpGetOutputAudience { pub struct HelpOutlineEntry { pub section: String, pub anchor: String, - #[serde(default = "default_1027")] + #[serde(default = "default_1030")] pub heading: String, } @@ -22756,21 +22762,21 @@ pub struct HelpGetOutput { pub available: bool, pub found: bool, pub path: String, - #[serde(default = "default_1020")] + #[serde(default = "default_1023")] pub title: String, - #[serde(default = "default_1021")] + #[serde(default = "default_1024")] pub section: String, - #[serde(default = "default_1022")] + #[serde(default = "default_1025")] pub anchor: String, - #[serde(default = "default_1023")] + #[serde(default = "default_1026")] pub audience: HelpGetOutputAudience, - #[serde(default = "default_1024")] + #[serde(default = "default_1027")] pub text: String, - #[serde(default = "default_1025")] + #[serde(default = "default_1028")] pub truncated: bool, - #[serde(default = "default_1026")] + #[serde(default = "default_1029")] pub next_offset: Integer, - #[serde(default = "default_1028")] + #[serde(default = "default_1031")] pub sections: Vec, } @@ -22915,21 +22921,21 @@ pub struct InboxPayload { pub inbox: String, pub owner_agent: String, pub owner_namespace: String, - #[serde(default = "default_1029")] + #[serde(default = "default_1032")] pub description: String, - #[serde(default = "default_1030")] + #[serde(default = "default_1033")] pub posters: Vec, - #[serde(default = "default_1031")] + #[serde(default = "default_1034")] 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_1032")] + #[serde(default = "default_1035")] pub webhook_url: String, - #[serde(default = "default_1033")] + #[serde(default = "default_1036")] pub created_by: String, - #[serde(default = "default_1034")] + #[serde(default = "default_1037")] pub owner_subject: String, pub created_at: String, pub updated_at: String, @@ -23039,9 +23045,9 @@ pub struct PolicyPayload { pub poster: String, pub kind: String, pub mode: PolicyPayloadMode, - #[serde(default = "default_1035")] + #[serde(default = "default_1038")] pub require_evidence: Vec, - #[serde(default = "default_1036")] + #[serde(default = "default_1039")] pub set_by: String, pub set_at: String, pub version: Integer, @@ -23111,7 +23117,7 @@ impl InboxPolicyListInput { pub struct InboxPolicySetOutput { #[serde(deserialize_with = "required_nullable")] pub policy: Option, - #[serde(default = "default_1037")] + #[serde(default = "default_1040")] pub removed: bool, } @@ -23240,15 +23246,15 @@ pub struct Principal { pub subject: String, pub label: String, pub kind: PrincipalKind, - #[serde(default = "default_1038")] + #[serde(default = "default_1041")] pub namespaces: Vec, - #[serde(default = "default_1039")] + #[serde(default = "default_1042")] pub roles: Vec, - #[serde(default = "default_1040")] + #[serde(default = "default_1043")] pub last_seen: Option, - #[serde(default = "default_1041")] + #[serde(default = "default_1044")] pub can_already_post: bool, - #[serde(default = "default_1042")] + #[serde(default = "default_1045")] pub listed: bool, } @@ -23610,15 +23616,15 @@ pub struct AnalysisColumn { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct InsightsQueryOutput { - #[serde(default = "default_1043")] + #[serde(default = "default_1046")] pub columns: Vec, - #[serde(default = "default_1044")] + #[serde(default = "default_1047")] pub rows: Vec>, - #[serde(default = "default_1045")] + #[serde(default = "default_1048")] pub row_count: Integer, - #[serde(default = "default_1046")] + #[serde(default = "default_1049")] pub truncated: bool, - #[serde(default = "default_1047")] + #[serde(default = "default_1050")] pub sql_digest: String, } @@ -23917,32 +23923,32 @@ pub struct DatasetOut { pub dataset_id: String, pub source_uri: String, pub name: String, - #[serde(default = "default_1048")] + #[serde(default = "default_1051")] pub sheet: String, - #[serde(default = "default_1049")] + #[serde(default = "default_1052")] pub row_start: Integer, - #[serde(default = "default_1050")] + #[serde(default = "default_1053")] pub row_end: Integer, pub revision: Integer, pub snapshot_id: String, pub schema_state: String, pub columns: Vec, - #[serde(default = "default_1051")] + #[serde(default = "default_1054")] pub clarifications: Vec, pub row_count: Integer, - #[serde(default = "default_1052")] + #[serde(default = "default_1055")] pub rejected_rows: Integer, - #[serde(default = "default_1053")] + #[serde(default = "default_1056")] pub rejected: Vec, - #[serde(default = "default_1054")] + #[serde(default = "default_1057")] pub complete: bool, - #[serde(default = "default_1055")] + #[serde(default = "default_1058")] pub approved_by: String, - #[serde(default = "default_1056")] + #[serde(default = "default_1059")] pub approved_at: Option, - #[serde(default = "default_1057")] + #[serde(default = "default_1060")] pub created_at: Option, - #[serde(default = "default_1058")] + #[serde(default = "default_1061")] pub rows: Vec>, } @@ -23950,9 +23956,9 @@ pub struct DatasetOut { #[non_exhaustive] pub struct KnowledgeDatasetApproveOutput { pub found: bool, - #[serde(default = "default_1059")] + #[serde(default = "default_1062")] pub dataset: Option, - #[serde(default = "default_1060")] + #[serde(default = "default_1063")] pub retyped: bool, } @@ -24046,9 +24052,9 @@ impl KnowledgeDatasetApproveInput { #[non_exhaustive] pub struct KnowledgeDatasetGetOutput { pub found: bool, - #[serde(default = "default_1061")] + #[serde(default = "default_1064")] pub revision: Integer, - #[serde(default = "default_1062")] + #[serde(default = "default_1065")] pub datasets: Vec, } @@ -24121,7 +24127,7 @@ impl KnowledgeDatasetGetInput { pub struct KnowledgeDocCluster { pub content_sha256: String, pub doc_count: Integer, - #[serde(default = "default_1063")] + #[serde(default = "default_1066")] pub docs: Vec>, } @@ -24131,16 +24137,16 @@ pub struct KnowledgeChunkCluster { pub content_sha256: String, pub chunk_count: Integer, pub uri_count: Integer, - #[serde(default = "default_1065")] + #[serde(default = "default_1068")] pub samples: Vec>, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeDedupListOutput { - #[serde(default = "default_1064")] + #[serde(default = "default_1067")] pub doc_clusters: Vec, - #[serde(default = "default_1066")] + #[serde(default = "default_1069")] pub chunk_clusters: Vec, } @@ -24217,7 +24223,7 @@ pub struct KnowledgeDedupResolveOutput { pub canonical_uri: String, pub duplicate_uri: String, pub decision: String, - #[serde(default = "default_1067")] + #[serde(default = "default_1070")] pub superseded_uri: String, } @@ -24336,24 +24342,24 @@ impl KnowledgeDeleteInput { #[non_exhaustive] pub struct KnowledgeFormat { pub format: String, - #[serde(default = "default_1068")] + #[serde(default = "default_1071")] pub extensions: Vec, - #[serde(default = "default_1069")] + #[serde(default = "default_1072")] pub media_types: Vec, - #[serde(default = "default_1070")] + #[serde(default = "default_1073")] pub available: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeFormatsOutput { - #[serde(default = "default_1071")] + #[serde(default = "default_1074")] pub formats: Vec, - #[serde(default = "default_1072")] + #[serde(default = "default_1075")] pub max_upload_bytes: Integer, - #[serde(default = "default_1073")] + #[serde(default = "default_1076")] pub refused_extensions: Vec, - #[serde(default = "default_1074")] + #[serde(default = "default_1077")] pub default_format: String, } @@ -24455,7 +24461,7 @@ impl KnowledgeGapsDraftInput { pub struct KnowledgeGap { pub gap_id: String, pub head: String, - #[serde(default = "default_1075")] + #[serde(default = "default_1078")] pub samples: Vec, pub askers: Integer, pub asks: Integer, @@ -24465,13 +24471,13 @@ pub struct KnowledgeGap { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeGapsListOutput { - #[serde(default = "default_1076")] + #[serde(default = "default_1079")] pub gaps: Vec, - #[serde(default = "default_1077")] + #[serde(default = "default_1080")] pub built_at: Option, - #[serde(default = "default_1078")] + #[serde(default = "default_1081")] pub capturing: Option, - #[serde(default = "default_1079")] + #[serde(default = "default_1082")] pub enabled: bool, } @@ -24537,7 +24543,7 @@ pub struct KnowledgeIngestOutput { pub ingestion_id: String, pub state: String, pub source_uri: String, - #[serde(default = "default_1080")] + #[serde(default = "default_1083")] pub namespace: String, } @@ -24756,9 +24762,9 @@ impl KnowledgeIngestInput { #[non_exhaustive] pub struct KnowledgeIngestCancelOutput { pub found: bool, - #[serde(default = "default_1081")] + #[serde(default = "default_1084")] pub state: String, - #[serde(default = "default_1082")] + #[serde(default = "default_1085")] pub cancelled: bool, } @@ -24809,39 +24815,39 @@ impl KnowledgeIngestCancelInput { pub struct KnowledgeIngestStatusOutput { pub found: bool, pub ingestion_id: String, - #[serde(default = "default_1083")] + #[serde(default = "default_1086")] pub source_uri: String, - #[serde(default = "default_1084")] + #[serde(default = "default_1087")] pub state: String, - #[serde(default = "default_1085")] + #[serde(default = "default_1088")] pub stage: String, - #[serde(default = "default_1086")] + #[serde(default = "default_1089")] pub attempts: Integer, - #[serde(default = "default_1087")] + #[serde(default = "default_1090")] pub error_code: String, - #[serde(default = "default_1088")] + #[serde(default = "default_1091")] pub error_message: String, - #[serde(default = "default_1089")] + #[serde(default = "default_1092")] pub format: String, - #[serde(default = "default_1090")] + #[serde(default = "default_1093")] pub coverage: Option>, - #[serde(default = "default_1091")] + #[serde(default = "default_1094")] pub warnings: Vec, - #[serde(default = "default_1092")] + #[serde(default = "default_1095")] pub chunks: Integer, - #[serde(default = "default_1093")] + #[serde(default = "default_1096")] pub revision: Integer, - #[serde(default = "default_1094")] + #[serde(default = "default_1097")] pub expected_revision: Option, - #[serde(default = "default_1095")] + #[serde(default = "default_1098")] pub filename: String, - #[serde(default = "default_1096")] + #[serde(default = "default_1099")] pub retrieval: String, - #[serde(default = "default_1097")] + #[serde(default = "default_1100")] pub cancel_requested: bool, - #[serde(default = "default_1098")] + #[serde(default = "default_1101")] pub created_at: Option, - #[serde(default = "default_1099")] + #[serde(default = "default_1102")] pub updated_at: Option, } @@ -24898,21 +24904,21 @@ pub struct DocumentCount { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct DocumentTotals { - #[serde(default = "default_1100")] + #[serde(default = "default_1103")] pub live: Option, - #[serde(default = "default_1101")] + #[serde(default = "default_1104")] pub deleted: Option, - #[serde(default = "default_1102")] + #[serde(default = "default_1105")] pub newest_ingested_at: Option, - #[serde(default = "default_1103")] + #[serde(default = "default_1106")] pub by_format: Vec, - #[serde(default = "default_1104")] + #[serde(default = "default_1107")] pub by_source_scheme: Vec, - #[serde(default = "default_1105")] + #[serde(default = "default_1108")] pub earlier_revisions: Option, - #[serde(default = "default_1106")] + #[serde(default = "default_1109")] pub unnumbered: Option, - #[serde(default = "default_1107")] + #[serde(default = "default_1110")] pub retired_versions: Option, } @@ -24927,15 +24933,15 @@ pub struct ChunkModelCount { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ChunkTotals { - #[serde(default = "default_1108")] + #[serde(default = "default_1111")] pub embedder_model: String, - #[serde(default = "default_1109")] + #[serde(default = "default_1112")] pub live: Option, - #[serde(default = "default_1110")] + #[serde(default = "default_1113")] pub searchable: Option, - #[serde(default = "default_1111")] + #[serde(default = "default_1114")] pub unembedded: Option, - #[serde(default = "default_1112")] + #[serde(default = "default_1115")] pub by_model: Vec, } @@ -24960,9 +24966,9 @@ pub struct DocumentDecisions { #[non_exhaustive] pub struct DecisionTotals { pub definition: String, - #[serde(default = "default_1113")] + #[serde(default = "default_1116")] pub refs: Vec, - #[serde(default = "default_1114")] + #[serde(default = "default_1117")] pub all_documents: Option, } @@ -24977,7 +24983,7 @@ pub struct DocumentChunks { pub min_chars: Integer, pub median_chars: Integer, pub max_chars: Integer, - #[serde(default = "default_1117")] + #[serde(default = "default_1120")] pub models: Vec, } @@ -25027,11 +25033,11 @@ pub struct IngestJob { pub failure_class: IngestJobFailureClass, pub queued_at: String, pub updated_at: String, - #[serde(default = "default_1122")] + #[serde(default = "default_1125")] pub ended_at: Option, - #[serde(default = "default_1123")] + #[serde(default = "default_1126")] pub next_attempt_at: Option, - #[serde(default = "default_1124")] + #[serde(default = "default_1127")] pub stalled: bool, } @@ -25041,11 +25047,11 @@ pub struct SourceJobs { pub source_uri: String, pub jobs: Integer, pub open_jobs: Integer, - #[serde(default = "default_1121")] + #[serde(default = "default_1124")] pub open_ingestion_id: String, pub latest: IngestJob, pub current: IngestJob, - #[serde(default = "default_1125")] + #[serde(default = "default_1128")] pub replaced: bool, } @@ -25058,18 +25064,18 @@ pub struct InspectDocument { pub source_scheme: String, pub version: Integer, pub revision: Integer, - #[serde(default = "default_1115")] + #[serde(default = "default_1118")] pub ingestion_id: String, pub ingested_at: String, - #[serde(default = "default_1116")] + #[serde(default = "default_1119")] pub retired_versions: Option, - #[serde(default = "default_1118")] + #[serde(default = "default_1121")] pub chunks: Option, - #[serde(default = "default_1119")] + #[serde(default = "default_1122")] pub decisions: Option, - #[serde(default = "default_1120")] + #[serde(default = "default_1123")] pub extraction: Option, - #[serde(default = "default_1126")] + #[serde(default = "default_1129")] pub jobs: Option, } @@ -25114,40 +25120,40 @@ pub struct DocumentFinding { pub kind: DocumentFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_1129")] + #[serde(default = "default_1132")] pub window_seconds: Option, - #[serde(default = "default_1130")] + #[serde(default = "default_1133")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_1131")] + #[serde(default = "default_1134")] pub evidence: Vec, - #[serde(default = "default_1132")] + #[serde(default = "default_1135")] pub exceptions: String, - #[serde(default = "default_1133")] + #[serde(default = "default_1136")] pub uncertainty: String, pub code: String, pub severity: DocumentFindingSeverity, pub count: Integer, pub share: f64, - #[serde(default = "default_1134")] + #[serde(default = "default_1137")] pub samples: Vec, - #[serde(default = "default_1135")] + #[serde(default = "default_1138")] pub ingested: Integer, - #[serde(default = "default_1136")] + #[serde(default = "default_1139")] pub ingested_samples: Vec, pub detail: String, pub remedy: String, - #[serde(default = "default_1137")] + #[serde(default = "default_1140")] pub refs: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ReportCoverage { - #[serde(default = "default_1139")] + #[serde(default = "default_1142")] pub rules_run: Vec, - #[serde(default = "default_1140")] + #[serde(default = "default_1143")] pub rules_skipped: Vec, pub complete: bool, } @@ -25155,43 +25161,43 @@ pub struct ReportCoverage { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct IngestionTotals { - #[serde(default = "default_1141")] + #[serde(default = "default_1144")] pub sources: Option, - #[serde(default = "default_1142")] + #[serde(default = "default_1145")] pub without_document: Option, - #[serde(default = "default_1143")] + #[serde(default = "default_1146")] pub replaced: Option, - #[serde(default = "default_1144")] + #[serde(default = "default_1147")] pub pending: Option, - #[serde(default = "default_1145")] + #[serde(default = "default_1148")] pub processing: Option, - #[serde(default = "default_1146")] + #[serde(default = "default_1149")] pub stalled: Option, - #[serde(default = "default_1147")] + #[serde(default = "default_1150")] pub ready: Option, - #[serde(default = "default_1148")] + #[serde(default = "default_1151")] pub partial: Option, - #[serde(default = "default_1149")] + #[serde(default = "default_1152")] pub failed: Option, - #[serde(default = "default_1150")] + #[serde(default = "default_1153")] pub cancelled: Option, - #[serde(default = "default_1151")] + #[serde(default = "default_1154")] pub oldest_open_queued_at: Option, pub worker_enabled: bool, - #[serde(default = "default_1152")] + #[serde(default = "default_1155")] pub extractor_configured: Option, - #[serde(default = "default_1153")] + #[serde(default = "default_1156")] pub without_document_listed: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ExtractionTotals { - #[serde(default = "default_1154")] + #[serde(default = "default_1157")] pub documents: Option, - #[serde(default = "default_1155")] + #[serde(default = "default_1158")] pub incomplete: Option, - #[serde(default = "default_1156")] + #[serde(default = "default_1159")] pub lost: Vec, } @@ -25221,31 +25227,31 @@ pub struct IngestFinding { pub kind: IngestFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_1157")] + #[serde(default = "default_1160")] pub window_seconds: Option, - #[serde(default = "default_1158")] + #[serde(default = "default_1161")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_1159")] + #[serde(default = "default_1162")] pub evidence: Vec, - #[serde(default = "default_1160")] + #[serde(default = "default_1163")] pub exceptions: String, - #[serde(default = "default_1161")] + #[serde(default = "default_1164")] pub uncertainty: String, pub code: String, pub severity: IngestFindingSeverity, pub count: Integer, pub share: f64, - #[serde(default = "default_1162")] + #[serde(default = "default_1165")] pub samples: Vec, - #[serde(default = "default_1163")] + #[serde(default = "default_1166")] pub ingestion_ids: Vec, - #[serde(default = "default_1164")] + #[serde(default = "default_1167")] pub without_document: Integer, pub detail: String, pub remedy: String, - #[serde(default = "default_1165")] + #[serde(default = "default_1168")] pub refs: Vec, } @@ -25272,20 +25278,20 @@ pub struct KnowledgeInspectOutput { pub documents: DocumentTotals, pub chunks: ChunkTotals, pub decisions: DecisionTotals, - #[serde(default = "default_1127")] + #[serde(default = "default_1130")] pub listed: Vec, - #[serde(default = "default_1128")] + #[serde(default = "default_1131")] pub listed_complete: bool, - #[serde(default = "default_1138")] + #[serde(default = "default_1141")] pub findings: Vec, pub coverage: ReportCoverage, pub ingestions: IngestionTotals, pub extraction: ExtractionTotals, - #[serde(default = "default_1166")] + #[serde(default = "default_1169")] pub ingest_findings: Vec, - #[serde(default = "default_1167")] + #[serde(default = "default_1170")] pub memory_findings: Vec, - #[serde(default = "default_1168")] + #[serde(default = "default_1171")] pub skipped: Vec, } @@ -25432,7 +25438,7 @@ pub struct KnowledgeListEntry { #[non_exhaustive] pub struct KnowledgeListOutput { pub rows: Vec, - #[serde(default = "default_1169")] + #[serde(default = "default_1172")] pub next_cursor: Option, } @@ -25598,9 +25604,9 @@ pub enum KnowledgeMoveResultReason { #[non_exhaustive] pub struct KnowledgeMoveResult { pub source_uri: String, - #[serde(default = "default_1171")] + #[serde(default = "default_1174")] pub moved: bool, - #[serde(default = "default_1172")] + #[serde(default = "default_1175")] pub reason: KnowledgeMoveResultReason, } @@ -25608,9 +25614,9 @@ pub struct KnowledgeMoveResult { #[non_exhaustive] pub struct KnowledgeMoveOutput { pub found: bool, - #[serde(default = "default_1170")] - pub to_namespace: String, #[serde(default = "default_1173")] + pub to_namespace: String, + #[serde(default = "default_1176")] pub results: Vec, } @@ -25676,17 +25682,17 @@ pub struct OutlineEntry { pub struct KnowledgeOutlineOutput { pub found: bool, pub source_uri: String, - #[serde(default = "default_1174")] + #[serde(default = "default_1177")] pub title: String, - #[serde(default = "default_1175")] + #[serde(default = "default_1178")] pub structured: bool, - #[serde(default = "default_1176")] + #[serde(default = "default_1179")] pub chunk_count: Integer, - #[serde(default = "default_1177")] + #[serde(default = "default_1180")] pub sections: Vec, - #[serde(default = "default_1178")] + #[serde(default = "default_1181")] pub section_content: Option, - #[serde(default = "default_1179")] + #[serde(default = "default_1182")] pub section_chunk_idxs: Vec, } @@ -25793,12 +25799,12 @@ pub struct QueryReceipt { pub struct KnowledgeQueryOutput { pub columns: Vec, pub rows: Vec>, - #[serde(default = "default_1180")] + #[serde(default = "default_1183")] pub row_ids: Vec>, - #[serde(default = "default_1181")] + #[serde(default = "default_1184")] pub truncated: bool, pub complete: bool, - #[serde(default = "default_1182")] + #[serde(default = "default_1185")] pub incomplete: Vec, pub receipt: QueryReceipt, } @@ -26471,9 +26477,9 @@ pub struct QueryHistoryListOutputQueryHistorySource { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct QueryHistoryListOutput { - #[serde(default = "default_1183")] + #[serde(default = "default_1186")] pub enabled: bool, - #[serde(default = "default_1184")] + #[serde(default = "default_1187")] pub sources: Vec, } @@ -26604,7 +26610,7 @@ impl QueryHistoryRemoveInput { #[non_exhaustive] pub struct KnowledgeReadsOutput { pub window_days: Integer, - #[serde(default = "default_1185")] + #[serde(default = "default_1188")] pub reads: Vec>, } @@ -26707,15 +26713,15 @@ pub enum KnowledgeRestoreOutputOriginal { #[non_exhaustive] pub struct KnowledgeRestoreOutput { pub restored: bool, - #[serde(default = "default_1186")] + #[serde(default = "default_1189")] pub reason: KnowledgeRestoreOutputReason, - #[serde(default = "default_1187")] + #[serde(default = "default_1190")] pub doc_id: String, - #[serde(default = "default_1188")] + #[serde(default = "default_1191")] pub revision: Option, - #[serde(default = "default_1189")] + #[serde(default = "default_1192")] pub chunks_restored: Integer, - #[serde(default = "default_1190")] + #[serde(default = "default_1193")] pub original: KnowledgeRestoreOutputOriginal, } @@ -26779,15 +26785,15 @@ impl KnowledgeRestoreInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceProbe { - #[serde(default = "default_1194")] + #[serde(default = "default_1197")] pub documents: Integer, - #[serde(default = "default_1195")] + #[serde(default = "default_1198")] pub more: bool, - #[serde(default = "default_1196")] + #[serde(default = "default_1199")] pub sample: Vec, - #[serde(default = "default_1197")] + #[serde(default = "default_1200")] pub checked: Integer, - #[serde(default = "default_1198")] + #[serde(default = "default_1201")] pub sampled: bool, } @@ -26797,15 +26803,15 @@ pub struct KnowledgeSourceAddOutput { pub name: String, pub kind: String, pub namespace: String, - #[serde(default = "default_1191")] + #[serde(default = "default_1194")] pub items: Vec>, - #[serde(default = "default_1192")] + #[serde(default = "default_1195")] pub include: Vec, - #[serde(default = "default_1193")] + #[serde(default = "default_1196")] pub config: std::collections::HashMap, - #[serde(default = "default_1199")] + #[serde(default = "default_1202")] pub probe: KnowledgeSourceProbe, - #[serde(default = "default_1200")] + #[serde(default = "default_1203")] pub dry_run: bool, } @@ -26962,21 +26968,21 @@ impl KnowledgeSourceAddInput { #[non_exhaustive] pub struct KnowledgeSourceCheckOutput { pub name: String, - #[serde(default = "default_1201")] + #[serde(default = "default_1204")] pub reachable: bool, - #[serde(default = "default_1202")] + #[serde(default = "default_1205")] pub documents: Integer, - #[serde(default = "default_1203")] + #[serde(default = "default_1206")] pub more: bool, - #[serde(default = "default_1204")] + #[serde(default = "default_1207")] pub sample: Vec, - #[serde(default = "default_1205")] + #[serde(default = "default_1208")] pub checked: Integer, - #[serde(default = "default_1206")] + #[serde(default = "default_1209")] pub sampled: bool, - #[serde(default = "default_1207")] + #[serde(default = "default_1210")] pub summary: String, - #[serde(default = "default_1208")] + #[serde(default = "default_1211")] pub checked_at: String, } @@ -27025,37 +27031,37 @@ impl KnowledgeSourceCheckInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceSync { - #[serde(default = "default_1217")] + #[serde(default = "default_1220")] pub requested_at: String, - #[serde(default = "default_1218")] + #[serde(default = "default_1221")] pub last_synced_at: String, - #[serde(default = "default_1219")] + #[serde(default = "default_1222")] pub status: String, - #[serde(default = "default_1220")] + #[serde(default = "default_1223")] pub documents_seen: Integer, - #[serde(default = "default_1221")] + #[serde(default = "default_1224")] pub changed: Integer, - #[serde(default = "default_1222")] + #[serde(default = "default_1225")] pub removed: Integer, - #[serde(default = "default_1223")] + #[serde(default = "default_1226")] pub unconverted: Integer, - #[serde(default = "default_1224")] + #[serde(default = "default_1227")] pub unconverted_reasons: std::collections::HashMap, - #[serde(default = "default_1225")] + #[serde(default = "default_1228")] pub skipped: Integer, - #[serde(default = "default_1226")] + #[serde(default = "default_1229")] pub error: String, - #[serde(default = "default_1227")] + #[serde(default = "default_1230")] pub pending_extract: Integer, - #[serde(default = "default_1228")] + #[serde(default = "default_1231")] pub last_extracted_at: String, - #[serde(default = "default_1229")] + #[serde(default = "default_1232")] pub extracted: Integer, - #[serde(default = "default_1230")] + #[serde(default = "default_1233")] pub flagged_pinned: Integer, - #[serde(default = "default_1231")] + #[serde(default = "default_1234")] pub unextracted: Integer, - #[serde(default = "default_1232")] + #[serde(default = "default_1235")] pub extract_error: String, } @@ -27063,11 +27069,11 @@ pub struct KnowledgeSourceSync { #[non_exhaustive] pub struct KnowledgeSourceDocument { pub source_uri: String, - #[serde(default = "default_1234")] + #[serde(default = "default_1237")] pub title: String, - #[serde(default = "default_1235")] + #[serde(default = "default_1238")] pub source_revision: String, - #[serde(default = "default_1236")] + #[serde(default = "default_1239")] pub ingested_at: String, } @@ -27076,25 +27082,25 @@ pub struct KnowledgeSourceDocument { pub struct KnowledgeSourceInspectOutput { pub name: String, pub kind: String, - #[serde(default = "default_1209")] + #[serde(default = "default_1212")] pub credential_mode: String, - #[serde(default = "default_1210")] + #[serde(default = "default_1213")] pub access: String, - #[serde(default = "default_1211")] + #[serde(default = "default_1214")] pub owner_subject: String, - #[serde(default = "default_1212")] + #[serde(default = "default_1215")] pub items: Vec>, - #[serde(default = "default_1213")] + #[serde(default = "default_1216")] pub include: Vec, - #[serde(default = "default_1214")] + #[serde(default = "default_1217")] pub config: std::collections::HashMap, - #[serde(default = "default_1215")] + #[serde(default = "default_1218")] pub created_by: String, - #[serde(default = "default_1216")] + #[serde(default = "default_1219")] pub created_at: String, - #[serde(default = "default_1233")] + #[serde(default = "default_1236")] pub sync: KnowledgeSourceSync, - #[serde(default = "default_1237")] + #[serde(default = "default_1240")] pub documents: Vec, } @@ -27147,34 +27153,34 @@ impl KnowledgeSourceInspectInput { pub struct KnowledgeSourceEntry { pub name: String, pub kind: String, - #[serde(default = "default_1238")] + #[serde(default = "default_1241")] pub credential_mode: String, - #[serde(default = "default_1239")] + #[serde(default = "default_1242")] pub access: String, - #[serde(default = "default_1240")] + #[serde(default = "default_1243")] pub owner_subject: String, - #[serde(default = "default_1241")] + #[serde(default = "default_1244")] pub items: Vec>, - #[serde(default = "default_1242")] + #[serde(default = "default_1245")] pub include: Vec, - #[serde(default = "default_1243")] + #[serde(default = "default_1246")] pub config: std::collections::HashMap, - #[serde(default = "default_1244")] + #[serde(default = "default_1247")] pub created_by: String, - #[serde(default = "default_1245")] + #[serde(default = "default_1248")] pub created_at: String, - #[serde(default = "default_1246")] + #[serde(default = "default_1249")] pub sync: KnowledgeSourceSync, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceListOutput { - #[serde(default = "default_1247")] + #[serde(default = "default_1250")] pub sources: Vec, - #[serde(default = "default_1248")] + #[serde(default = "default_1251")] pub enabled: bool, - #[serde(default = "default_1249")] + #[serde(default = "default_1252")] pub accepts_sources: bool, } @@ -27227,18 +27233,18 @@ impl KnowledgeSourceListInput { #[non_exhaustive] pub struct KnowledgeSourceParsedLink { pub link: String, - #[serde(default = "default_1250")] + #[serde(default = "default_1253")] pub kind: String, - #[serde(default = "default_1251")] + #[serde(default = "default_1254")] pub item: std::collections::HashMap, - #[serde(default = "default_1252")] + #[serde(default = "default_1255")] pub unreadable: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct KnowledgeSourceParseLinksOutput { - #[serde(default = "default_1253")] + #[serde(default = "default_1256")] pub links: Vec, } @@ -27289,25 +27295,25 @@ impl KnowledgeSourceParseLinksInput { #[derive(Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct PushStatusOutput { - #[serde(default = "default_1254")] + #[serde(default = "default_1257")] pub enabled: bool, - #[serde(default = "default_1255")] + #[serde(default = "default_1258")] pub status: String, - #[serde(default = "default_1256")] + #[serde(default = "default_1259")] pub provider: String, - #[serde(default = "default_1257")] + #[serde(default = "default_1260")] pub generation: String, - #[serde(default = "default_1258")] + #[serde(default = "default_1261")] pub callback_url: String, - #[serde(default = "default_1259")] + #[serde(default = "default_1262")] pub provider_id: String, - #[serde(default = "default_1260")] + #[serde(default = "default_1263")] pub challenge_fingerprint: String, - #[serde(default = "default_1261")] + #[serde(default = "default_1264")] pub verification_token: String, - #[serde(default = "default_1262")] + #[serde(default = "default_1265")] pub channels: Integer, - #[serde(default = "default_1263")] + #[serde(default = "default_1266")] pub expires_at: f64, } impl std::fmt::Debug for PushStatusOutput { @@ -27552,7 +27558,7 @@ impl PushStatusInput { #[non_exhaustive] pub struct KnowledgeSourceRemoveOutput { pub name: String, - #[serde(default = "default_1264")] + #[serde(default = "default_1267")] pub documents_pending: Integer, } @@ -27615,9 +27621,9 @@ impl KnowledgeSourceRemoveInput { #[non_exhaustive] pub struct KnowledgeSourceRotateOutput { pub name: String, - #[serde(default = "default_1265")] + #[serde(default = "default_1268")] pub probe: KnowledgeSourceProbe, - #[serde(default = "default_1266")] + #[serde(default = "default_1269")] pub rotated_at: String, } @@ -27669,7 +27675,7 @@ impl KnowledgeSourceRotateInput { #[non_exhaustive] pub struct KnowledgeSourceSyncNowOutput { pub name: String, - #[serde(default = "default_1267")] + #[serde(default = "default_1270")] pub enabled: bool, } @@ -27732,17 +27738,17 @@ impl KnowledgeSourceSyncNowInput { #[non_exhaustive] pub struct KnowledgeSourceUpdateOutput { pub name: String, - #[serde(default = "default_1268")] + #[serde(default = "default_1271")] pub items: Vec>, - #[serde(default = "default_1269")] + #[serde(default = "default_1272")] pub include: Vec, - #[serde(default = "default_1270")] + #[serde(default = "default_1273")] pub config: std::collections::HashMap, - #[serde(default = "default_1271")] + #[serde(default = "default_1274")] pub added: Vec>, - #[serde(default = "default_1272")] + #[serde(default = "default_1275")] pub removed: Vec>, - #[serde(default = "default_1273")] + #[serde(default = "default_1276")] pub probe: KnowledgeSourceProbe, } @@ -27858,9 +27864,9 @@ impl KnowledgeSourceUpdateInput { pub struct CitedChunk { pub source_uri: String, pub chunk_idx: Integer, - #[serde(default = "default_1275")] + #[serde(default = "default_1278")] pub revision: Integer, - #[serde(default = "default_1276")] + #[serde(default = "default_1279")] pub locator: Option>, } @@ -27869,12 +27875,12 @@ pub struct CitedChunk { pub struct SynthesizeCalculation { pub columns: Vec, pub rows: Vec>, - #[serde(default = "default_1283")] + #[serde(default = "default_1286")] pub row_ids: Vec>, - #[serde(default = "default_1284")] + #[serde(default = "default_1287")] pub truncated: bool, pub complete: bool, - #[serde(default = "default_1285")] + #[serde(default = "default_1288")] pub incomplete: Vec, pub receipt: QueryReceipt, pub citation: String, @@ -27888,23 +27894,23 @@ pub struct KnowledgeSynthesizeOutput { pub chunks_read: Integer, pub documents: Integer, pub reduce_rounds: Integer, - #[serde(default = "default_1274")] - pub citations: Vec, #[serde(default = "default_1277")] + pub citations: Vec, + #[serde(default = "default_1280")] pub cited_chunks: Vec, - #[serde(default = "default_1278")] + #[serde(default = "default_1281")] pub unsupported_citations: Vec, - #[serde(default = "default_1279")] + #[serde(default = "default_1282")] pub truncated: bool, - #[serde(default = "default_1280")] + #[serde(default = "default_1283")] pub abstain: bool, - #[serde(default = "default_1281")] + #[serde(default = "default_1284")] pub abstain_reason: String, - #[serde(default = "default_1282")] + #[serde(default = "default_1285")] pub clarification: String, - #[serde(default = "default_1286")] + #[serde(default = "default_1289")] pub calculations: Vec, - #[serde(default = "default_1287")] + #[serde(default = "default_1290")] pub model: String, } @@ -28020,13 +28026,13 @@ impl KnowledgeSynthesizeInput { #[non_exhaustive] pub struct KnowledgeUpdateMetadataOutput { pub updated: bool, - #[serde(default = "default_1288")] + #[serde(default = "default_1291")] pub title: String, - #[serde(default = "default_1289")] + #[serde(default = "default_1292")] pub description: String, - #[serde(default = "default_1290")] + #[serde(default = "default_1293")] pub tags: Vec, - #[serde(default = "default_1291")] + #[serde(default = "default_1294")] pub chunks_reindexed: Integer, } @@ -28138,13 +28144,13 @@ pub struct KnowledgeUpsertOutput { pub chunks_superseded: Integer, pub embedding_model: String, pub embedding_dim: Integer, - #[serde(default = "default_1292")] + #[serde(default = "default_1295")] pub duplicate_of_uri: String, - #[serde(default = "default_1293")] + #[serde(default = "default_1296")] pub duplicate_chunk_count: Integer, - #[serde(default = "default_1294")] + #[serde(default = "default_1297")] pub namespace: String, - #[serde(default = "default_1295")] + #[serde(default = "default_1298")] pub source_uri: String, } @@ -28329,26 +28335,26 @@ pub struct LearningEntry { pub memory_type: String, pub proposed_value: Value, pub supporter_count: Integer, - #[serde(default = "default_1296")] + #[serde(default = "default_1299")] pub supporter_sessions: Integer, - #[serde(default = "default_1297")] + #[serde(default = "default_1300")] pub supporter_writers: Integer, pub confidence_avg: f64, pub supporters: Vec, pub rationale: String, - #[serde(default = "default_1298")] + #[serde(default = "default_1301")] pub source_kind: String, - #[serde(default = "default_1299")] + #[serde(default = "default_1302")] pub source_resource_id: String, - #[serde(default = "default_1300")] + #[serde(default = "default_1303")] pub agent: String, pub status: LearningEntryStatus, pub proposed_at: String, - #[serde(default = "default_1301")] + #[serde(default = "default_1304")] pub decided_at: Option, - #[serde(default = "default_1302")] + #[serde(default = "default_1305")] pub decided_by: String, - #[serde(default = "default_1303")] + #[serde(default = "default_1306")] pub decision_reason: String, } @@ -28551,11 +28557,11 @@ pub enum LearningsReviewOutputNewStatus { pub struct LearningsReviewOutput { pub candidate_id: String, pub new_status: LearningsReviewOutputNewStatus, - #[serde(default = "default_1304")] + #[serde(default = "default_1307")] pub promoted_to_shared: bool, - #[serde(default = "default_1305")] + #[serde(default = "default_1308")] pub promoted_to_knowledge: bool, - #[serde(default = "default_1306")] + #[serde(default = "default_1309")] pub knowledge_source_uri: String, pub decided_at: String, } @@ -28759,7 +28765,7 @@ impl MemoryAgentsListInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct AggregateRow { - #[serde(default = "default_1307")] + #[serde(default = "default_1310")] pub group: std::collections::HashMap, pub metric: f64, } @@ -28767,9 +28773,9 @@ pub struct AggregateRow { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryAggregateOutput { - #[serde(default = "default_1308")] + #[serde(default = "default_1311")] pub rows: Vec, - #[serde(default = "default_1309")] + #[serde(default = "default_1312")] pub sql_executed: String, } @@ -28937,15 +28943,15 @@ impl MemoryAggregateInput { pub struct BulkSetResult { pub memory_key: String, pub version: Integer, - #[serde(default = "default_1310")] + #[serde(default = "default_1313")] pub memory_id: String, - #[serde(default = "default_1311")] + #[serde(default = "default_1314")] pub conflict_verdict: String, - #[serde(default = "default_1312")] + #[serde(default = "default_1315")] pub peers: Vec, - #[serde(default = "default_1313")] + #[serde(default = "default_1316")] pub next: String, - #[serde(default = "default_1314")] + #[serde(default = "default_1317")] pub pinned_blocker_id: String, } @@ -28953,29 +28959,29 @@ pub struct BulkSetResult { #[non_exhaustive] pub struct MemoryBulkSetOutput { pub written: Vec, - #[serde(default = "default_1315")] + #[serde(default = "default_1318")] pub skipped_pinned: Vec, - #[serde(default = "default_1316")] + #[serde(default = "default_1319")] pub skipped_locked: Vec, - #[serde(default = "default_1317")] + #[serde(default = "default_1320")] pub skipped_blacklisted: Vec, - #[serde(default = "default_1318")] + #[serde(default = "default_1321")] pub merged: Vec, - #[serde(default = "default_1319")] + #[serde(default = "default_1322")] pub value_updates_linked: Integer, - #[serde(default = "default_1320")] + #[serde(default = "default_1323")] pub rejected_pinned: Vec, - #[serde(default = "default_1321")] + #[serde(default = "default_1324")] pub duplicates: Vec, - #[serde(default = "default_1322")] + #[serde(default = "default_1325")] pub conflicted: Vec, - #[serde(default = "default_1323")] + #[serde(default = "default_1326")] pub unchecked: Integer, - #[serde(default = "default_1324")] + #[serde(default = "default_1327")] pub retyped: Vec, - #[serde(default = "default_1325")] + #[serde(default = "default_1328")] pub identity_duplicates: std::collections::HashMap, - #[serde(default = "default_1326")] + #[serde(default = "default_1329")] pub stage_ms: std::collections::HashMap, } @@ -29125,18 +29131,18 @@ pub enum ApplyRowStatus { #[non_exhaustive] pub struct ApplyRow { pub memory_key: String, - #[serde(default = "default_1334")] + #[serde(default = "default_1337")] pub memory_id: String, - #[serde(default = "default_1335")] + #[serde(default = "default_1338")] pub agent: String, - #[serde(default = "default_1336")] + #[serde(default = "default_1339")] pub user_id: String, - #[serde(default = "default_1337")] + #[serde(default = "default_1340")] pub session_id: String, pub status: ApplyRowStatus, - #[serde(default = "default_1338")] + #[serde(default = "default_1341")] pub version: Option, - #[serde(default = "default_1339")] + #[serde(default = "default_1342")] pub detail: String, } @@ -29146,21 +29152,21 @@ pub struct MemoryApplyOutput { pub action: String, pub dry_run: bool, pub target: String, - #[serde(default = "default_1327")] + #[serde(default = "default_1330")] pub matched: Integer, - #[serde(default = "default_1328")] + #[serde(default = "default_1331")] pub applied: Integer, - #[serde(default = "default_1329")] + #[serde(default = "default_1332")] pub would_apply: Integer, - #[serde(default = "default_1330")] + #[serde(default = "default_1333")] pub refused: Integer, - #[serde(default = "default_1331")] + #[serde(default = "default_1334")] pub noop: Integer, - #[serde(default = "default_1332")] + #[serde(default = "default_1335")] pub failed: Integer, - #[serde(default = "default_1333")] + #[serde(default = "default_1336")] pub truncated: bool, - #[serde(default = "default_1340")] + #[serde(default = "default_1343")] pub rows: Vec, } @@ -29894,137 +29900,137 @@ pub enum MemoryAskOutputDeepFirst { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryAskOutput { - #[serde(default = "default_1341")] + #[serde(default = "default_1344")] pub answer: String, - #[serde(default = "default_1342")] + #[serde(default = "default_1345")] pub source: MemoryAskOutputSource, - #[serde(default = "default_1343")] + #[serde(default = "default_1346")] pub abstain: bool, - #[serde(default = "default_1344")] + #[serde(default = "default_1347")] pub abstain_reason: String, - #[serde(default = "default_1345")] + #[serde(default = "default_1348")] pub memory_keys: Vec, - #[serde(default = "default_1346")] + #[serde(default = "default_1349")] pub results: Vec, - #[serde(default = "default_1347")] + #[serde(default = "default_1350")] pub cited_sessions: Vec, - #[serde(default = "default_1348")] + #[serde(default = "default_1351")] pub next: String, - #[serde(default = "default_1349")] + #[serde(default = "default_1352")] pub synth_model: String, - #[serde(default = "default_1350")] + #[serde(default = "default_1353")] pub route_tier: MemoryAskOutputRouteTier, - #[serde(default = "default_1351")] + #[serde(default = "default_1354")] pub route_reason: String, - #[serde(default = "default_1352")] + #[serde(default = "default_1355")] pub llm_cache_hits: Integer, - #[serde(default = "default_1353")] + #[serde(default = "default_1356")] pub llm_cache_misses: Integer, - #[serde(default = "default_1354")] + #[serde(default = "default_1357")] pub llm_cache: bool, - #[serde(default = "default_1355")] + #[serde(default = "default_1358")] pub llm_cache_saved_usd: f64, - #[serde(default = "default_1356")] + #[serde(default = "default_1359")] pub temporal_consistency: Option, - #[serde(default = "default_1357")] + #[serde(default = "default_1360")] pub citation_concentration: Option, - #[serde(default = "default_1358")] + #[serde(default = "default_1361")] pub escalated: bool, - #[serde(default = "default_1359")] + #[serde(default = "default_1362")] pub gate_mode: String, - #[serde(default = "default_1360")] + #[serde(default = "default_1363")] pub gate_kept: Integer, - #[serde(default = "default_1361")] + #[serde(default = "default_1364")] pub gate_dropped: Integer, - #[serde(default = "default_1362")] + #[serde(default = "default_1365")] pub pending_extraction: Integer, - #[serde(default = "default_1363")] + #[serde(default = "default_1366")] pub pending_evidence: Integer, - #[serde(default = "default_1364")] + #[serde(default = "default_1367")] pub retrieval_query: String, - #[serde(default = "default_1365")] + #[serde(default = "default_1368")] pub facets: Vec, - #[serde(default = "default_1366")] + #[serde(default = "default_1369")] pub facet_memories_added: Integer, - #[serde(default = "default_1367")] + #[serde(default = "default_1370")] pub consistency: MemoryAskOutputConsistency, - #[serde(default = "default_1368")] + #[serde(default = "default_1371")] pub consistency_score: f64, - #[serde(default = "default_1369")] + #[serde(default = "default_1372")] pub consistency_note: String, - #[serde(default = "default_1370")] + #[serde(default = "default_1373")] pub identifier_chase_hops: Integer, - #[serde(default = "default_1371")] + #[serde(default = "default_1374")] pub identifier_chase_added: Integer, - #[serde(default = "default_1372")] + #[serde(default = "default_1375")] pub premise_conflict: String, - #[serde(default = "default_1373")] + #[serde(default = "default_1376")] pub premise_note: String, - #[serde(default = "default_1374")] + #[serde(default = "default_1377")] pub premise_verdict: String, - #[serde(default = "default_1375")] + #[serde(default = "default_1378")] pub attribution_note: String, - #[serde(default = "default_1376")] + #[serde(default = "default_1379")] pub depth: MemoryAskOutputDepth, - #[serde(default = "default_1377")] + #[serde(default = "default_1380")] pub deep_fired: bool, - #[serde(default = "default_1378")] + #[serde(default = "default_1381")] pub decomposed: Vec, - #[serde(default = "default_1379")] + #[serde(default = "default_1382")] pub decomposed_parts: Integer, - #[serde(default = "default_1380")] + #[serde(default = "default_1383")] pub superseded_dropped: Integer, - #[serde(default = "default_1381")] + #[serde(default = "default_1384")] pub stale_sentences_masked: Integer, - #[serde(default = "default_1382")] + #[serde(default = "default_1385")] pub entity_followed: Vec, - #[serde(default = "default_1383")] + #[serde(default = "default_1386")] pub when_evidence_turns: Integer, - #[serde(default = "default_1384")] + #[serde(default = "default_1387")] pub decompose_failed: Integer, - #[serde(default = "default_1385")] + #[serde(default = "default_1388")] pub pool_k: Integer, - #[serde(default = "default_1386")] + #[serde(default = "default_1389")] pub grounding: MemoryAskOutputGrounding, - #[serde(default = "default_1387")] + #[serde(default = "default_1390")] pub deep_reason: String, - #[serde(default = "default_1388")] + #[serde(default = "default_1391")] pub deep_keys: Vec, - #[serde(default = "default_1389")] + #[serde(default = "default_1392")] pub deep_chars: Integer, - #[serde(default = "default_1390")] + #[serde(default = "default_1393")] pub code_hits: Integer, - #[serde(default = "default_1391")] + #[serde(default = "default_1394")] pub pool_facts: Integer, - #[serde(default = "default_1392")] + #[serde(default = "default_1395")] pub pool_chunks: Integer, - #[serde(default = "default_1393")] + #[serde(default = "default_1396")] pub prompt_blocks: std::collections::HashMap, - #[serde(default = "default_1394")] + #[serde(default = "default_1397")] pub deep_selector: MemoryAskOutputDeepSelector, - #[serde(default = "default_1395")] + #[serde(default = "default_1398")] pub deep_first: MemoryAskOutputDeepFirst, - #[serde(default = "default_1396")] + #[serde(default = "default_1399")] pub synth_calls: Integer, - #[serde(default = "default_1397")] + #[serde(default = "default_1400")] pub synth_input_tokens: Integer, - #[serde(default = "default_1398")] + #[serde(default = "default_1401")] pub synth_cached_input_tokens: Integer, - #[serde(default = "default_1399")] + #[serde(default = "default_1402")] pub synth_cache_write_tokens: Integer, - #[serde(default = "default_1400")] + #[serde(default = "default_1403")] pub synth_cost_usd: f64, - #[serde(default = "default_1401")] + #[serde(default = "default_1404")] pub context_tokens_est: Integer, - #[serde(default = "default_1402")] + #[serde(default = "default_1405")] pub context_trimmed: Integer, - #[serde(default = "default_1403")] + #[serde(default = "default_1406")] pub summary_hits: Integer, - #[serde(default = "default_1404")] + #[serde(default = "default_1407")] pub knowledge_hits: Integer, - #[serde(default = "default_1405")] + #[serde(default = "default_1408")] pub timeline_rows: Integer, - #[serde(default = "default_1406")] + #[serde(default = "default_1409")] pub count_recomputed: bool, } @@ -30979,36 +30985,36 @@ pub struct MemoryAutoRetirement { pub reason: String, pub memory_id: String, pub memory_key: String, - #[serde(default = "default_1407")] + #[serde(default = "default_1410")] pub agent: String, - #[serde(default = "default_1408")] + #[serde(default = "default_1411")] pub user_id: String, - #[serde(default = "default_1409")] + #[serde(default = "default_1412")] pub session_id: String, - #[serde(default = "default_1410")] + #[serde(default = "default_1413")] pub superseded_by: String, - #[serde(default = "default_1411")] + #[serde(default = "default_1414")] pub superseded_by_key: String, - #[serde(default = "default_1412")] + #[serde(default = "default_1415")] pub label: String, - #[serde(default = "default_1413")] + #[serde(default = "default_1416")] pub unconfirmed: bool, - #[serde(default = "default_1414")] + #[serde(default = "default_1417")] pub judge_verdict: String, - #[serde(default = "default_1415")] + #[serde(default = "default_1418")] pub judge_confidence: Option, - #[serde(default = "default_1416")] + #[serde(default = "default_1419")] pub judge_model: String, - #[serde(default = "default_1417")] + #[serde(default = "default_1420")] pub judge_prompt_version: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryAutoRetirementsOutput { - #[serde(default = "default_1418")] + #[serde(default = "default_1421")] pub rows: Vec, - #[serde(default = "default_1419")] + #[serde(default = "default_1422")] pub next_cursor: Option, } @@ -31102,9 +31108,9 @@ impl MemoryAutoRetirementsInput { #[non_exhaustive] pub struct BacklinkVersion { pub version: Integer, - #[serde(default = "default_1421")] + #[serde(default = "default_1424")] pub status: String, - #[serde(default = "default_1422")] + #[serde(default = "default_1425")] pub created_at: String, } @@ -31112,7 +31118,7 @@ pub struct BacklinkVersion { #[non_exhaustive] pub struct BacklinkDigest { pub session_id: String, - #[serde(default = "default_1424")] + #[serde(default = "default_1427")] pub date: String, } @@ -31120,9 +31126,9 @@ pub struct BacklinkDigest { #[non_exhaustive] pub struct BacklinkEdge { pub memory_key: String, - #[serde(default = "default_1426")] + #[serde(default = "default_1429")] pub relation: String, - #[serde(default = "default_1427")] + #[serde(default = "default_1430")] pub created_at: String, } @@ -31130,7 +31136,7 @@ pub struct BacklinkEdge { #[non_exhaustive] pub struct BacklinkRelated { pub memory_key: String, - #[serde(default = "default_1431")] + #[serde(default = "default_1434")] pub shared_entities: Vec, } @@ -31138,19 +31144,19 @@ pub struct BacklinkRelated { #[non_exhaustive] pub struct MemoryBacklinksOutput { pub memory_key: String, - #[serde(default = "default_1420")] - pub found: bool, #[serde(default = "default_1423")] + pub found: bool, + #[serde(default = "default_1426")] pub versions: Vec, - #[serde(default = "default_1425")] - pub digests: Vec, #[serde(default = "default_1428")] + pub digests: Vec, + #[serde(default = "default_1431")] pub links_in: Vec, - #[serde(default = "default_1429")] + #[serde(default = "default_1432")] pub links_out: Vec, - #[serde(default = "default_1430")] + #[serde(default = "default_1433")] pub evidence_count: Integer, - #[serde(default = "default_1432")] + #[serde(default = "default_1435")] pub related: Vec, } @@ -31255,36 +31261,36 @@ impl MemoryBacklinksInput { #[non_exhaustive] pub struct BriefEvidence { pub memory_key: String, - #[serde(default = "default_1437")] + #[serde(default = "default_1440")] pub source: String, - #[serde(default = "default_1438")] + #[serde(default = "default_1441")] pub source_class: String, - #[serde(default = "default_1439")] + #[serde(default = "default_1442")] pub verified: bool, - #[serde(default = "default_1440")] + #[serde(default = "default_1443")] pub when: String, - #[serde(default = "default_1441")] + #[serde(default = "default_1444")] pub session_id: String, - #[serde(default = "default_1442")] + #[serde(default = "default_1445")] pub excerpt: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryBriefOutput { - #[serde(default = "default_1433")] + #[serde(default = "default_1436")] pub query: String, - #[serde(default = "default_1434")] + #[serde(default = "default_1437")] pub answer: String, - #[serde(default = "default_1435")] + #[serde(default = "default_1438")] pub abstained: bool, - #[serde(default = "default_1436")] + #[serde(default = "default_1439")] pub grounding: String, - #[serde(default = "default_1443")] + #[serde(default = "default_1446")] pub evidence: Vec, - #[serde(default = "default_1444")] + #[serde(default = "default_1447")] pub unknowns: Vec, - #[serde(default = "default_1445")] + #[serde(default = "default_1448")] pub next_reads: Vec, } @@ -31698,9 +31704,9 @@ pub struct MemoryBulkGetOutputMemoryGetOutput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryBulkGetOutput { - #[serde(default = "default_1446")] + #[serde(default = "default_1449")] pub results: std::collections::HashMap, - #[serde(default = "default_1447")] + #[serde(default = "default_1450")] pub missing: Vec, } @@ -32213,7 +32219,7 @@ pub struct MemoryClearOutput { pub cleared_at: String, pub rows_affected: std::collections::HashMap, pub total: Integer, - #[serde(default = "default_1448")] + #[serde(default = "default_1451")] pub locked_skipped: Integer, } @@ -32301,21 +32307,21 @@ pub struct MemoryConsolidateResult { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryConsolidateOutput { - #[serde(default = "default_1449")] + #[serde(default = "default_1452")] pub consolidated: Vec, - #[serde(default = "default_1450")] + #[serde(default = "default_1453")] pub examined: Integer, - #[serde(default = "default_1451")] + #[serde(default = "default_1454")] pub clusters_found: Integer, - #[serde(default = "default_1452")] + #[serde(default = "default_1455")] pub clusters_failed: Integer, - #[serde(default = "default_1453")] + #[serde(default = "default_1456")] pub clusters_refused_lossy: Integer, - #[serde(default = "default_1454")] + #[serde(default = "default_1457")] pub skipped_in_flight: Integer, - #[serde(default = "default_1455")] + #[serde(default = "default_1458")] pub tokens_in: Integer, - #[serde(default = "default_1456")] + #[serde(default = "default_1459")] pub tokens_out: Integer, } @@ -32456,7 +32462,7 @@ impl MemoryConsolidateInput { #[non_exhaustive] pub struct MemoryCopyToOutput { pub copied: bool, - #[serde(default = "default_1457")] + #[serde(default = "default_1460")] pub target_memory_id: String, pub target_namespace: String, pub target_key: String, @@ -32567,11 +32573,11 @@ impl MemoryCopyToInput { #[non_exhaustive] pub struct MemoryCrossPromoteOutput { pub promoted: bool, - #[serde(default = "default_1458")] + #[serde(default = "default_1461")] pub target_memory_id: String, pub target_namespace: String, pub target_key: String, - #[serde(default = "default_1459")] + #[serde(default = "default_1462")] pub cross_promoted_from_memory_id: String, } @@ -32654,23 +32660,23 @@ pub struct DedupCollapsePair { #[non_exhaustive] pub struct MemoryDedupCollapseOutput { pub namespace: String, - #[serde(default = "default_1460")] + #[serde(default = "default_1463")] pub prefix: String, - #[serde(default = "default_1461")] + #[serde(default = "default_1464")] pub dry_run: bool, - #[serde(default = "default_1462")] + #[serde(default = "default_1465")] pub pairs: Integer, - #[serde(default = "default_1463")] + #[serde(default = "default_1466")] pub canonical_live: Integer, - #[serde(default = "default_1464")] + #[serde(default = "default_1467")] pub orphans: Integer, - #[serde(default = "default_1465")] + #[serde(default = "default_1468")] pub mirror_stale: Integer, - #[serde(default = "default_1466")] + #[serde(default = "default_1469")] pub restamped: Integer, - #[serde(default = "default_1467")] + #[serde(default = "default_1470")] pub truncated: bool, - #[serde(default = "default_1468")] + #[serde(default = "default_1471")] pub sample: Vec, } @@ -32769,7 +32775,7 @@ pub struct DedupDuplicate { pub memory_id: String, pub memory_key: String, pub agent: String, - #[serde(default = "default_1471")] + #[serde(default = "default_1474")] pub created_at: Option, } @@ -32777,12 +32783,12 @@ pub struct DedupDuplicate { #[non_exhaustive] pub struct DedupCluster { pub canonical_id: String, - #[serde(default = "default_1469")] + #[serde(default = "default_1472")] pub canonical_key: String, - #[serde(default = "default_1470")] + #[serde(default = "default_1473")] pub canonical_agent: String, pub dup_count: Integer, - #[serde(default = "default_1472")] + #[serde(default = "default_1475")] pub duplicates: Vec, } @@ -32854,11 +32860,11 @@ pub struct MemoryDedupResolveOutput { pub canonical_key: String, pub duplicate_key: String, pub decision: String, - #[serde(default = "default_1473")] + #[serde(default = "default_1476")] pub canonical_tombstoned: bool, - #[serde(default = "default_1474")] + #[serde(default = "default_1477")] pub duplicate_tombstoned: bool, - #[serde(default = "default_1475")] + #[serde(default = "default_1478")] pub ignored_args: Vec, } @@ -32996,17 +33002,17 @@ pub struct LostName { pub struct DefinitionEntry { pub memory_key: String, pub promoted_at: String, - #[serde(default = "default_1476")] + #[serde(default = "default_1479")] pub capped: bool, - #[serde(default = "default_1477")] + #[serde(default = "default_1480")] pub term: Option, - #[serde(default = "default_1478")] + #[serde(default = "default_1481")] pub aliases: Vec, - #[serde(default = "default_1479")] + #[serde(default = "default_1482")] pub verdict: Option, - #[serde(default = "default_1480")] + #[serde(default = "default_1483")] pub lapse_reason: Option, - #[serde(default = "default_1481")] + #[serde(default = "default_1484")] pub lost: Vec, } @@ -33067,15 +33073,15 @@ impl MemoryDefinitionsListInput { #[non_exhaustive] pub struct MemoryDeleteVersionOutput { pub tombstoned: bool, - #[serde(default = "default_1482")] + #[serde(default = "default_1485")] pub version: Integer, - #[serde(default = "default_1483")] + #[serde(default = "default_1486")] pub found: bool, - #[serde(default = "default_1484")] + #[serde(default = "default_1487")] pub reason: String, - #[serde(default = "default_1485")] + #[serde(default = "default_1488")] pub dependents_tombstoned: Integer, - #[serde(default = "default_1486")] + #[serde(default = "default_1489")] pub dependents_downgraded: Integer, } @@ -33202,21 +33208,21 @@ pub struct DemonstrationRow { pub struct MemoryDemonstrateOutput { pub query: String, pub demonstrations: Vec, - #[serde(default = "default_1487")] + #[serde(default = "default_1490")] pub votes: std::collections::HashMap, - #[serde(default = "default_1488")] + #[serde(default = "default_1491")] pub predicted_label: String, - #[serde(default = "default_1489")] + #[serde(default = "default_1492")] pub margin: f64, - #[serde(default = "default_1490")] + #[serde(default = "default_1493")] pub abstain: bool, - #[serde(default = "default_1491")] + #[serde(default = "default_1494")] pub abstain_reason: String, - #[serde(default = "default_1492")] + #[serde(default = "default_1495")] pub few_shot_block: String, - #[serde(default = "default_1493")] + #[serde(default = "default_1496")] pub examined: Integer, - #[serde(default = "default_1494")] + #[serde(default = "default_1497")] pub labelled: Integer, } @@ -33356,7 +33362,7 @@ impl MemoryDemonstrateInput { pub struct MemoryDemoteOutput { pub demoted: bool, pub was_reversible: bool, - #[serde(default = "default_1495")] + #[serde(default = "default_1498")] pub tombstoned_at: Option, } @@ -33418,15 +33424,15 @@ impl MemoryDemoteInput { pub struct DigestRow { pub session_id: String, pub summary_text: String, - #[serde(default = "default_1496")] + #[serde(default = "default_1499")] pub key_facts: Vec, - #[serde(default = "default_1497")] + #[serde(default = "default_1500")] pub derived_from: Vec, - #[serde(default = "default_1498")] + #[serde(default = "default_1501")] pub valid_at: Option, - #[serde(default = "default_1499")] + #[serde(default = "default_1502")] pub created_at: Option, - #[serde(default = "default_1500")] + #[serde(default = "default_1503")] pub version: Integer, } @@ -33434,7 +33440,7 @@ pub struct DigestRow { #[non_exhaustive] pub struct MemoryDigestsOutput { pub rows: Vec, - #[serde(default = "default_1501")] + #[serde(default = "default_1504")] pub truncated: bool, } @@ -33559,17 +33565,17 @@ pub struct MemoryEvidenceItem { pub evidence_id: String, pub support_type: String, pub scope: MemoryEvidenceItemScope, - #[serde(default = "default_1505")] + #[serde(default = "default_1508")] pub role: String, - #[serde(default = "default_1506")] + #[serde(default = "default_1509")] pub observed_at: Option, - #[serde(default = "default_1507")] + #[serde(default = "default_1510")] pub content: String, - #[serde(default = "default_1508")] + #[serde(default = "default_1511")] pub char_start: Integer, - #[serde(default = "default_1509")] + #[serde(default = "default_1512")] pub char_end: Integer, - #[serde(default = "default_1510")] + #[serde(default = "default_1513")] pub span: String, } @@ -33577,23 +33583,23 @@ pub struct MemoryEvidenceItem { #[non_exhaustive] pub struct MemoryEvidenceOutput { pub found: bool, - #[serde(default = "default_1502")] + #[serde(default = "default_1505")] pub memory_key: String, - #[serde(default = "default_1503")] + #[serde(default = "default_1506")] pub memory_id: String, - #[serde(default = "default_1504")] + #[serde(default = "default_1507")] pub value: String, - #[serde(default = "default_1511")] + #[serde(default = "default_1514")] pub items: Vec, - #[serde(default = "default_1512")] + #[serde(default = "default_1515")] pub truncated: bool, - #[serde(default = "default_1513")] + #[serde(default = "default_1516")] pub cited: Integer, - #[serde(default = "default_1514")] + #[serde(default = "default_1517")] pub lexical: Integer, - #[serde(default = "default_1515")] + #[serde(default = "default_1518")] pub window: Integer, - #[serde(default = "default_1516")] + #[serde(default = "default_1519")] pub derived: Integer, } @@ -33698,26 +33704,26 @@ impl MemoryEvidenceInput { #[non_exhaustive] pub struct EvidenceChunk { pub session_id: String, - #[serde(default = "default_1517")] + #[serde(default = "default_1520")] pub chunk_index: Integer, pub content: String, - #[serde(default = "default_1518")] + #[serde(default = "default_1521")] pub content_sha256: String, - #[serde(default = "default_1519")] + #[serde(default = "default_1522")] pub agent: String, - #[serde(default = "default_1520")] + #[serde(default = "default_1523")] pub user_id: String, - #[serde(default = "default_1521")] + #[serde(default = "default_1524")] pub parent_memory_key: String, - #[serde(default = "default_1522")] + #[serde(default = "default_1525")] pub memory_keys: Vec, - #[serde(default = "default_1523")] + #[serde(default = "default_1526")] pub line_start: Integer, - #[serde(default = "default_1524")] + #[serde(default = "default_1527")] pub line_end: Integer, - #[serde(default = "default_1525")] + #[serde(default = "default_1528")] pub created_at: String, - #[serde(default = "default_1526")] + #[serde(default = "default_1529")] pub source_url: String, } @@ -33726,17 +33732,17 @@ pub struct EvidenceChunk { pub struct EvidenceDigest { pub session_id: String, pub summary_text: String, - #[serde(default = "default_1528")] + #[serde(default = "default_1531")] pub agent: String, - #[serde(default = "default_1529")] + #[serde(default = "default_1532")] pub user_id: String, - #[serde(default = "default_1530")] + #[serde(default = "default_1533")] pub key_facts: Vec, - #[serde(default = "default_1531")] + #[serde(default = "default_1534")] pub derived_from: Vec, - #[serde(default = "default_1532")] + #[serde(default = "default_1535")] pub valid_at: String, - #[serde(default = "default_1533")] + #[serde(default = "default_1536")] pub created_at: String, } @@ -33746,28 +33752,28 @@ pub struct EvidenceEdge { pub from_key: String, pub to_key: String, pub relation: String, - #[serde(default = "default_1535")] + #[serde(default = "default_1538")] pub confidence: f64, - #[serde(default = "default_1536")] + #[serde(default = "default_1539")] pub explanation: String, - #[serde(default = "default_1537")] + #[serde(default = "default_1540")] pub created_at: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExportEvidenceOutput { - #[serde(default = "default_1527")] + #[serde(default = "default_1530")] pub chunks: Vec, - #[serde(default = "default_1534")] + #[serde(default = "default_1537")] pub digests: Vec, - #[serde(default = "default_1538")] + #[serde(default = "default_1541")] pub edges: Vec, - #[serde(default = "default_1539")] + #[serde(default = "default_1542")] pub has_more: bool, - #[serde(default = "default_1540")] + #[serde(default = "default_1543")] pub next_cursor: String, - #[serde(default = "default_1541")] + #[serde(default = "default_1544")] pub held_high: Integer, } @@ -33960,15 +33966,15 @@ impl ExposureSummaryInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExtractionRetryMineOutput { - #[serde(default = "default_1542")] + #[serde(default = "default_1545")] pub requeued: Vec, - #[serde(default = "default_1543")] + #[serde(default = "default_1546")] pub not_failed: Vec, - #[serde(default = "default_1544")] + #[serde(default = "default_1547")] pub model_calls_off: Vec, - #[serde(default = "default_1545")] + #[serde(default = "default_1548")] pub expired: Vec, - #[serde(default = "default_1546")] + #[serde(default = "default_1549")] pub unknown: Vec, } @@ -34029,20 +34035,20 @@ pub struct ExtractionQueueRow { pub content_chars: Integer, pub written: Integer, pub last_error: String, - #[serde(default = "default_1547")] + #[serde(default = "default_1550")] pub enqueued_at: Option, - #[serde(default = "default_1548")] + #[serde(default = "default_1551")] pub updated_at: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExtractionStatusOutput { - #[serde(default = "default_1549")] + #[serde(default = "default_1552")] pub batches: Vec, - #[serde(default = "default_1550")] + #[serde(default = "default_1553")] pub pending: Integer, - #[serde(default = "default_1551")] + #[serde(default = "default_1554")] pub failed: Integer, } @@ -34190,13 +34196,13 @@ impl MemoryExtractionStatusInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryExtractionStatusMineOutput { - #[serde(default = "default_1552")] + #[serde(default = "default_1555")] pub batches: Vec, - #[serde(default = "default_1553")] + #[serde(default = "default_1556")] pub unknown: Vec, - #[serde(default = "default_1554")] + #[serde(default = "default_1557")] pub pending: Integer, - #[serde(default = "default_1555")] + #[serde(default = "default_1558")] pub failed: Integer, } @@ -34317,39 +34323,39 @@ pub struct MemoryForFileHit { pub memory_key: String, pub memory_type: String, pub value: String, - #[serde(default = "default_1556")] + #[serde(default = "default_1559")] pub value_truncated: bool, - #[serde(default = "default_1557")] + #[serde(default = "default_1560")] pub tags: Vec, - #[serde(default = "default_1558")] + #[serde(default = "default_1561")] pub confidence: f64, - #[serde(default = "default_1559")] + #[serde(default = "default_1562")] pub pinned: bool, - #[serde(default = "default_1560")] + #[serde(default = "default_1563")] pub status: String, - #[serde(default = "default_1561")] + #[serde(default = "default_1564")] pub agent: String, - #[serde(default = "default_1562")] + #[serde(default = "default_1565")] pub updated_at: Option, - #[serde(default = "default_1563")] + #[serde(default = "default_1566")] pub namespace: String, - #[serde(default = "default_1564")] + #[serde(default = "default_1567")] pub actor: String, - #[serde(default = "default_1565")] + #[serde(default = "default_1568")] pub supersedes_key: String, - #[serde(default = "default_1566")] + #[serde(default = "default_1569")] pub supersedes: String, - #[serde(default = "default_1567")] + #[serde(default = "default_1570")] pub supersedes_kind: MemoryForFileHitSupersedesKind, - #[serde(default = "default_1568")] + #[serde(default = "default_1571")] pub matched_files: Vec, - #[serde(default = "default_1569")] + #[serde(default = "default_1572")] pub source_resource_id: String, - #[serde(default = "default_1570")] + #[serde(default = "default_1573")] pub verification: MemoryForFileHitVerification, - #[serde(default = "default_1571")] + #[serde(default = "default_1574")] pub code_state: MemoryForFileHitCodeState, - #[serde(default = "default_1572")] + #[serde(default = "default_1575")] pub code_moved: Vec, } @@ -34359,11 +34365,11 @@ pub struct MemoryForFileOutput { pub path: String, pub total: Integer, pub hits: Vec, - #[serde(default = "default_1573")] + #[serde(default = "default_1576")] pub rendered: String, - #[serde(default = "default_1574")] + #[serde(default = "default_1577")] pub tokens_estimate: Integer, - #[serde(default = "default_1575")] + #[serde(default = "default_1578")] pub truncated: bool, } @@ -34471,61 +34477,61 @@ impl MemoryForFileInput { #[non_exhaustive] pub struct MemoryGetByIdOutput { pub found: bool, - #[serde(default = "default_1576")] + #[serde(default = "default_1579")] pub memory_id: String, - #[serde(default = "default_1577")] + #[serde(default = "default_1580")] pub namespace: String, - #[serde(default = "default_1578")] + #[serde(default = "default_1581")] pub agent: String, - #[serde(default = "default_1579")] + #[serde(default = "default_1582")] pub user_id: String, - #[serde(default = "default_1580")] + #[serde(default = "default_1583")] pub session_id: String, - #[serde(default = "default_1581")] + #[serde(default = "default_1584")] pub memory_key: String, - #[serde(default = "default_1582")] + #[serde(default = "default_1585")] pub memory_type: Option, - #[serde(default = "default_1583")] + #[serde(default = "default_1586")] pub value: Value, - #[serde(default = "default_1584")] + #[serde(default = "default_1587")] pub confidence: Option, - #[serde(default = "default_1585")] + #[serde(default = "default_1588")] pub version: Option, - #[serde(default = "default_1586")] + #[serde(default = "default_1589")] pub created_at: Option, - #[serde(default = "default_1587")] + #[serde(default = "default_1590")] pub expires_at: Option, - #[serde(default = "default_1588")] + #[serde(default = "default_1591")] pub valid_at: Option, - #[serde(default = "default_1589")] + #[serde(default = "default_1592")] pub valid_to: Option, - #[serde(default = "default_1590")] + #[serde(default = "default_1593")] pub pinned: bool, - #[serde(default = "default_1591")] + #[serde(default = "default_1594")] pub content_sha256: String, - #[serde(default = "default_1592")] + #[serde(default = "default_1595")] pub verified_by: String, - #[serde(default = "default_1593")] + #[serde(default = "default_1596")] pub verified_at: Option, - #[serde(default = "default_1594")] + #[serde(default = "default_1597")] pub verification: String, - #[serde(default = "default_1595")] + #[serde(default = "default_1598")] pub sensitivity: String, - #[serde(default = "default_1596")] + #[serde(default = "default_1599")] pub actor: String, - #[serde(default = "default_1597")] + #[serde(default = "default_1600")] pub source_class: String, - #[serde(default = "default_1598")] + #[serde(default = "default_1601")] pub lock_mode: String, - #[serde(default = "default_1599")] + #[serde(default = "default_1602")] pub lock_reason: String, - #[serde(default = "default_1600")] + #[serde(default = "default_1603")] pub lock_until: Option, - #[serde(default = "default_1601")] + #[serde(default = "default_1604")] pub locked_by: String, - #[serde(default = "default_1602")] + #[serde(default = "default_1605")] pub on_expire: String, - #[serde(default = "default_1603")] + #[serde(default = "default_1606")] pub expire_reason: String, } @@ -34601,41 +34607,41 @@ pub struct MemoryHealthTopRow { pub memory_type: String, pub recall_count: Integer, pub used_count: Integer, - #[serde(default = "default_1606")] + #[serde(default = "default_1609")] pub harm_count: Integer, - #[serde(default = "default_1607")] + #[serde(default = "default_1610")] pub last_recalled_at: Option, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryHealthStaleness { - #[serde(default = "default_1609")] + #[serde(default = "default_1612")] pub by_age: std::collections::HashMap, - #[serde(default = "default_1610")] + #[serde(default = "default_1613")] pub with_validity_end: Integer, - #[serde(default = "default_1611")] + #[serde(default = "default_1614")] pub with_validity_end_share: f64, - #[serde(default = "default_1612")] + #[serde(default = "default_1615")] pub with_expiry: Integer, - #[serde(default = "default_1613")] + #[serde(default = "default_1616")] pub expiring_7d: Integer, - #[serde(default = "default_1614")] + #[serde(default = "default_1617")] pub pinned: Integer, - #[serde(default = "default_1615")] + #[serde(default = "default_1618")] pub days_since_reinforced_p50: Integer, - #[serde(default = "default_1616")] + #[serde(default = "default_1619")] pub days_since_reinforced_p90: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryHealthFootprint { - #[serde(default = "default_1618")] + #[serde(default = "default_1621")] pub value_chars: Integer, - #[serde(default = "default_1619")] + #[serde(default = "default_1622")] pub value_tokens_est: Integer, - #[serde(default = "default_1620")] + #[serde(default = "default_1623")] pub tokens_per_row_est: f64, } @@ -34645,19 +34651,19 @@ pub struct MemoryHealthOutput { pub live: Integer, pub recalled_ever: Integer, pub used_ever: Integer, - #[serde(default = "default_1604")] + #[serde(default = "default_1607")] pub harmed_ever: Integer, pub silent: Integer, pub silent_older: Integer, pub silent_share: f64, pub silent_after_days: Integer, - #[serde(default = "default_1605")] - pub by_type: Vec, #[serde(default = "default_1608")] + pub by_type: Vec, + #[serde(default = "default_1611")] pub top_recalled: Vec, - #[serde(default = "default_1617")] + #[serde(default = "default_1620")] pub staleness: MemoryHealthStaleness, - #[serde(default = "default_1621")] + #[serde(default = "default_1624")] pub footprint: MemoryHealthFootprint, } @@ -34777,51 +34783,51 @@ impl MemoryHealthInput { pub struct MemoryHistoryRow { pub memory_id: String, pub version: Integer, - #[serde(default = "default_1622")] + #[serde(default = "default_1625")] pub version_text: String, - #[serde(default = "default_1623")] + #[serde(default = "default_1626")] pub value: Value, pub confidence: f64, - #[serde(default = "default_1624")] + #[serde(default = "default_1627")] pub source_trace: String, - #[serde(default = "default_1625")] + #[serde(default = "default_1628")] pub pinned: bool, pub created_at: String, - #[serde(default = "default_1626")] + #[serde(default = "default_1629")] pub expires_at: Option, - #[serde(default = "default_1627")] + #[serde(default = "default_1630")] pub tombstoned_at: Option, - #[serde(default = "default_1628")] + #[serde(default = "default_1631")] pub redacted_at: Option, - #[serde(default = "default_1629")] + #[serde(default = "default_1632")] pub redaction_reason: String, - #[serde(default = "default_1630")] + #[serde(default = "default_1633")] pub content_sha256: String, - #[serde(default = "default_1631")] + #[serde(default = "default_1634")] pub actor: String, - #[serde(default = "default_1632")] + #[serde(default = "default_1635")] pub source_class: String, - #[serde(default = "default_1633")] + #[serde(default = "default_1636")] pub agent: String, - #[serde(default = "default_1634")] + #[serde(default = "default_1637")] pub written_at: Option, - #[serde(default = "default_1635")] + #[serde(default = "default_1638")] pub status: String, - #[serde(default = "default_1636")] + #[serde(default = "default_1639")] pub conflict_with: Vec, - #[serde(default = "default_1637")] + #[serde(default = "default_1640")] pub tags: Vec, - #[serde(default = "default_1638")] + #[serde(default = "default_1641")] pub verified_at: Option, - #[serde(default = "default_1639")] + #[serde(default = "default_1642")] pub verified_by: String, - #[serde(default = "default_1640")] + #[serde(default = "default_1643")] pub verified_sha256: String, - #[serde(default = "default_1641")] + #[serde(default = "default_1644")] pub lock_mode: String, - #[serde(default = "default_1642")] + #[serde(default = "default_1645")] pub lock_reason: String, - #[serde(default = "default_1643")] + #[serde(default = "default_1646")] pub lock_until: Option, } @@ -34931,13 +34937,13 @@ impl MemoryHistoryInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryImportTotals { - #[serde(default = "default_1644")] + #[serde(default = "default_1647")] pub written: Integer, - #[serde(default = "default_1645")] + #[serde(default = "default_1648")] pub held: Integer, - #[serde(default = "default_1646")] + #[serde(default = "default_1649")] pub skipped: Integer, - #[serde(default = "default_1647")] + #[serde(default = "default_1650")] pub refused: Integer, } @@ -35020,11 +35026,11 @@ pub struct MemoryImportResult { pub index: Integer, pub key: String, pub outcome: MemoryImportResultOutcome, - #[serde(default = "default_1648")] + #[serde(default = "default_1651")] pub reason: MemoryImportResultReason, - #[serde(default = "default_1649")] + #[serde(default = "default_1652")] pub held_by: String, - #[serde(default = "default_1650")] + #[serde(default = "default_1653")] pub note: MemoryImportResultNote, } @@ -35033,7 +35039,7 @@ pub struct MemoryImportResult { pub struct MemoryImportOutput { pub totals: MemoryImportTotals, pub results: Vec, - #[serde(default = "default_1651")] + #[serde(default = "default_1654")] pub dry_run: bool, } @@ -35226,9 +35232,9 @@ pub struct MemoryImportCuratedRow { pub section_heading: String, pub bytes_written: Integer, pub verdict: String, - #[serde(default = "default_1652")] + #[serde(default = "default_1655")] pub rejection_reason: String, - #[serde(default = "default_1653")] + #[serde(default = "default_1656")] pub pinned_blocker_id: Option, } @@ -35320,21 +35326,21 @@ impl MemoryImportCuratedInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryImportEvidenceOutput { - #[serde(default = "default_1654")] + #[serde(default = "default_1657")] pub chunks_written: Integer, - #[serde(default = "default_1655")] + #[serde(default = "default_1658")] pub links_written: Integer, - #[serde(default = "default_1656")] + #[serde(default = "default_1659")] pub digests_written: Integer, - #[serde(default = "default_1657")] + #[serde(default = "default_1660")] pub embedding_model: String, - #[serde(default = "default_1658")] + #[serde(default = "default_1661")] pub embedding_dim: Integer, - #[serde(default = "default_1659")] + #[serde(default = "default_1662")] pub edited: Vec, - #[serde(default = "default_1660")] + #[serde(default = "default_1663")] pub skipped: Integer, - #[serde(default = "default_1661")] + #[serde(default = "default_1664")] pub unchecked: Integer, } @@ -35671,7 +35677,7 @@ pub struct InspectRow { pub memory_key: String, pub memory_id: String, pub version: Integer, - #[serde(default = "default_1671")] + #[serde(default = "default_1674")] pub content_sha256: String, pub memory_type: String, pub status: String, @@ -35682,9 +35688,9 @@ pub struct InspectRow { pub actor: String, pub updated_at: String, pub sensitivity: String, - #[serde(default = "default_1672")] + #[serde(default = "default_1675")] pub versions: Integer, - #[serde(default = "default_1673")] + #[serde(default = "default_1676")] pub excerpt: String, } @@ -35692,27 +35698,27 @@ pub struct InspectRow { #[non_exhaustive] pub struct InspectView { pub definition: String, - #[serde(default = "default_1662")] + #[serde(default = "default_1665")] pub refs: Vec, - #[serde(default = "default_1663")] + #[serde(default = "default_1666")] pub live_rows: Integer, - #[serde(default = "default_1664")] + #[serde(default = "default_1667")] pub by_type: Vec, - #[serde(default = "default_1665")] + #[serde(default = "default_1668")] pub by_status: Vec, - #[serde(default = "default_1666")] + #[serde(default = "default_1669")] pub by_source_class: Vec, - #[serde(default = "default_1667")] + #[serde(default = "default_1670")] pub top_tags: Vec, - #[serde(default = "default_1668")] + #[serde(default = "default_1671")] pub categories: Vec, - #[serde(default = "default_1669")] + #[serde(default = "default_1672")] pub first_updated_at: Option, - #[serde(default = "default_1670")] + #[serde(default = "default_1673")] pub last_updated_at: Option, - #[serde(default = "default_1674")] + #[serde(default = "default_1677")] pub newest: Vec, - #[serde(default = "default_1675")] + #[serde(default = "default_1678")] pub complete: bool, } @@ -35728,32 +35734,32 @@ pub struct InspectCall { #[non_exhaustive] pub struct InspectActivity { pub window_seconds: Integer, - #[serde(default = "default_1676")] + #[serde(default = "default_1679")] pub calls: Vec, - #[serde(default = "default_1677")] + #[serde(default = "default_1680")] pub first_at: Option, - #[serde(default = "default_1678")] + #[serde(default = "default_1681")] pub last_at: Option, - #[serde(default = "default_1679")] + #[serde(default = "default_1682")] pub gap: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct InspectSettings { - #[serde(default = "default_1680")] + #[serde(default = "default_1683")] pub guide_revision: Integer, - #[serde(default = "default_1681")] + #[serde(default = "default_1684")] pub guide_summary: String, - #[serde(default = "default_1682")] + #[serde(default = "default_1685")] pub categories_registered: Integer, - #[serde(default = "default_1683")] + #[serde(default = "default_1686")] pub extraction_policy: Option, - #[serde(default = "default_1684")] + #[serde(default = "default_1687")] pub extraction_policy_unavailable: String, - #[serde(default = "default_1685")] + #[serde(default = "default_1688")] pub extraction_instructions: String, - #[serde(default = "default_1686")] + #[serde(default = "default_1689")] pub extraction_instructions_refs: Vec, } @@ -35769,7 +35775,7 @@ pub struct MemoryInspectOutput { pub others: InspectView, pub activity: InspectActivity, pub settings: InspectSettings, - #[serde(default = "default_1687")] + #[serde(default = "default_1690")] pub skipped: Vec, } @@ -35863,7 +35869,7 @@ pub struct MemoryKeyRef { #[non_exhaustive] pub struct MemoryKeysOutput { pub keys: Vec, - #[serde(default = "default_1688")] + #[serde(default = "default_1691")] pub truncated: bool, } @@ -35966,9 +35972,9 @@ pub struct LineageCandidate { pub decided_at: String, pub decided_by: String, pub match_confidence: LineageCandidateMatchConfidence, - #[serde(default = "default_1697")] + #[serde(default = "default_1700")] pub seeded_from_thread_id: String, - #[serde(default = "default_1698")] + #[serde(default = "default_1701")] pub seeded_from_msg_id: String, } @@ -35986,25 +35992,25 @@ pub struct LineageAuditEvent { pub struct MemoryLineageOutput { pub found: bool, pub memory_key: String, - #[serde(default = "default_1689")] + #[serde(default = "default_1692")] pub promotion_event: String, - #[serde(default = "default_1690")] + #[serde(default = "default_1693")] pub promoted_by: String, - #[serde(default = "default_1691")] + #[serde(default = "default_1694")] pub promoted_at: Option, - #[serde(default = "default_1692")] + #[serde(default = "default_1695")] pub rationale: String, - #[serde(default = "default_1693")] + #[serde(default = "default_1696")] pub source_trace: String, - #[serde(default = "default_1694")] + #[serde(default = "default_1697")] pub source_resource_id: String, - #[serde(default = "default_1695")] + #[serde(default = "default_1698")] pub mechanism: MemoryLineageOutputMechanism, - #[serde(default = "default_1696")] - pub supporters: Vec, #[serde(default = "default_1699")] + pub supporters: Vec, + #[serde(default = "default_1702")] pub candidate: Option, - #[serde(default = "default_1700")] + #[serde(default = "default_1703")] pub audit_chain: Vec, } @@ -36133,11 +36139,11 @@ pub struct MemoryLinkOutput { pub from_key: String, pub to_key: String, pub relation: String, - #[serde(default = "default_1701")] + #[serde(default = "default_1704")] pub confidence: f64, - #[serde(default = "default_1702")] + #[serde(default = "default_1705")] pub conflict_opened: bool, - #[serde(default = "default_1703")] + #[serde(default = "default_1706")] pub relation_defaulted: bool, } @@ -36451,17 +36457,17 @@ pub struct MemoryListEntry { pub struct MemoryListOutput { pub entries: Vec, pub truncated: bool, - #[serde(default = "default_1704")] + #[serde(default = "default_1707")] pub total: Integer, - #[serde(default = "default_1705")] + #[serde(default = "default_1708")] pub today: Integer, - #[serde(default = "default_1706")] + #[serde(default = "default_1709")] pub namespace_version: String, - #[serde(default = "default_1707")] + #[serde(default = "default_1710")] pub unchanged: bool, - #[serde(default = "default_1708")] + #[serde(default = "default_1711")] pub hidden: Integer, - #[serde(default = "default_1709")] + #[serde(default = "default_1712")] pub hidden_hint: String, } @@ -36847,19 +36853,19 @@ impl MemoryListInput { #[non_exhaustive] pub struct MemoryLockOutput { pub locked: bool, - #[serde(default = "default_1710")] + #[serde(default = "default_1713")] pub reason: String, - #[serde(default = "default_1711")] + #[serde(default = "default_1714")] pub memory_id: String, - #[serde(default = "default_1712")] + #[serde(default = "default_1715")] pub version: Option, - #[serde(default = "default_1713")] + #[serde(default = "default_1716")] pub lock_mode: String, - #[serde(default = "default_1714")] + #[serde(default = "default_1717")] pub lock_until: Option, - #[serde(default = "default_1715")] + #[serde(default = "default_1718")] pub locked_by: String, - #[serde(default = "default_1716")] + #[serde(default = "default_1719")] pub previous_mode: String, } @@ -37018,21 +37024,21 @@ pub struct MemoryMoveOutput { pub from_key: String, pub to_key: String, pub redirected: bool, - #[serde(default = "default_1717")] + #[serde(default = "default_1720")] pub memory_id: String, - #[serde(default = "default_1718")] + #[serde(default = "default_1721")] pub version: Integer, - #[serde(default = "default_1719")] + #[serde(default = "default_1722")] pub content_sha256: String, - #[serde(default = "default_1720")] + #[serde(default = "default_1723")] pub advisories: Vec, - #[serde(default = "default_1721")] + #[serde(default = "default_1724")] pub dry_run: bool, - #[serde(default = "default_1722")] + #[serde(default = "default_1725")] pub memory_type: String, - #[serde(default = "default_1723")] + #[serde(default = "default_1726")] pub value_preview: String, - #[serde(default = "default_1724")] + #[serde(default = "default_1727")] pub sensitivity: String, } @@ -37244,7 +37250,7 @@ impl MemoryMoveInput { pub struct MemoryOutcomeOutput { pub recorded: bool, pub evidence_count_after: Integer, - #[serde(default = "default_1725")] + #[serde(default = "default_1728")] pub quarantined: bool, } @@ -37487,13 +37493,13 @@ impl MemoryOutcomeRunInput { #[non_exhaustive] pub struct OutlineSession { pub session_id: String, - #[serde(default = "default_1727")] + #[serde(default = "default_1730")] pub date: String, - #[serde(default = "default_1728")] + #[serde(default = "default_1731")] pub headline: String, - #[serde(default = "default_1729")] + #[serde(default = "default_1732")] pub key_facts: Integer, - #[serde(default = "default_1730")] + #[serde(default = "default_1733")] pub rows: Integer, } @@ -37501,7 +37507,7 @@ pub struct OutlineSession { #[non_exhaustive] pub struct OutlineHub { pub entity: String, - #[serde(default = "default_1733")] + #[serde(default = "default_1736")] pub degree: Integer, } @@ -37509,28 +37515,28 @@ pub struct OutlineHub { #[non_exhaustive] pub struct OutlineCommunity { pub community_id: Integer, - #[serde(default = "default_1735")] + #[serde(default = "default_1738")] pub label: String, - #[serde(default = "default_1736")] + #[serde(default = "default_1739")] pub size: Integer, - #[serde(default = "default_1737")] + #[serde(default = "default_1740")] pub computed_at: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryOutlineOutput { - #[serde(default = "default_1726")] + #[serde(default = "default_1729")] pub rows_by_type: std::collections::HashMap, - #[serde(default = "default_1731")] + #[serde(default = "default_1734")] pub sessions: Vec, - #[serde(default = "default_1732")] + #[serde(default = "default_1735")] pub sessions_total: Integer, - #[serde(default = "default_1734")] + #[serde(default = "default_1737")] pub hubs: Vec, - #[serde(default = "default_1738")] + #[serde(default = "default_1741")] pub communities: Vec, - #[serde(default = "default_1739")] + #[serde(default = "default_1742")] pub profile_chars: Integer, } @@ -37682,7 +37688,7 @@ pub struct OwnerUsageRow { pub recalls: Integer, pub used: Integer, pub harm: Integer, - #[serde(default = "default_1740")] + #[serde(default = "default_1743")] pub last_recalled: Option, } @@ -38169,7 +38175,7 @@ pub struct MemoryPromoteOutput { pub shared_memory_key: String, pub promotion_event: String, pub reversible_until: String, - #[serde(default = "default_1741")] + #[serde(default = "default_1744")] pub ignored_args: Vec, } @@ -38338,18 +38344,18 @@ impl MemoryPromoteInput { pub struct MemoryProposalDecision { pub memory_key: String, pub decided: bool, - #[serde(default = "default_1743")] + #[serde(default = "default_1746")] pub status: String, - #[serde(default = "default_1744")] + #[serde(default = "default_1747")] pub reason: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryProposalDecideOutput { - #[serde(default = "default_1742")] - pub decided: Integer, #[serde(default = "default_1745")] + pub decided: Integer, + #[serde(default = "default_1748")] pub results: Vec, } @@ -38450,33 +38456,33 @@ pub enum MemoryProposalReady { pub struct MemoryProposal { pub memory_key: String, pub memory_id: String, - #[serde(default = "default_1746")] + #[serde(default = "default_1749")] pub content_sha256: String, - #[serde(default = "default_1747")] + #[serde(default = "default_1750")] pub agent: String, - #[serde(default = "default_1748")] + #[serde(default = "default_1751")] pub memory_type: String, - #[serde(default = "default_1749")] + #[serde(default = "default_1752")] pub value_preview: String, - #[serde(default = "default_1750")] + #[serde(default = "default_1753")] pub sensitivity: String, - #[serde(default = "default_1751")] + #[serde(default = "default_1754")] pub tags: Vec, - #[serde(default = "default_1752")] + #[serde(default = "default_1755")] pub created_at: String, - #[serde(default = "default_1753")] + #[serde(default = "default_1756")] pub graded_passes: Integer, - #[serde(default = "default_1754")] + #[serde(default = "default_1757")] pub graded_fails: Integer, - #[serde(default = "default_1755")] + #[serde(default = "default_1758")] pub last_graded_at: String, - #[serde(default = "default_1756")] + #[serde(default = "default_1759")] pub used_count: Integer, - #[serde(default = "default_1757")] + #[serde(default = "default_1760")] pub harm_count: Integer, - #[serde(default = "default_1758")] + #[serde(default = "default_1761")] pub ready: MemoryProposalReady, - #[serde(default = "default_1759")] + #[serde(default = "default_1762")] pub conflict_with: Vec, } @@ -38492,24 +38498,24 @@ pub enum ProposalPolicyMode { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProposalPolicy { - #[serde(default = "default_1762")] + #[serde(default = "default_1765")] pub mode: ProposalPolicyMode, - #[serde(default = "default_1763")] + #[serde(default = "default_1766")] pub min_passes: Integer, - #[serde(default = "default_1764")] + #[serde(default = "default_1767")] pub max_fails: Integer, - #[serde(default = "default_1765")] + #[serde(default = "default_1768")] pub reject_after_fails: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryProposalsOutput { - #[serde(default = "default_1760")] + #[serde(default = "default_1763")] pub proposals: Vec, - #[serde(default = "default_1761")] + #[serde(default = "default_1764")] pub total: Integer, - #[serde(default = "default_1766")] + #[serde(default = "default_1769")] pub policy: ProposalPolicy, } @@ -38616,19 +38622,19 @@ impl MemoryProposalsInput { pub struct MemoryProvenanceLink { pub direction: String, pub memory_key: String, - #[serde(default = "default_1780")] + #[serde(default = "default_1783")] pub relation: String, - #[serde(default = "default_1781")] + #[serde(default = "default_1784")] pub label: String, - #[serde(default = "default_1782")] + #[serde(default = "default_1785")] pub explanation: String, - #[serde(default = "default_1783")] + #[serde(default = "default_1786")] pub evidence: Vec, - #[serde(default = "default_1784")] + #[serde(default = "default_1787")] pub confidence: f64, - #[serde(default = "default_1785")] + #[serde(default = "default_1788")] pub author: String, - #[serde(default = "default_1786")] + #[serde(default = "default_1789")] pub run_id: String, } @@ -38636,33 +38642,33 @@ pub struct MemoryProvenanceLink { #[non_exhaustive] pub struct MemoryProvenanceOutput { pub found: bool, - #[serde(default = "default_1767")] + #[serde(default = "default_1770")] pub source_trace: String, - #[serde(default = "default_1768")] + #[serde(default = "default_1771")] pub source_kind: String, - #[serde(default = "default_1769")] + #[serde(default = "default_1772")] pub actor: String, - #[serde(default = "default_1770")] + #[serde(default = "default_1773")] pub source_class: String, - #[serde(default = "default_1771")] + #[serde(default = "default_1774")] pub source_label: String, - #[serde(default = "default_1772")] + #[serde(default = "default_1775")] pub thread_id: String, - #[serde(default = "default_1773")] + #[serde(default = "default_1776")] pub thread_exists: bool, - #[serde(default = "default_1774")] + #[serde(default = "default_1777")] pub thread_title: String, - #[serde(default = "default_1775")] + #[serde(default = "default_1778")] pub agent: String, - #[serde(default = "default_1776")] + #[serde(default = "default_1779")] pub session_id: String, - #[serde(default = "default_1777")] + #[serde(default = "default_1780")] pub run_id: String, - #[serde(default = "default_1778")] + #[serde(default = "default_1781")] pub written_at: String, - #[serde(default = "default_1779")] + #[serde(default = "default_1782")] pub source_resource_id: String, - #[serde(default = "default_1787")] + #[serde(default = "default_1790")] pub links: Vec, } @@ -38757,17 +38763,17 @@ impl MemoryProvenanceInput { pub struct RecallTurn { pub evidence_id: String, pub session_id: String, - #[serde(default = "default_1788")] + #[serde(default = "default_1791")] pub role: String, - #[serde(default = "default_1789")] + #[serde(default = "default_1792")] pub actor: String, - #[serde(default = "default_1790")] + #[serde(default = "default_1793")] pub observed_at: String, - #[serde(default = "default_1791")] + #[serde(default = "default_1794")] pub content: String, - #[serde(default = "default_1792")] + #[serde(default = "default_1795")] pub truncated: bool, - #[serde(default = "default_1793")] + #[serde(default = "default_1796")] pub matched_tokens: Integer, } @@ -38784,21 +38790,21 @@ pub enum MemoryRecallOutputOrder { #[non_exhaustive] pub struct MemoryRecallOutput { pub turns: Vec, - #[serde(default = "default_1794")] + #[serde(default = "default_1797")] pub total_matched: Integer, - #[serde(default = "default_1795")] + #[serde(default = "default_1798")] pub returned: Integer, - #[serde(default = "default_1796")] + #[serde(default = "default_1799")] pub has_more: bool, - #[serde(default = "default_1797")] + #[serde(default = "default_1800")] pub next_cursor: String, - #[serde(default = "default_1798")] + #[serde(default = "default_1801")] pub next_offset: Integer, - #[serde(default = "default_1799")] + #[serde(default = "default_1802")] pub order: MemoryRecallOutputOrder, - #[serde(default = "default_1800")] + #[serde(default = "default_1803")] pub query_tokens: Vec, - #[serde(default = "default_1801")] + #[serde(default = "default_1804")] pub tokens_returned: Integer, } @@ -39080,19 +39086,19 @@ pub struct MemoryRecordConflictRow { pub schema_name: String, pub memory_key: String, pub field_name: String, - #[serde(default = "default_1802")] + #[serde(default = "default_1805")] pub prior_value: Value, - #[serde(default = "default_1803")] + #[serde(default = "default_1806")] pub incoming_value: Value, pub prior_record_id: String, pub incoming_record_id: String, - #[serde(default = "default_1804")] + #[serde(default = "default_1807")] pub prior_memory_id: String, - #[serde(default = "default_1805")] + #[serde(default = "default_1808")] pub incoming_memory_id: String, - #[serde(default = "default_1806")] + #[serde(default = "default_1809")] pub detected_at: Option, - #[serde(default = "default_1807")] + #[serde(default = "default_1810")] pub resolved_at: Option, } @@ -39100,7 +39106,7 @@ pub struct MemoryRecordConflictRow { #[non_exhaustive] pub struct MemoryRecordConflictsOutput { pub rows: Vec, - #[serde(default = "default_1808")] + #[serde(default = "default_1811")] pub truncated: bool, } @@ -39210,19 +39216,19 @@ pub enum MemoryRecordRowStatus { #[non_exhaustive] pub struct MemoryRecordRow { pub record_id: String, - #[serde(default = "default_1809")] + #[serde(default = "default_1812")] pub memory_key: String, - #[serde(default = "default_1810")] + #[serde(default = "default_1813")] pub memory_id: String, - #[serde(default = "default_1811")] + #[serde(default = "default_1814")] pub record: std::collections::HashMap, - #[serde(default = "default_1812")] + #[serde(default = "default_1815")] pub field_states: std::collections::HashMap, - #[serde(default = "default_1813")] + #[serde(default = "default_1816")] pub status: MemoryRecordRowStatus, - #[serde(default = "default_1814")] + #[serde(default = "default_1817")] pub valid_at: Option, - #[serde(default = "default_1815")] + #[serde(default = "default_1818")] pub valid_to: Option, } @@ -39289,7 +39295,7 @@ impl MemoryRecordHistoryInput { #[non_exhaustive] pub struct MemoryRecordQueryOutput { pub rows: Vec, - #[serde(default = "default_1816")] + #[serde(default = "default_1819")] pub truncated: bool, } @@ -39513,15 +39519,15 @@ pub enum MemoryRecordWriteOutputKeySource { pub struct MemoryRecordWriteOutput { pub record_id: String, pub field_count: Integer, - #[serde(default = "default_1817")] + #[serde(default = "default_1820")] pub memory_key: String, - #[serde(default = "default_1818")] + #[serde(default = "default_1821")] pub key_source: MemoryRecordWriteOutputKeySource, - #[serde(default = "default_1819")] + #[serde(default = "default_1822")] pub fold: std::collections::HashMap, - #[serde(default = "default_1820")] + #[serde(default = "default_1823")] pub superseded_record_id: String, - #[serde(default = "default_1821")] + #[serde(default = "default_1824")] pub conflicts: Integer, } @@ -39764,13 +39770,13 @@ impl MemoryRecordWriteInput { #[non_exhaustive] pub struct MemoryRedactOutput { pub redacted: bool, - #[serde(default = "default_1822")] + #[serde(default = "default_1825")] pub refused_head: bool, - #[serde(default = "default_1823")] + #[serde(default = "default_1826")] pub redacted_at: Option, - #[serde(default = "default_1824")] + #[serde(default = "default_1827")] pub cache_rows_deleted: Integer, - #[serde(default = "default_1825")] + #[serde(default = "default_1828")] pub precedent_rows_deleted: Integer, } @@ -39930,7 +39936,7 @@ impl MemoryReindexInput { #[non_exhaustive] pub struct MemoryRejectOutput { pub rejected: bool, - #[serde(default = "default_1826")] + #[serde(default = "default_1829")] pub rejected_at: Option, } @@ -40046,7 +40052,7 @@ pub struct MemoryRelatedHit { pub struct MemoryRelatedOutput { pub results: Vec, pub source_entities: Vec, - #[serde(default = "default_1827")] + #[serde(default = "default_1830")] pub reason: String, } @@ -40161,13 +40167,13 @@ impl MemoryRelatedInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryResolveOrphanDuplicatesOutput { - #[serde(default = "default_1828")] + #[serde(default = "default_1831")] pub candidates: Integer, - #[serde(default = "default_1829")] + #[serde(default = "default_1832")] pub reactivated: Integer, - #[serde(default = "default_1830")] + #[serde(default = "default_1833")] pub dry_run: bool, - #[serde(default = "default_1831")] + #[serde(default = "default_1834")] pub memory_ids: Vec, } @@ -40244,15 +40250,15 @@ impl MemoryResolveOrphanDuplicatesInput { #[non_exhaustive] pub struct MemoryRestoreOutput { pub restored: bool, - #[serde(default = "default_1832")] + #[serde(default = "default_1835")] pub memory_id: Option, - #[serde(default = "default_1833")] + #[serde(default = "default_1836")] pub version: Option, - #[serde(default = "default_1834")] + #[serde(default = "default_1837")] pub expired: bool, - #[serde(default = "default_1835")] + #[serde(default = "default_1838")] pub redacted: bool, - #[serde(default = "default_1836")] + #[serde(default = "default_1839")] pub from_status: String, } @@ -40372,13 +40378,13 @@ pub struct SearchTraceHit { pub content_excerpt: String, pub distance: f64, pub similarity: f64, - #[serde(default = "default_1837")] + #[serde(default = "default_1840")] pub entity_boost: f64, pub rank_score: f64, pub rank: Integer, - #[serde(default = "default_1838")] + #[serde(default = "default_1841")] pub source: String, - #[serde(default = "default_1839")] + #[serde(default = "default_1842")] pub parent_memory_key: String, } @@ -40388,11 +40394,11 @@ pub struct MemorySearchTraceOutput { pub results: Vec, pub embedding_model: String, pub entity_filter: Vec, - #[serde(default = "default_1840")] + #[serde(default = "default_1843")] pub query_spellings: std::collections::HashMap, - #[serde(default = "default_1841")] + #[serde(default = "default_1844")] pub query_spellings_skipped: bool, - #[serde(default = "default_1842")] + #[serde(default = "default_1845")] pub stale_dropped: Integer, } @@ -41573,7 +41579,7 @@ pub struct SearchTraceLogRow { pub embedding_model: String, pub latency_ms: Integer, pub run_id: String, - #[serde(default = "default_1843")] + #[serde(default = "default_1846")] pub operation: String, } @@ -41682,71 +41688,71 @@ pub struct RefusedFact { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemorySetFromMessagesOutput { - #[serde(default = "default_1844")] + #[serde(default = "default_1847")] pub written: Vec, - #[serde(default = "default_1845")] + #[serde(default = "default_1848")] pub refused: Vec, - #[serde(default = "default_1846")] + #[serde(default = "default_1849")] pub tokens_in: Integer, - #[serde(default = "default_1847")] + #[serde(default = "default_1850")] pub tokens_out: Integer, - #[serde(default = "default_1848")] + #[serde(default = "default_1851")] pub llm_provider: String, - #[serde(default = "default_1849")] + #[serde(default = "default_1852")] pub llm_model: String, - #[serde(default = "default_1850")] + #[serde(default = "default_1853")] pub segments: Integer, - #[serde(default = "default_1851")] + #[serde(default = "default_1854")] pub foresight: Integer, - #[serde(default = "default_1852")] + #[serde(default = "default_1855")] pub forgotten: Integer, - #[serde(default = "default_1853")] + #[serde(default = "default_1856")] pub forgotten_keys: Vec, - #[serde(default = "default_1854")] + #[serde(default = "default_1857")] pub forget_requests: Integer, - #[serde(default = "default_1855")] + #[serde(default = "default_1858")] pub about_other: Integer, - #[serde(default = "default_1856")] + #[serde(default = "default_1859")] pub premise_facts: Integer, - #[serde(default = "default_1857")] + #[serde(default = "default_1860")] pub learning_candidates: Integer, - #[serde(default = "default_1858")] + #[serde(default = "default_1861")] pub ignored_args: Vec, - #[serde(default = "default_1859")] + #[serde(default = "default_1862")] pub segmenter: String, - #[serde(default = "default_1860")] + #[serde(default = "default_1863")] pub cached_tokens_in: Integer, - #[serde(default = "default_1861")] + #[serde(default = "default_1864")] pub ontology_warnings: Vec, - #[serde(default = "default_1862")] + #[serde(default = "default_1865")] pub evidence_ids: Vec, - #[serde(default = "default_1863")] + #[serde(default = "default_1866")] pub belief_source_links: Integer, - #[serde(default = "default_1864")] + #[serde(default = "default_1867")] pub pipeline_errors: Vec, - #[serde(default = "default_1865")] + #[serde(default = "default_1868")] pub value_updates_linked: Integer, - #[serde(default = "default_1866")] + #[serde(default = "default_1869")] pub stubbed_fields: Vec, - #[serde(default = "default_1867")] + #[serde(default = "default_1870")] pub degraded: Vec, - #[serde(default = "default_1868")] + #[serde(default = "default_1871")] pub deferred: bool, - #[serde(default = "default_1869")] + #[serde(default = "default_1872")] pub queue_id: String, - #[serde(default = "default_1870")] + #[serde(default = "default_1873")] pub deferred_by: String, - #[serde(default = "default_1871")] + #[serde(default = "default_1874")] pub stage_ms: std::collections::HashMap, - #[serde(default = "default_1872")] + #[serde(default = "default_1875")] pub observation_date_source: String, - #[serde(default = "default_1873")] + #[serde(default = "default_1876")] pub under_operator_policy: bool, - #[serde(default = "default_1874")] + #[serde(default = "default_1877")] pub extract_prompt_keys: Vec, - #[serde(default = "default_1875")] + #[serde(default = "default_1878")] pub llm_cache_hits: Integer, - #[serde(default = "default_1876")] + #[serde(default = "default_1879")] pub llm_cache_misses: Integer, } @@ -42160,22 +42166,22 @@ pub enum StackEntrySection { #[non_exhaustive] pub struct StackEntry { pub section: StackEntrySection, - #[serde(default = "default_1877")] + #[serde(default = "default_1880")] pub memory_key: String, - #[serde(default = "default_1878")] + #[serde(default = "default_1881")] pub memory_type: String, - #[serde(default = "default_1879")] + #[serde(default = "default_1882")] pub value: String, pub tokens: Integer, - #[serde(default = "default_1880")] + #[serde(default = "default_1883")] pub pinned: bool, - #[serde(default = "default_1881")] + #[serde(default = "default_1884")] pub recall_count: Integer, - #[serde(default = "default_1882")] + #[serde(default = "default_1885")] pub last_recalled_at: Option, - #[serde(default = "default_1883")] + #[serde(default = "default_1886")] pub actor: String, - #[serde(default = "default_1884")] + #[serde(default = "default_1887")] pub namespace: String, } @@ -42360,14 +42366,14 @@ impl MemoryStackInput { pub struct MemoryStatus { pub memory_id: String, pub status: String, - #[serde(default = "default_1885")] + #[serde(default = "default_1888")] pub superseded_by: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemoryStatusesOutput { - #[serde(default = "default_1886")] + #[serde(default = "default_1889")] pub rows: Vec, } @@ -42416,23 +42422,23 @@ impl MemoryStatusesInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MemorySweepExpiredOutput { - #[serde(default = "default_1887")] + #[serde(default = "default_1890")] pub scanned: Integer, - #[serde(default = "default_1888")] + #[serde(default = "default_1891")] pub tombstoned: Integer, - #[serde(default = "default_1889")] + #[serde(default = "default_1892")] pub demoted: Integer, - #[serde(default = "default_1890")] + #[serde(default = "default_1893")] pub anonymized: Integer, - #[serde(default = "default_1891")] + #[serde(default = "default_1894")] pub locked_skipped: Integer, - #[serde(default = "default_1892")] + #[serde(default = "default_1895")] pub moved_skipped: Integer, - #[serde(default = "default_1893")] + #[serde(default = "default_1896")] pub dry_run: bool, - #[serde(default = "default_1894")] + #[serde(default = "default_1897")] pub sample: Vec>, - #[serde(default = "default_1895")] + #[serde(default = "default_1898")] pub failures: Vec, } @@ -42509,10 +42515,10 @@ pub struct MemoryTimelineEntry { pub memory_key: String, pub memory_type: String, pub content_excerpt: String, - #[serde(default = "default_1896")] + #[serde(default = "default_1899")] pub valid_at: Option, pub created_at: String, - #[serde(default = "default_1897")] + #[serde(default = "default_1900")] pub namespace: String, } @@ -42520,7 +42526,7 @@ pub struct MemoryTimelineEntry { #[non_exhaustive] pub struct MemoryTimelineOutput { pub events: Vec, - #[serde(default = "default_1898")] + #[serde(default = "default_1901")] pub total_matching: Integer, } @@ -42712,9 +42718,9 @@ impl MemoryTimelineInput { pub struct MemoryTouchResult { pub memory_key: String, pub touched: bool, - #[serde(default = "default_1901")] + #[serde(default = "default_1904")] pub version: Option, - #[serde(default = "default_1902")] + #[serde(default = "default_1905")] pub expires_at: Option, } @@ -42722,13 +42728,13 @@ pub struct MemoryTouchResult { #[non_exhaustive] pub struct MemoryTouchOutput { pub touched: bool, - #[serde(default = "default_1899")] + #[serde(default = "default_1902")] pub version: Option, - #[serde(default = "default_1900")] - pub expires_at: Option, #[serde(default = "default_1903")] + pub expires_at: Option, + #[serde(default = "default_1906")] pub results: Vec, - #[serde(default = "default_1904")] + #[serde(default = "default_1907")] pub touched_count: Integer, } @@ -42908,15 +42914,15 @@ impl MemoryTouchInput { #[non_exhaustive] pub struct MemoryUnlockOutput { pub unlocked: bool, - #[serde(default = "default_1905")] + #[serde(default = "default_1908")] pub reason: String, - #[serde(default = "default_1906")] + #[serde(default = "default_1909")] pub memory_id: String, - #[serde(default = "default_1907")] + #[serde(default = "default_1910")] pub version: Option, - #[serde(default = "default_1908")] + #[serde(default = "default_1911")] pub previous_mode: String, - #[serde(default = "default_1909")] + #[serde(default = "default_1912")] pub unlocked_by: String, } @@ -43021,11 +43027,11 @@ impl MemoryUnlockInput { #[non_exhaustive] pub struct MemoryUnpinOutput { pub unpinned: bool, - #[serde(default = "default_1910")] + #[serde(default = "default_1913")] pub reason: String, - #[serde(default = "default_1911")] + #[serde(default = "default_1914")] pub memory_id: String, - #[serde(default = "default_1912")] + #[serde(default = "default_1915")] pub version: Option, } @@ -43119,15 +43125,15 @@ impl MemoryUnpinInput { #[non_exhaustive] pub struct MemoryUpdateCandidate { pub memory_id: String, - #[serde(default = "default_1918")] + #[serde(default = "default_1921")] pub agent: String, - #[serde(default = "default_1919")] + #[serde(default = "default_1922")] pub user_id: String, - #[serde(default = "default_1920")] + #[serde(default = "default_1923")] pub session_id: String, - #[serde(default = "default_1921")] + #[serde(default = "default_1924")] pub version: Integer, - #[serde(default = "default_1922")] + #[serde(default = "default_1925")] pub status: String, } @@ -43135,23 +43141,23 @@ pub struct MemoryUpdateCandidate { #[non_exhaustive] pub struct MemoryUpdateOutput { pub updated: bool, - #[serde(default = "default_1913")] + #[serde(default = "default_1916")] pub memory_id: String, - #[serde(default = "default_1914")] + #[serde(default = "default_1917")] pub memory_key: String, - #[serde(default = "default_1915")] + #[serde(default = "default_1918")] pub new_version: Integer, - #[serde(default = "default_1916")] + #[serde(default = "default_1919")] pub content_sha256: String, - #[serde(default = "default_1917")] + #[serde(default = "default_1920")] pub reason: String, - #[serde(default = "default_1923")] + #[serde(default = "default_1926")] pub candidates: Vec, - #[serde(default = "default_1924")] + #[serde(default = "default_1927")] pub conflict_verdict: String, - #[serde(default = "default_1925")] + #[serde(default = "default_1928")] pub conflict_peers: Integer, - #[serde(default = "default_1926")] + #[serde(default = "default_1929")] pub duplicate_of: String, } @@ -43360,15 +43366,15 @@ impl MemoryUpdateInput { #[non_exhaustive] pub struct MemoryUpdateByIdOutput { pub updated: bool, - #[serde(default = "default_1927")] + #[serde(default = "default_1930")] pub new_version: Integer, - #[serde(default = "default_1928")] + #[serde(default = "default_1931")] pub content_sha256: String, - #[serde(default = "default_1929")] + #[serde(default = "default_1932")] pub conflict_verdict: String, - #[serde(default = "default_1930")] + #[serde(default = "default_1933")] pub conflict_peers: Integer, - #[serde(default = "default_1931")] + #[serde(default = "default_1934")] pub duplicate_of: String, } @@ -43496,23 +43502,23 @@ impl MemoryUpdateByIdInput { #[non_exhaustive] pub struct MemoryVerifyOutput { pub found: bool, - #[serde(default = "default_1932")] + #[serde(default = "default_1935")] pub changed: bool, - #[serde(default = "default_1933")] + #[serde(default = "default_1936")] pub memory_id: String, - #[serde(default = "default_1934")] + #[serde(default = "default_1937")] pub memory_key: String, - #[serde(default = "default_1935")] + #[serde(default = "default_1938")] pub namespace: String, - #[serde(default = "default_1936")] + #[serde(default = "default_1939")] pub verified_by: String, - #[serde(default = "default_1937")] + #[serde(default = "default_1940")] pub verified_at: Option, - #[serde(default = "default_1938")] + #[serde(default = "default_1941")] pub verification: String, - #[serde(default = "default_1939")] + #[serde(default = "default_1942")] pub version: Integer, - #[serde(default = "default_1940")] + #[serde(default = "default_1943")] pub content_sha256: String, } @@ -43717,13 +43723,13 @@ pub struct SchemaFieldOutput { #[serde(rename = "type")] pub r#type: String, pub required: bool, - #[serde(default = "default_1943")] + #[serde(default = "default_1946")] pub identity: bool, - #[serde(default = "default_1944")] + #[serde(default = "default_1947")] pub enum_values: Vec, - #[serde(default = "default_1945")] + #[serde(default = "default_1948")] pub constraints: std::collections::HashMap, - #[serde(default = "default_1946")] + #[serde(default = "default_1949")] pub description: String, } @@ -43732,11 +43738,11 @@ pub struct SchemaFieldOutput { pub struct MemorySchemaSummary { pub schema_id: String, pub name: String, - #[serde(default = "default_1941")] + #[serde(default = "default_1944")] pub description: String, - #[serde(default = "default_1942")] + #[serde(default = "default_1945")] pub status: String, - #[serde(default = "default_1947")] + #[serde(default = "default_1950")] pub fields: Vec, } @@ -44151,13 +44157,13 @@ impl MemorySchemaRegisterInput { #[non_exhaustive] pub struct MentorPlane { pub plane: String, - #[serde(default = "default_1949")] + #[serde(default = "default_1952")] pub calls: Integer, - #[serde(default = "default_1950")] + #[serde(default = "default_1953")] pub available: Option, - #[serde(default = "default_1951")] + #[serde(default = "default_1954")] pub when: String, - #[serde(default = "default_1952")] + #[serde(default = "default_1955")] pub mentored: bool, } @@ -44167,11 +44173,11 @@ pub struct MentorHint { pub code: String, pub severity: String, pub text: String, - #[serde(default = "default_1954")] + #[serde(default = "default_1957")] pub ops: Vec, - #[serde(default = "default_1955")] + #[serde(default = "default_1958")] pub evidence: std::collections::HashMap, - #[serde(default = "default_1956")] + #[serde(default = "default_1959")] pub plane: Option, } @@ -44179,9 +44185,9 @@ pub struct MentorHint { #[non_exhaustive] pub struct MentorAdoption { pub code: String, - #[serde(default = "default_1958")] + #[serde(default = "default_1961")] pub shown_sessions: Integer, - #[serde(default = "default_1959")] + #[serde(default = "default_1962")] pub followed_sessions: Integer, } @@ -44217,7 +44223,7 @@ pub enum UsageRungSource { #[non_exhaustive] pub struct UsageRung { pub rung: UsageRungRung, - #[serde(default = "default_1961")] + #[serde(default = "default_1964")] pub count: Option, pub source: UsageRungSource, pub meaning: String, @@ -44232,27 +44238,27 @@ pub struct MentorBriefOutput { pub window_seconds: Integer, pub computed_at: String, pub sessions: Integer, - #[serde(default = "default_1948")] + #[serde(default = "default_1951")] pub usage: std::collections::HashMap, - #[serde(default = "default_1953")] + #[serde(default = "default_1956")] pub planes: Vec, - #[serde(default = "default_1957")] - pub hints: Vec, #[serde(default = "default_1960")] + pub hints: Vec, + #[serde(default = "default_1963")] pub adoption: Vec, - #[serde(default = "default_1962")] + #[serde(default = "default_1965")] pub usage_evidence: Vec, - #[serde(default = "default_1963")] + #[serde(default = "default_1966")] pub ledger_from: Option, - #[serde(default = "default_1964")] + #[serde(default = "default_1967")] pub ledger_retention_days: Option, - #[serde(default = "default_1965")] + #[serde(default = "default_1968")] pub agents: Vec, - #[serde(default = "default_1966")] + #[serde(default = "default_1969")] pub agent_defaulted: bool, - #[serde(default = "default_1967")] + #[serde(default = "default_1970")] pub skipped: Vec, - #[serde(default = "default_1968")] + #[serde(default = "default_1971")] pub healthy: bool, } @@ -44401,33 +44407,33 @@ impl MentorGuideInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct NamespaceAuditSummary { - #[serde(default = "default_1969")] + #[serde(default = "default_1972")] pub live_rows: Integer, - #[serde(default = "default_1970")] + #[serde(default = "default_1973")] pub live_bytes: Integer, - #[serde(default = "default_1971")] + #[serde(default = "default_1974")] pub excerpt_bytes: Integer, - #[serde(default = "default_1972")] + #[serde(default = "default_1975")] pub version_rows: Integer, - #[serde(default = "default_1973")] + #[serde(default = "default_1976")] pub version_bytes: Integer, - #[serde(default = "default_1974")] + #[serde(default = "default_1977")] pub unembedded_rows: Integer, - #[serde(default = "default_1975")] + #[serde(default = "default_1978")] pub gets: Integer, - #[serde(default = "default_1976")] + #[serde(default = "default_1979")] pub searches: Integer, - #[serde(default = "default_1977")] + #[serde(default = "default_1980")] pub sets: Integer, - #[serde(default = "default_1978")] + #[serde(default = "default_1981")] pub get_search_ratio: f64, - #[serde(default = "default_1979")] + #[serde(default = "default_1982")] pub inspector_calls: Integer, - #[serde(default = "default_1980")] + #[serde(default = "default_1983")] pub typed_gets: Integer, - #[serde(default = "default_1981")] + #[serde(default = "default_1984")] pub written_in_window: Integer, - #[serde(default = "default_1982")] + #[serde(default = "default_1985")] pub ledger_calls: Integer, } @@ -44459,25 +44465,25 @@ pub struct NamespaceAuditFinding { pub kind: NamespaceAuditFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_1983")] + #[serde(default = "default_1986")] pub window_seconds: Option, - #[serde(default = "default_1984")] + #[serde(default = "default_1987")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_1985")] + #[serde(default = "default_1988")] pub evidence: Vec, - #[serde(default = "default_1986")] + #[serde(default = "default_1989")] pub exceptions: String, - #[serde(default = "default_1987")] + #[serde(default = "default_1990")] pub uncertainty: String, pub code: String, pub severity: NamespaceAuditFindingSeverity, pub count: Integer, pub share: f64, - #[serde(default = "default_1988")] + #[serde(default = "default_1991")] pub bytes: Integer, - #[serde(default = "default_1989")] + #[serde(default = "default_1992")] pub samples: Vec>, pub detail: String, pub remedy: String, @@ -44492,7 +44498,7 @@ pub struct NamespaceAuditOutput { pub window_seconds: Integer, pub summary: NamespaceAuditSummary, pub findings: Vec, - #[serde(default = "default_1990")] + #[serde(default = "default_1993")] pub skipped: Vec, pub coverage: ReportCoverage, pub healthy: bool, @@ -44583,29 +44589,29 @@ pub enum BrowseEntryMyStatus { #[non_exhaustive] pub struct BrowseEntry { pub namespace: String, - #[serde(default = "default_1991")] + #[serde(default = "default_1994")] pub kind: String, pub description: String, pub owner_email: String, pub member_count: Integer, - #[serde(default = "default_1992")] + #[serde(default = "default_1995")] pub requires_approval: bool, pub created_at: String, - #[serde(default = "default_1993")] + #[serde(default = "default_1996")] pub join_policy: String, - #[serde(default = "default_1994")] + #[serde(default = "default_1997")] pub visibility: String, - #[serde(default = "default_1995")] + #[serde(default = "default_1998")] pub my_status: BrowseEntryMyStatus, - #[serde(default = "default_1996")] + #[serde(default = "default_1999")] pub my_role: String, - #[serde(default = "default_1997")] + #[serde(default = "default_2000")] pub repo: String, - #[serde(default = "default_1998")] + #[serde(default = "default_2001")] pub branch: String, - #[serde(default = "default_1999")] + #[serde(default = "default_2002")] pub guide_revision: Integer, - #[serde(default = "default_2000")] + #[serde(default = "default_2003")] pub guide_summary: String, } @@ -44709,9 +44715,9 @@ pub enum NamespaceCancelRequestOutputClearedRole { pub struct NamespaceCancelRequestOutput { pub cancelled: bool, pub namespace: String, - #[serde(default = "default_2001")] + #[serde(default = "default_2004")] pub cleared_role: Option, - #[serde(default = "default_2002")] + #[serde(default = "default_2005")] pub cancelled_at: Option, } @@ -44783,7 +44789,7 @@ pub struct NamespaceDeleteOutput { pub deleted: bool, pub namespace: String, pub updated_at: String, - #[serde(default = "default_2003")] + #[serde(default = "default_2006")] pub sources_retired: Vec, } @@ -44852,67 +44858,67 @@ pub enum NamespaceGetOutputClassification { pub struct NamespaceGetOutput { pub found: bool, pub namespace: String, - #[serde(default = "default_2004")] + #[serde(default = "default_2007")] pub kind: Option, - #[serde(default = "default_2005")] + #[serde(default = "default_2008")] pub owner_email: Option, - #[serde(default = "default_2006")] + #[serde(default = "default_2009")] pub description: Option, - #[serde(default = "default_2007")] + #[serde(default = "default_2010")] pub tags: Option>, - #[serde(default = "default_2008")] + #[serde(default = "default_2011")] pub active: Option, - #[serde(default = "default_2009")] + #[serde(default = "default_2012")] pub conversation_logging_enabled: Option, - #[serde(default = "default_2010")] + #[serde(default = "default_2013")] pub capture_generation_io: Option, - #[serde(default = "default_2011")] + #[serde(default = "default_2014")] pub coverage_sweep: Option, - #[serde(default = "default_2012")] + #[serde(default = "default_2015")] pub consolidation_enabled: Option, - #[serde(default = "default_2013")] + #[serde(default = "default_2016")] pub daily_cost_cap_usd: Option, - #[serde(default = "default_2014")] + #[serde(default = "default_2017")] pub daily_user_cost_cap_usd: Option, - #[serde(default = "default_2015")] + #[serde(default = "default_2018")] pub budget_alert_inbox: Option, - #[serde(default = "default_2016")] + #[serde(default = "default_2019")] pub conflict_threshold: Option, - #[serde(default = "default_2017")] + #[serde(default = "default_2020")] pub retention_days: Option, - #[serde(default = "default_2018")] + #[serde(default = "default_2021")] pub warm_days: Option, - #[serde(default = "default_2019")] + #[serde(default = "default_2022")] pub visibility: Option, - #[serde(default = "default_2020")] + #[serde(default = "default_2023")] pub requires_approval: Option, - #[serde(default = "default_2021")] + #[serde(default = "default_2024")] pub join_policy: Option, - #[serde(default = "default_2022")] + #[serde(default = "default_2025")] pub effective_join_policy: Option, - #[serde(default = "default_2023")] + #[serde(default = "default_2026")] pub retrieval_defaults: Option>, - #[serde(default = "default_2024")] + #[serde(default = "default_2027")] pub rerank_endpoint: Option, - #[serde(default = "default_2025")] + #[serde(default = "default_2028")] pub classify_endpoint: Option, - #[serde(default = "default_2026")] + #[serde(default = "default_2029")] pub default_conflict_policy: Option, - #[serde(default = "default_2027")] + #[serde(default = "default_2030")] pub proposal_policy: Option, - #[serde(default = "default_2028")] + #[serde(default = "default_2031")] pub code_change_policy: Option, - #[serde(default = "default_2029")] + #[serde(default = "default_2032")] pub tag_registry: Option>>, - #[serde(default = "default_2030")] + #[serde(default = "default_2033")] pub classification: Option, - #[serde(default = "default_2031")] + #[serde(default = "default_2034")] pub guide_revision: Option, - #[serde(default = "default_2032")] + #[serde(default = "default_2035")] pub guide_summary: Option, - #[serde(default = "default_2033")] + #[serde(default = "default_2036")] pub created_at: Option, - #[serde(default = "default_2034")] + #[serde(default = "default_2037")] pub updated_at: Option, } @@ -44965,17 +44971,17 @@ impl NamespaceGetInput { #[non_exhaustive] pub struct NamespaceGuideGetOutput { pub found: bool, - #[serde(default = "default_2035")] + #[serde(default = "default_2038")] pub revision: Integer, - #[serde(default = "default_2036")] + #[serde(default = "default_2039")] pub content: String, - #[serde(default = "default_2037")] + #[serde(default = "default_2040")] pub summary: String, - #[serde(default = "default_2038")] + #[serde(default = "default_2041")] pub note: String, - #[serde(default = "default_2039")] + #[serde(default = "default_2042")] pub updated_by: String, - #[serde(default = "default_2040")] + #[serde(default = "default_2043")] pub updated_at: Option, } @@ -45112,17 +45118,17 @@ impl NamespaceGuideHistoryInput { #[non_exhaustive] pub struct NamespaceGuideSetOutputNamespaceGuideGetOutput { pub found: bool, - #[serde(default = "default_2042")] + #[serde(default = "default_2045")] pub revision: Integer, - #[serde(default = "default_2043")] + #[serde(default = "default_2046")] pub content: String, - #[serde(default = "default_2044")] + #[serde(default = "default_2047")] pub summary: String, - #[serde(default = "default_2045")] + #[serde(default = "default_2048")] pub note: String, - #[serde(default = "default_2046")] + #[serde(default = "default_2049")] pub updated_by: String, - #[serde(default = "default_2047")] + #[serde(default = "default_2050")] pub updated_at: Option, } @@ -45130,10 +45136,10 @@ pub struct NamespaceGuideSetOutputNamespaceGuideGetOutput { #[non_exhaustive] pub struct NamespaceGuideSetOutput { pub written: bool, - #[serde(default = "default_2041")] + #[serde(default = "default_2044")] pub conflict: bool, pub revision: Integer, - #[serde(default = "default_2048")] + #[serde(default = "default_2051")] pub current: Option, } @@ -45254,7 +45260,7 @@ pub struct InventorySection { #[serde(deserialize_with = "required_nullable")] pub latest_at: Option, pub complete: bool, - #[serde(default = "default_2049")] + #[serde(default = "default_2052")] pub reason: String, } @@ -45284,10 +45290,10 @@ pub struct InventoryPopulation { pub population: InventoryPopulationPopulation, #[serde(deserialize_with = "required_nullable")] pub total: Option, - #[serde(default = "default_2050")] + #[serde(default = "default_2053")] pub top: Vec, pub complete: bool, - #[serde(default = "default_2051")] + #[serde(default = "default_2054")] pub reason: String, } @@ -45453,11 +45459,11 @@ pub struct NamespaceJoinOutput { pub joined: bool, pub namespace: String, pub role: NamespaceJoinOutputRole, - #[serde(default = "default_2052")] + #[serde(default = "default_2055")] pub status: String, - #[serde(default = "default_2053")] + #[serde(default = "default_2056")] pub requested_role: Option, - #[serde(default = "default_2054")] + #[serde(default = "default_2057")] pub pending_admins: Vec, pub joined_at: String, } @@ -45549,7 +45555,7 @@ impl NamespaceJoinInput { pub struct NamespaceLeaveOutput { pub left: bool, pub namespace: String, - #[serde(default = "default_2055")] + #[serde(default = "default_2058")] pub left_at: Option, } @@ -45626,27 +45632,27 @@ pub enum NamespaceEntryVisibility { #[non_exhaustive] pub struct NamespaceEntry { pub namespace: String, - #[serde(default = "default_2056")] + #[serde(default = "default_2059")] pub kind: String, pub owner_email: String, pub description: String, pub tags: Vec, pub active: bool, - #[serde(default = "default_2057")] + #[serde(default = "default_2060")] pub consolidation_enabled: bool, - #[serde(default = "default_2058")] + #[serde(default = "default_2061")] pub daily_cost_cap_usd: f64, - #[serde(default = "default_2059")] + #[serde(default = "default_2062")] pub daily_user_cost_cap_usd: f64, - #[serde(default = "default_2060")] + #[serde(default = "default_2063")] pub budget_alert_inbox: String, - #[serde(default = "default_2061")] + #[serde(default = "default_2064")] pub conflict_threshold: Option, - #[serde(default = "default_2062")] + #[serde(default = "default_2065")] pub retention_days: Integer, - #[serde(default = "default_2063")] + #[serde(default = "default_2066")] pub warm_days: Integer, - #[serde(default = "default_2064")] + #[serde(default = "default_2067")] pub visibility: NamespaceEntryVisibility, pub created_at: String, pub updated_at: String, @@ -45801,27 +45807,27 @@ pub enum MineEntryVisibility { pub struct MineEntry { pub namespace: String, pub role: String, - #[serde(default = "default_2065")] + #[serde(default = "default_2068")] pub status: String, - #[serde(default = "default_2066")] + #[serde(default = "default_2069")] pub pending_role: Option, - #[serde(default = "default_2067")] + #[serde(default = "default_2070")] pub pending_since: Option, - #[serde(default = "default_2068")] + #[serde(default = "default_2071")] pub pending_admins: Vec, - #[serde(default = "default_2069")] + #[serde(default = "default_2072")] pub visibility: MineEntryVisibility, - #[serde(default = "default_2070")] + #[serde(default = "default_2073")] pub kind: String, - #[serde(default = "default_2071")] + #[serde(default = "default_2074")] pub title: String, - #[serde(default = "default_2072")] + #[serde(default = "default_2075")] pub description: String, - #[serde(default = "default_2073")] + #[serde(default = "default_2076")] pub joined_at: Option, - #[serde(default = "default_2074")] + #[serde(default = "default_2077")] pub is_new: bool, - #[serde(default = "default_2075")] + #[serde(default = "default_2078")] pub inherited: bool, } @@ -45887,7 +45893,7 @@ pub struct OntologyEntry { pub name: String, pub status: String, pub description: String, - #[serde(default = "default_2076")] + #[serde(default = "default_2079")] pub cardinality: String, pub created_by: String, pub updated_at: String, @@ -46080,7 +46086,7 @@ pub struct NamespaceRegisterOutput { pub registered: bool, pub namespace: String, pub updated_at: String, - #[serde(default = "default_2077")] + #[serde(default = "default_2080")] pub visibility: NamespaceRegisterOutputVisibility, } @@ -47160,7 +47166,7 @@ impl NamespaceRegisterOntologyInput { #[non_exhaustive] pub struct NamespaceRestoreOutput { pub restored: bool, - #[serde(default = "default_2078")] + #[serde(default = "default_2081")] pub publication_pending: bool, pub target_namespace: String, pub snapshot_id: String, @@ -48047,15 +48053,15 @@ pub struct NamespaceRollbackOutput { pub version_at: Integer, pub reinstate: Integer, pub remove: Integer, - #[serde(default = "default_2079")] + #[serde(default = "default_2082")] pub skipped_no_head: Integer, - #[serde(default = "default_2080")] + #[serde(default = "default_2083")] pub skipped_already_gone: Integer, - #[serde(default = "default_2081")] + #[serde(default = "default_2084")] pub truncated: bool, - #[serde(default = "default_2082")] + #[serde(default = "default_2085")] pub sample: Vec>, - #[serde(default = "default_2083")] + #[serde(default = "default_2086")] pub applied_at: Option, } @@ -48234,101 +48240,101 @@ pub struct NamespaceSnapshotOutputSnapshotMemoryRow { pub confidence: f64, pub source_trace: String, pub pinned: bool, - #[serde(default = "default_2084")] + #[serde(default = "default_2087")] pub expires_at: Option, - #[serde(default = "default_2085")] + #[serde(default = "default_2088")] pub entities: Vec, - #[serde(default = "default_2086")] + #[serde(default = "default_2089")] pub version: Integer, - #[serde(default = "default_2087")] + #[serde(default = "default_2090")] pub content_sha256: String, - #[serde(default = "default_2088")] + #[serde(default = "default_2091")] pub actor: String, - #[serde(default = "default_2089")] + #[serde(default = "default_2092")] pub source_class: String, - #[serde(default = "default_2090")] + #[serde(default = "default_2093")] pub source_resource_id: String, - #[serde(default = "default_2091")] + #[serde(default = "default_2094")] pub verified_by: String, - #[serde(default = "default_2092")] + #[serde(default = "default_2095")] pub verified_at: Option, - #[serde(default = "default_2093")] + #[serde(default = "default_2096")] pub verified_sha256: String, - #[serde(default = "default_2094")] + #[serde(default = "default_2097")] pub grounding: String, - #[serde(default = "default_2095")] + #[serde(default = "default_2098")] pub evidence: String, - #[serde(default = "default_2096")] + #[serde(default = "default_2099")] pub tags: Vec, - #[serde(default = "default_2097")] + #[serde(default = "default_2100")] pub valid_at: Option, - #[serde(default = "default_2098")] + #[serde(default = "default_2101")] pub valid_to: Option, - #[serde(default = "default_2099")] + #[serde(default = "default_2102")] pub created_at: Option, - #[serde(default = "default_2100")] + #[serde(default = "default_2103")] pub updated_at: Option, - #[serde(default = "default_2101")] + #[serde(default = "default_2104")] pub value_json: String, - #[serde(default = "default_2102")] + #[serde(default = "default_2105")] pub status: NamespaceSnapshotOutputSnapshotMemoryRowStatus, - #[serde(default = "default_2103")] + #[serde(default = "default_2106")] pub requires_review: Option, - #[serde(default = "default_2104")] + #[serde(default = "default_2107")] pub conflict_with: Vec, - #[serde(default = "default_2105")] + #[serde(default = "default_2108")] pub duplicate_of: String, - #[serde(default = "default_2106")] + #[serde(default = "default_2109")] pub evidence_count: Integer, - #[serde(default = "default_2107")] + #[serde(default = "default_2110")] pub recall_count: Integer, - #[serde(default = "default_2108")] + #[serde(default = "default_2111")] pub last_recalled_at: Option, - #[serde(default = "default_2109")] + #[serde(default = "default_2112")] pub cross_promoted_from_memory_id: String, - #[serde(default = "default_2110")] + #[serde(default = "default_2113")] pub cross_promoted_from_namespace: String, - #[serde(default = "default_2111")] + #[serde(default = "default_2114")] pub superseded_by: String, - #[serde(default = "default_2112")] + #[serde(default = "default_2115")] pub rejection_reason: String, - #[serde(default = "default_2113")] + #[serde(default = "default_2116")] pub temporal_anchor: Option, - #[serde(default = "default_2114")] + #[serde(default = "default_2117")] pub temporal_confidence: f64, - #[serde(default = "default_2115")] + #[serde(default = "default_2118")] pub invalid_at: Option, - #[serde(default = "default_2116")] + #[serde(default = "default_2119")] pub char_limit: Option, - #[serde(default = "default_2117")] + #[serde(default = "default_2120")] pub reinforcement_count: Integer, - #[serde(default = "default_2118")] + #[serde(default = "default_2121")] pub last_reinforced_at: Option, - #[serde(default = "default_2119")] + #[serde(default = "default_2122")] pub mentioned_at: Option, - #[serde(default = "default_2120")] + #[serde(default = "default_2123")] pub sensitivity: String, - #[serde(default = "default_2121")] + #[serde(default = "default_2124")] pub redacted_at: Option, - #[serde(default = "default_2122")] + #[serde(default = "default_2125")] pub redaction_reason: String, - #[serde(default = "default_2123")] + #[serde(default = "default_2126")] pub lock_mode: String, - #[serde(default = "default_2124")] + #[serde(default = "default_2127")] pub lock_reason: String, - #[serde(default = "default_2125")] + #[serde(default = "default_2128")] pub lock_until: Option, - #[serde(default = "default_2126")] + #[serde(default = "default_2129")] pub locked_by: String, - #[serde(default = "default_2127")] + #[serde(default = "default_2130")] pub locked_at: Option, - #[serde(default = "default_2128")] + #[serde(default = "default_2131")] pub on_expire: String, - #[serde(default = "default_2129")] + #[serde(default = "default_2132")] pub expire_reason: String, - #[serde(default = "default_2130")] + #[serde(default = "default_2133")] pub files: Vec, - #[serde(default = "default_2131")] + #[serde(default = "default_2134")] pub concepts: Vec, } @@ -48337,11 +48343,11 @@ pub struct NamespaceSnapshotOutputSnapshotMemoryRow { pub struct NamespaceSnapshotOutputSnapshotTypeRow { pub memory_type: String, pub retention_days: Integer, - #[serde(default = "default_2132")] + #[serde(default = "default_2135")] pub dedup_threshold: Option, - #[serde(default = "default_2133")] + #[serde(default = "default_2136")] pub hot_quota: Integer, - #[serde(default = "default_2134")] + #[serde(default = "default_2137")] pub conflict_policy: String, } @@ -48556,7 +48562,7 @@ pub struct TaxonomyCommunity { pub community_id: Integer, pub label: String, pub size: Integer, - #[serde(default = "default_2135")] + #[serde(default = "default_2138")] pub top_entities: Vec, } @@ -48567,9 +48573,9 @@ pub struct NamespaceTaxonomyOutput { pub entities: Vec, pub memory_count: Integer, pub memory_types: Vec, - #[serde(default = "default_2136")] + #[serde(default = "default_2139")] pub communities: Vec, - #[serde(default = "default_2137")] + #[serde(default = "default_2140")] pub communities_computed_at: String, } @@ -48669,15 +48675,15 @@ pub enum TuneProposalTarget { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TuneEvidence { - #[serde(default = "default_2139")] + #[serde(default = "default_2142")] pub finding_codes: Vec, - #[serde(default = "default_2140")] + #[serde(default = "default_2143")] pub supporting_count: Integer, - #[serde(default = "default_2141")] + #[serde(default = "default_2144")] pub supporting: Vec, - #[serde(default = "default_2142")] + #[serde(default = "default_2145")] pub counter_count: Option, - #[serde(default = "default_2143")] + #[serde(default = "default_2146")] pub documents: Vec, } @@ -48703,10 +48709,10 @@ pub enum TuneApplyVia { #[non_exhaustive] pub struct TuneApply { pub op: String, - #[serde(default = "default_2147")] + #[serde(default = "default_2150")] pub via: TuneApplyVia, pub args: std::collections::HashMap, - #[serde(default = "default_2148")] + #[serde(default = "default_2151")] pub args_complete: bool, pub required_role: String, pub guard: String, @@ -48725,7 +48731,7 @@ pub struct ChunkStats { pub sections: Integer, pub sections_cut: Integer, pub max_input_tokens: Integer, - #[serde(default = "default_2150")] + #[serde(default = "default_2153")] pub over_input_limit: Option, } @@ -48745,25 +48751,25 @@ pub struct TuneProposal { pub title: String, pub rationale: String, pub current: String, - #[serde(default = "default_2138")] + #[serde(default = "default_2141")] pub current_revision: Option, pub proposed: String, pub evidence: TuneEvidence, - #[serde(default = "default_2144")] + #[serde(default = "default_2147")] pub affected_agents: Vec, - #[serde(default = "default_2145")] + #[serde(default = "default_2148")] pub affected_agents_total: Option, - #[serde(default = "default_2146")] + #[serde(default = "default_2149")] pub effect: TuneProposalEffect, pub historical: String, pub apply: TuneApply, - #[serde(default = "default_2149")] + #[serde(default = "default_2152")] pub apply_also: Vec, - #[serde(default = "default_2151")] + #[serde(default = "default_2154")] pub preview: Option, - #[serde(default = "default_2152")] + #[serde(default = "default_2155")] pub limits: String, - #[serde(default = "default_2153")] + #[serde(default = "default_2156")] pub refs: Vec, } @@ -48771,13 +48777,13 @@ pub struct TuneProposal { #[non_exhaustive] pub struct ChunkingSample { pub cap: Integer, - #[serde(default = "default_2159")] + #[serde(default = "default_2162")] pub population: Option, pub documents: Integer, pub unread: Integer, pub load_cap: Integer, pub embedder_model: String, - #[serde(default = "default_2160")] + #[serde(default = "default_2163")] pub input_token_limit: Option, pub current: ChunkStats, } @@ -48788,21 +48794,21 @@ pub struct NamespaceTuneOutput { pub org: String, pub namespace: String, pub computed_at: String, - #[serde(default = "default_2154")] + #[serde(default = "default_2157")] pub proposals: Vec, - #[serde(default = "default_2155")] + #[serde(default = "default_2158")] pub guide_revision: Option, - #[serde(default = "default_2156")] + #[serde(default = "default_2159")] pub categories_registered: Option, - #[serde(default = "default_2157")] + #[serde(default = "default_2160")] pub extraction_policy: Option, - #[serde(default = "default_2158")] - pub extraction_policy_unavailable: String, #[serde(default = "default_2161")] + pub extraction_policy_unavailable: String, + #[serde(default = "default_2164")] pub chunking: Option, - #[serde(default = "default_2162")] + #[serde(default = "default_2165")] pub skipped: Vec, - #[serde(default = "default_2163")] + #[serde(default = "default_2166")] pub model_used: bool, } @@ -48923,25 +48929,25 @@ pub struct NamespaceValidateFinding { pub kind: NamespaceValidateFindingKind, pub rule_version: Integer, pub source_op: String, - #[serde(default = "default_2164")] + #[serde(default = "default_2167")] pub window_seconds: Option, - #[serde(default = "default_2165")] + #[serde(default = "default_2168")] pub population: Option, pub sample_limit: Integer, pub samples_complete: bool, - #[serde(default = "default_2166")] + #[serde(default = "default_2169")] pub evidence: Vec, - #[serde(default = "default_2167")] + #[serde(default = "default_2170")] pub exceptions: String, - #[serde(default = "default_2168")] + #[serde(default = "default_2171")] pub uncertainty: String, pub check: String, pub severity: NamespaceValidateFindingSeverity, pub count: Integer, - #[serde(default = "default_2169")] + #[serde(default = "default_2172")] pub samples: Vec>, pub detail: String, - #[serde(default = "default_2170")] + #[serde(default = "default_2173")] pub totals: std::collections::HashMap, } @@ -48955,9 +48961,9 @@ pub struct NamespaceValidateOutput { pub warnings: Integer, pub infos: Integer, pub findings: Vec, - #[serde(default = "default_2171")] + #[serde(default = "default_2174")] pub skipped: Vec, - #[serde(default = "default_2172")] + #[serde(default = "default_2175")] pub keys_scoped: Integer, pub coverage: ReportCoverage, pub checked_at: String, @@ -49077,9 +49083,9 @@ impl NamespaceValidateInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ObserveCrystallizeOutput { - #[serde(default = "default_2173")] + #[serde(default = "default_2176")] pub enqueued: Integer, - #[serde(default = "default_2174")] + #[serde(default = "default_2177")] pub session_id: String, } @@ -49176,23 +49182,23 @@ impl ObserveCrystallizeInput { #[non_exhaustive] pub struct ObserveRecordOutput { pub memory_key: String, - #[serde(default = "default_2175")] + #[serde(default = "default_2178")] pub memory_id: String, - #[serde(default = "default_2176")] + #[serde(default = "default_2179")] pub kind: String, - #[serde(default = "default_2177")] + #[serde(default = "default_2180")] pub tags: Vec, - #[serde(default = "default_2178")] + #[serde(default = "default_2181")] pub file_paths: Vec, - #[serde(default = "default_2179")] + #[serde(default = "default_2182")] pub content_sha256: String, - #[serde(default = "default_2180")] + #[serde(default = "default_2183")] pub tool_name: String, - #[serde(default = "default_2181")] + #[serde(default = "default_2184")] pub has_error: bool, - #[serde(default = "default_2182")] + #[serde(default = "default_2185")] pub narrative_chars: Integer, - #[serde(default = "default_2183")] + #[serde(default = "default_2186")] pub skipped_reason: String, } @@ -49391,26 +49397,26 @@ pub struct ProjectionFailureRow { pub failure_id: String, pub org: String, pub namespace: String, - #[serde(default = "default_2184")] + #[serde(default = "default_2187")] pub agent: String, pub projection: String, - #[serde(default = "default_2185")] + #[serde(default = "default_2188")] pub source_operation: String, - #[serde(default = "default_2186")] + #[serde(default = "default_2189")] pub source_resource_id: String, - #[serde(default = "default_2187")] + #[serde(default = "default_2190")] pub memory_keys: Vec, - #[serde(default = "default_2188")] + #[serde(default = "default_2191")] pub error_type: String, - #[serde(default = "default_2189")] + #[serde(default = "default_2192")] pub error_message: String, - #[serde(default = "default_2190")] + #[serde(default = "default_2193")] pub payload: std::collections::HashMap, - #[serde(default = "default_2191")] + #[serde(default = "default_2194")] pub status: String, - #[serde(default = "default_2192")] + #[serde(default = "default_2195")] pub created_at: Option, - #[serde(default = "default_2193")] + #[serde(default = "default_2196")] pub resolved_at: Option, } @@ -49564,22 +49570,22 @@ pub struct ProjectionFailureRetryRow { pub projection: String, pub retried: bool, pub resolved: bool, - #[serde(default = "default_2194")] + #[serde(default = "default_2197")] pub abandoned: bool, - #[serde(default = "default_2195")] + #[serde(default = "default_2198")] pub reason: String, - #[serde(default = "default_2196")] + #[serde(default = "default_2199")] pub error: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProjectionFailureRetryOutput { - #[serde(default = "default_2197")] + #[serde(default = "default_2200")] pub results: Vec, pub retried: Integer, pub resolved: Integer, - #[serde(default = "default_2198")] + #[serde(default = "default_2201")] pub abandoned: Integer, } @@ -49661,15 +49667,15 @@ impl ProjectionFailureRetryInput { pub struct OrgModelCallsOutput { pub org: String, pub enabled: bool, - #[serde(default = "default_2199")] + #[serde(default = "default_2202")] pub reason: String, - #[serde(default = "default_2200")] + #[serde(default = "default_2203")] pub updated_by: String, - #[serde(default = "default_2201")] + #[serde(default = "default_2204")] pub updated_at: Option, - #[serde(default = "default_2202")] + #[serde(default = "default_2205")] pub locked: bool, - #[serde(default = "default_2203")] + #[serde(default = "default_2206")] pub locked_by: String, } @@ -50008,7 +50014,7 @@ impl PolicyDecisionsInput { #[non_exhaustive] pub struct PolicyDeleteOutput { pub removed: bool, - #[serde(default = "default_2204")] + #[serde(default = "default_2207")] pub widening: bool, } @@ -50074,12 +50080,12 @@ pub struct PolicyRuleOut { pub condition: std::collections::HashMap, pub description: String, pub enabled: bool, - #[serde(default = "default_2205")] + #[serde(default = "default_2208")] pub mode: String, pub created_by: String, - #[serde(default = "default_2206")] + #[serde(default = "default_2209")] pub created_at: Option, - #[serde(default = "default_2207")] + #[serde(default = "default_2210")] pub updated_at: Option, } @@ -50151,9 +50157,9 @@ impl PolicyListInput { pub struct PolicySetOutput { pub rule: PolicyRuleOut, pub leaf_count: Integer, - #[serde(default = "default_2208")] + #[serde(default = "default_2211")] pub widening: bool, - #[serde(default = "default_2209")] + #[serde(default = "default_2212")] pub change: Vec, } @@ -50423,37 +50429,37 @@ pub struct ProcedureEvolveOutput { pub revision: Integer, pub changed: bool, pub template: bool, - #[serde(default = "default_2210")] + #[serde(default = "default_2213")] pub folded_runs: Integer, - #[serde(default = "default_2211")] + #[serde(default = "default_2214")] pub gate: ProcedureEvolveOutputGate, - #[serde(default = "default_2212")] + #[serde(default = "default_2215")] pub gate_mode: String, - #[serde(default = "default_2213")] + #[serde(default = "default_2216")] pub gate_llr: f64, - #[serde(default = "default_2214")] + #[serde(default = "default_2217")] pub gate_before: std::collections::HashMap, - #[serde(default = "default_2215")] + #[serde(default = "default_2218")] pub gate_after: std::collections::HashMap, - #[serde(default = "default_2216")] + #[serde(default = "default_2219")] pub gate_cost_before: std::collections::HashMap, - #[serde(default = "default_2217")] + #[serde(default = "default_2220")] pub gate_cost_after: std::collections::HashMap, - #[serde(default = "default_2218")] + #[serde(default = "default_2221")] pub gate_reason: String, - #[serde(default = "default_2219")] + #[serde(default = "default_2222")] pub dead_end_steps: Vec, - #[serde(default = "default_2220")] + #[serde(default = "default_2223")] pub fail_prone_steps: Vec, - #[serde(default = "default_2221")] + #[serde(default = "default_2224")] pub fail_prone_transitions: Vec, - #[serde(default = "default_2222")] + #[serde(default = "default_2225")] pub run_stats: std::collections::HashMap, - #[serde(default = "default_2223")] + #[serde(default = "default_2226")] pub strikes: Integer, - #[serde(default = "default_2224")] + #[serde(default = "default_2227")] pub quarantined: bool, - #[serde(default = "default_2225")] + #[serde(default = "default_2228")] pub retention: std::collections::HashMap, } @@ -50676,9 +50682,9 @@ pub struct ProcedureForkOutput { pub memory_key: String, pub version: Integer, pub name: String, - #[serde(default = "default_2226")] + #[serde(default = "default_2229")] pub steps: Vec, - #[serde(default = "default_2227")] + #[serde(default = "default_2230")] pub forked_from: std::collections::HashMap, } @@ -50938,32 +50944,32 @@ pub enum ProcedureLocateOutputStatus { #[non_exhaustive] pub struct ProcedureLocateOutput { pub memory_key: String, - #[serde(default = "default_2228")] + #[serde(default = "default_2231")] pub name: String, - #[serde(default = "default_2229")] + #[serde(default = "default_2232")] pub status: ProcedureLocateOutputStatus, pub matched: bool, - #[serde(default = "default_2230")] + #[serde(default = "default_2233")] pub active: Option>, - #[serde(default = "default_2231")] + #[serde(default = "default_2234")] pub hops: Vec>>, - #[serde(default = "default_2232")] + #[serde(default = "default_2235")] pub entry_nodes: Vec, - #[serde(default = "default_2233")] + #[serde(default = "default_2236")] pub dominant_next: Vec, - #[serde(default = "default_2234")] + #[serde(default = "default_2237")] pub revisits: std::collections::HashMap, - #[serde(default = "default_2235")] + #[serde(default = "default_2238")] pub looping: bool, - #[serde(default = "default_2236")] + #[serde(default = "default_2239")] pub exits: Vec, - #[serde(default = "default_2237")] + #[serde(default = "default_2240")] pub failure_notes: Vec>, - #[serde(default = "default_2238")] + #[serde(default = "default_2241")] pub rendered: String, - #[serde(default = "default_2239")] + #[serde(default = "default_2242")] pub run_stats: std::collections::HashMap, - #[serde(default = "default_2240")] + #[serde(default = "default_2243")] pub for_agent: std::collections::HashMap, } @@ -51118,43 +51124,43 @@ pub struct ProcedureMatch { pub name: String, pub situation: String, pub steps: Vec, - #[serde(default = "default_2241")] + #[serde(default = "default_2244")] pub tags: Vec, - #[serde(default = "default_2242")] + #[serde(default = "default_2245")] pub metadata: std::collections::HashMap, pub similarity: f64, pub memory_key: String, pub namespace: String, - #[serde(default = "default_2243")] + #[serde(default = "default_2246")] pub graph: Option>, - #[serde(default = "default_2244")] + #[serde(default = "default_2247")] pub template: bool, - #[serde(default = "default_2245")] + #[serde(default = "default_2248")] pub run_stats: std::collections::HashMap, - #[serde(default = "default_2246")] + #[serde(default = "default_2249")] pub status: ProcedureMatchStatus, - #[serde(default = "default_2247")] + #[serde(default = "default_2250")] pub quarantined: Option>, - #[serde(default = "default_2248")] + #[serde(default = "default_2251")] pub fail_prone_steps: Vec, - #[serde(default = "default_2249")] + #[serde(default = "default_2252")] pub revision: Integer, - #[serde(default = "default_2250")] + #[serde(default = "default_2253")] pub rejected_revisions: Vec>, - #[serde(default = "default_2251")] + #[serde(default = "default_2254")] pub tool_overlap: f64, - #[serde(default = "default_2252")] + #[serde(default = "default_2255")] pub score: f64, - #[serde(default = "default_2253")] + #[serde(default = "default_2256")] pub utility: f64, - #[serde(default = "default_2254")] + #[serde(default = "default_2257")] pub goal_similarity: Option, - #[serde(default = "default_2255")] + #[serde(default = "default_2258")] pub for_agent: std::collections::HashMap, - #[serde(default = "default_2256")] + #[serde(default = "default_2259")] pub run_stats_by_agent: std::collections::HashMap>, - #[serde(default = "default_2257")] + #[serde(default = "default_2260")] pub actor: String, } @@ -51162,11 +51168,11 @@ pub struct ProcedureMatch { #[non_exhaustive] pub struct ProcedureMatchOutput { pub matches: Vec, - #[serde(default = "default_2258")] + #[serde(default = "default_2261")] pub matched: Integer, - #[serde(default = "default_2259")] + #[serde(default = "default_2262")] pub procedure_key: String, - #[serde(default = "default_2260")] + #[serde(default = "default_2263")] pub score: f64, } @@ -51547,7 +51553,7 @@ pub struct ProcedureReviseOutput { pub revision: Integer, pub prior_revision: Integer, pub digest: String, - #[serde(default = "default_2261")] + #[serde(default = "default_2264")] pub steps: Vec, } @@ -51659,14 +51665,14 @@ pub struct ProfileActivityEntry { pub agent: String, pub last_activated_at: String, pub event_count: Integer, - #[serde(default = "default_2262")] + #[serde(default = "default_2265")] pub operations: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct ProfileActivityOutput { - #[serde(default = "default_2263")] + #[serde(default = "default_2266")] pub entries: Vec, } @@ -51774,17 +51780,17 @@ impl ProfileActivityInput { #[non_exhaustive] pub struct ProfileMutationOutput { pub version: Integer, - #[serde(default = "default_2264")] + #[serde(default = "default_2267")] pub memory_id: String, - #[serde(default = "default_2265")] + #[serde(default = "default_2268")] pub content_sha256: String, - #[serde(default = "default_2266")] + #[serde(default = "default_2269")] pub namespace: String, - #[serde(default = "default_2267")] + #[serde(default = "default_2270")] pub label: String, - #[serde(default = "default_2268")] + #[serde(default = "default_2271")] pub char_limit: Option, - #[serde(default = "default_2269")] + #[serde(default = "default_2272")] pub value_length: Integer, } @@ -51893,7 +51899,7 @@ pub struct ProfileRenderOutput { pub rendered: String, pub section_count: Integer, pub total_chars: Integer, - #[serde(default = "default_2270")] + #[serde(default = "default_2273")] pub labels: Vec, } @@ -52278,17 +52284,17 @@ pub enum ProfileStructuredOutputStatus { #[non_exhaustive] pub struct ProfileStructuredOutput { pub status: ProfileStructuredOutputStatus, - #[serde(default = "default_2271")] + #[serde(default = "default_2274")] pub profile: std::collections::HashMap, - #[serde(default = "default_2272")] + #[serde(default = "default_2275")] pub built_at: Option, - #[serde(default = "default_2273")] + #[serde(default = "default_2276")] pub memory_id: String, - #[serde(default = "default_2274")] + #[serde(default = "default_2277")] pub version: Integer, - #[serde(default = "default_2275")] + #[serde(default = "default_2278")] pub version_text: String, - #[serde(default = "default_2276")] + #[serde(default = "default_2279")] pub schema_sha256: String, } @@ -52405,13 +52411,13 @@ impl ProfileStructuredInput { #[non_exhaustive] pub struct ProfileSchemaOutput { pub found: bool, - #[serde(default = "default_2277")] + #[serde(default = "default_2280")] pub json_schema: std::collections::HashMap, - #[serde(default = "default_2278")] + #[serde(default = "default_2281")] pub schema_sha256: String, - #[serde(default = "default_2279")] + #[serde(default = "default_2282")] pub updated_by: String, - #[serde(default = "default_2280")] + #[serde(default = "default_2283")] pub updated_at: Option, } @@ -52564,10 +52570,10 @@ pub enum RunBeginOutputStatus { #[non_exhaustive] pub struct RunBeginOutput { pub run_id: String, - #[serde(default = "default_2281")] + #[serde(default = "default_2284")] pub status: RunBeginOutputStatus, pub started_at: String, - #[serde(default = "default_2282")] + #[serde(default = "default_2285")] pub next: String, } @@ -52775,29 +52781,29 @@ pub struct RunCompleteOutput { pub run_id: String, pub status: RunCompleteOutputStatus, pub duration_ms: Integer, - #[serde(default = "default_2283")] + #[serde(default = "default_2286")] pub used_applied: Integer, - #[serde(default = "default_2284")] + #[serde(default = "default_2287")] pub evidence_applied: Integer, - #[serde(default = "default_2285")] + #[serde(default = "default_2288")] pub harm_applied: Integer, - #[serde(default = "default_2286")] + #[serde(default = "default_2289")] pub memories_written: Vec, - #[serde(default = "default_2287")] + #[serde(default = "default_2290")] pub recalled: Integer, - #[serde(default = "default_2288")] + #[serde(default = "default_2291")] pub observations: Integer, - #[serde(default = "default_2289")] + #[serde(default = "default_2292")] pub procedure_runs_recorded: Integer, - #[serde(default = "default_2290")] + #[serde(default = "default_2293")] pub reflection_key: String, - #[serde(default = "default_2291")] + #[serde(default = "default_2294")] pub retain: String, - #[serde(default = "default_2292")] + #[serde(default = "default_2295")] pub retained: Integer, - #[serde(default = "default_2293")] + #[serde(default = "default_2296")] pub demoted: Integer, - #[serde(default = "default_2294")] + #[serde(default = "default_2297")] pub expiring: Integer, } @@ -53318,25 +53324,25 @@ pub enum RunGetOutputOverBudgetItem { #[non_exhaustive] pub struct RunGetOutput { pub found: bool, - #[serde(default = "default_2295")] + #[serde(default = "default_2298")] pub run: Option, - #[serde(default = "default_2296")] + #[serde(default = "default_2299")] pub recalled: Integer, - #[serde(default = "default_2297")] + #[serde(default = "default_2300")] pub recalled_keys: Vec, - #[serde(default = "default_2298")] + #[serde(default = "default_2301")] pub memories_written: Vec, - #[serde(default = "default_2299")] + #[serde(default = "default_2302")] pub observations: Integer, - #[serde(default = "default_2300")] + #[serde(default = "default_2303")] pub turns: Integer, - #[serde(default = "default_2301")] + #[serde(default = "default_2304")] pub unpriced_turns: Integer, - #[serde(default = "default_2302")] + #[serde(default = "default_2305")] pub cost_usd: f64, - #[serde(default = "default_2303")] + #[serde(default = "default_2306")] pub elapsed_seconds: Integer, - #[serde(default = "default_2304")] + #[serde(default = "default_2307")] pub over_budget: Vec, } @@ -53403,17 +53409,17 @@ pub struct RunGradeProposal { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct RunGradeOutput { - #[serde(default = "default_2305")] + #[serde(default = "default_2308")] pub graded: Integer, - #[serde(default = "default_2306")] + #[serde(default = "default_2309")] pub run_ids: Vec, - #[serde(default = "default_2307")] + #[serde(default = "default_2310")] pub skipped_active: Integer, - #[serde(default = "default_2308")] + #[serde(default = "default_2311")] pub unchanged: Integer, - #[serde(default = "default_2309")] + #[serde(default = "default_2312")] pub memories_counted: Integer, - #[serde(default = "default_2310")] + #[serde(default = "default_2313")] pub proposals_decided: Vec, } @@ -53528,7 +53534,7 @@ impl RunGradeInput { #[non_exhaustive] pub struct RunListOutput { pub runs: Vec, - #[serde(default = "default_2311")] + #[serde(default = "default_2314")] pub total: Option, } @@ -53805,39 +53811,39 @@ pub struct LiveSearchHit { pub title: String, pub url: String, pub provider: LiveSearchHitProvider, - #[serde(default = "default_2314")] + #[serde(default = "default_2317")] pub content: String, - #[serde(default = "default_2315")] + #[serde(default = "default_2318")] pub live: LiveSearchHitLive, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct LiveSearchResults { - #[serde(default = "default_2313")] - pub live: LiveSearchResultsLive, #[serde(default = "default_2316")] + pub live: LiveSearchResultsLive, + #[serde(default = "default_2319")] pub results: Vec, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SearchOutput { - #[serde(default = "default_2312")] + #[serde(default = "default_2315")] pub tracker: Option>, - #[serde(default = "default_2317")] + #[serde(default = "default_2320")] pub live: Option, - #[serde(default = "default_2318")] + #[serde(default = "default_2321")] pub memory: std::collections::HashMap, - #[serde(default = "default_2319")] + #[serde(default = "default_2322")] pub knowledge: std::collections::HashMap, - #[serde(default = "default_2320")] + #[serde(default = "default_2323")] pub profile: std::collections::HashMap, - #[serde(default = "default_2321")] + #[serde(default = "default_2324")] pub conversations: std::collections::HashMap, - #[serde(default = "default_2322")] + #[serde(default = "default_2325")] pub withheld: Option>, - #[serde(default = "default_2323")] + #[serde(default = "default_2326")] pub namespaces_skipped: Vec, } @@ -54030,7 +54036,7 @@ impl SearchInput { pub struct SessionBriefDeleteOutput { pub deleted: bool, pub brief_key: String, - #[serde(default = "default_2324")] + #[serde(default = "default_2327")] pub revision: Integer, } @@ -54123,67 +54129,67 @@ impl SessionBriefDeleteInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDecision { - #[serde(default = "default_2333")] + #[serde(default = "default_2336")] pub what: String, - #[serde(default = "default_2334")] + #[serde(default = "default_2337")] pub why: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDeadEnd { - #[serde(default = "default_2336")] + #[serde(default = "default_2339")] pub tried: String, - #[serde(default = "default_2337")] + #[serde(default = "default_2340")] pub why_not: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefDone { - #[serde(default = "default_2339")] + #[serde(default = "default_2342")] pub what: String, - #[serde(rename = "ref", default = "default_2340")] + #[serde(rename = "ref", default = "default_2343")] pub r#ref: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefFile { - #[serde(default = "default_2344")] + #[serde(default = "default_2347")] pub path: String, - #[serde(default = "default_2345")] + #[serde(default = "default_2348")] pub role: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct BriefSections { - #[serde(default = "default_2330")] + #[serde(default = "default_2333")] pub goal: String, - #[serde(default = "default_2331")] + #[serde(default = "default_2334")] pub status: String, - #[serde(default = "default_2332")] - pub verification: String, #[serde(default = "default_2335")] - pub decisions: Vec, + pub verification: String, #[serde(default = "default_2338")] - pub dead_ends: Vec, + pub decisions: Vec, #[serde(default = "default_2341")] + pub dead_ends: Vec, + #[serde(default = "default_2344")] pub done: Vec, - #[serde(default = "default_2342")] + #[serde(default = "default_2345")] pub open_questions: Vec, - #[serde(default = "default_2343")] - pub next_steps: Vec, #[serde(default = "default_2346")] + pub next_steps: Vec, + #[serde(default = "default_2349")] pub files: Vec, - #[serde(default = "default_2347")] + #[serde(default = "default_2350")] pub constraints: Vec, - #[serde(default = "default_2348")] + #[serde(default = "default_2351")] pub pointers: Vec, - #[serde(default = "default_2349")] + #[serde(default = "default_2352")] pub client_summary: String, - #[serde(default = "default_2350")] + #[serde(default = "default_2353")] pub client_summary_at: String, } @@ -54191,45 +54197,45 @@ pub struct BriefSections { #[non_exhaustive] pub struct SessionBriefGetOutput { pub found: bool, - #[serde(default = "default_2325")] + #[serde(default = "default_2328")] pub brief_key: String, - #[serde(default = "default_2326")] + #[serde(default = "default_2329")] pub revision: Integer, - #[serde(default = "default_2327")] + #[serde(default = "default_2330")] pub snapshot_id: String, - #[serde(default = "default_2328")] + #[serde(default = "default_2331")] pub snapshot_key: String, - #[serde(default = "default_2329")] + #[serde(default = "default_2332")] pub rendered: String, - #[serde(default = "default_2351")] + #[serde(default = "default_2354")] pub sections: Option, - #[serde(default = "default_2352")] + #[serde(default = "default_2355")] pub project: String, - #[serde(default = "default_2353")] + #[serde(default = "default_2356")] pub branch: String, - #[serde(default = "default_2354")] + #[serde(default = "default_2357")] pub head_sha: String, - #[serde(default = "default_2355")] + #[serde(default = "default_2358")] pub author: String, - #[serde(default = "default_2356")] + #[serde(default = "default_2359")] pub trigger: String, - #[serde(default = "default_2357")] + #[serde(default = "default_2360")] pub actor: String, - #[serde(default = "default_2358")] + #[serde(default = "default_2361")] pub source_sessions: Vec, - #[serde(default = "default_2359")] + #[serde(default = "default_2362")] pub updated_at: Option, - #[serde(default = "default_2360")] + #[serde(default = "default_2363")] pub age_seconds: Integer, - #[serde(default = "default_2361")] + #[serde(default = "default_2364")] pub revisions: Integer, - #[serde(default = "default_2362")] + #[serde(default = "default_2365")] pub events_total: Integer, - #[serde(default = "default_2363")] + #[serde(default = "default_2366")] pub source_chars: Integer, - #[serde(default = "default_2364")] + #[serde(default = "default_2367")] pub brief_chars: Integer, - #[serde(default = "default_2365")] + #[serde(default = "default_2368")] pub deleted: bool, } @@ -54404,34 +54410,34 @@ impl SessionBriefGetInput { pub struct SessionBriefSummary { pub brief_key: String, pub revision: Integer, - #[serde(default = "default_2366")] + #[serde(default = "default_2369")] pub project: String, - #[serde(default = "default_2367")] + #[serde(default = "default_2370")] pub branch: String, - #[serde(default = "default_2368")] + #[serde(default = "default_2371")] pub agent: String, - #[serde(default = "default_2369")] + #[serde(default = "default_2372")] pub goal: String, - #[serde(default = "default_2370")] + #[serde(default = "default_2373")] pub status: String, - #[serde(default = "default_2371")] + #[serde(default = "default_2374")] pub author: String, - #[serde(default = "default_2372")] + #[serde(default = "default_2375")] pub actor: String, - #[serde(default = "default_2373")] + #[serde(default = "default_2376")] pub updated_at: Option, - #[serde(default = "default_2374")] + #[serde(default = "default_2377")] pub age_seconds: Integer, - #[serde(default = "default_2375")] + #[serde(default = "default_2378")] pub brief_chars: Integer, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SessionBriefListOutput { - #[serde(default = "default_2376")] + #[serde(default = "default_2379")] pub briefs: Vec, - #[serde(default = "default_2377")] + #[serde(default = "default_2380")] pub rendered: String, } @@ -54571,25 +54577,25 @@ impl SessionBriefListInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct SessionBriefStats { - #[serde(default = "default_2381")] + #[serde(default = "default_2384")] pub events_in: Integer, - #[serde(default = "default_2382")] + #[serde(default = "default_2385")] pub windows: Integer, - #[serde(default = "default_2383")] + #[serde(default = "default_2386")] pub events_total: Integer, - #[serde(default = "default_2384")] + #[serde(default = "default_2387")] pub source_chars: Integer, - #[serde(default = "default_2385")] + #[serde(default = "default_2388")] pub brief_chars: Integer, - #[serde(default = "default_2386")] + #[serde(default = "default_2389")] pub compression_ratio: f64, - #[serde(default = "default_2387")] + #[serde(default = "default_2390")] pub dropped_ungrounded: Integer, - #[serde(default = "default_2388")] + #[serde(default = "default_2391")] pub tokens_in: Integer, - #[serde(default = "default_2389")] + #[serde(default = "default_2392")] pub tokens_out: Integer, - #[serde(default = "default_2390")] + #[serde(default = "default_2393")] pub llm_model: String, } @@ -54599,13 +54605,13 @@ pub struct SessionBriefSaveOutput { pub brief_key: String, pub revision: Integer, pub changed: bool, - #[serde(default = "default_2378")] + #[serde(default = "default_2381")] pub author: String, - #[serde(default = "default_2379")] + #[serde(default = "default_2382")] pub reason: String, - #[serde(default = "default_2380")] + #[serde(default = "default_2383")] pub rendered: String, - #[serde(default = "default_2391")] + #[serde(default = "default_2394")] pub stats: SessionBriefStats, } @@ -55350,39 +55356,39 @@ pub struct TaskPayload { pub priority: Integer, pub disclosure: TaskPayloadDisclosure, pub status: TaskPayloadStatus, - #[serde(default = "default_2392")] + #[serde(default = "default_2395")] pub reason: String, - #[serde(default = "default_2393")] + #[serde(default = "default_2396")] pub blocked_on: String, - #[serde(default = "default_2394")] + #[serde(default = "default_2397")] pub not_before: Option, - #[serde(default = "default_2395")] + #[serde(default = "default_2398")] pub resume_at: Option, - #[serde(default = "default_2396")] + #[serde(default = "default_2399")] pub deadline: Option, - #[serde(default = "default_2397")] + #[serde(default = "default_2400")] pub defer_count: Integer, pub title: String, - #[serde(default = "default_2398")] + #[serde(default = "default_2401")] pub brief: std::collections::HashMap, pub from_agent: String, - #[serde(default = "default_2399")] + #[serde(default = "default_2402")] pub from_subject: String, - #[serde(default = "default_2400")] + #[serde(default = "default_2403")] pub origin: String, - #[serde(default = "default_2401")] + #[serde(default = "default_2404")] pub parent_task_id: Option, - #[serde(default = "default_2402")] + #[serde(default = "default_2405")] pub owner: String, - #[serde(default = "default_2403")] + #[serde(default = "default_2406")] pub attempt: Integer, - #[serde(default = "default_2404")] + #[serde(default = "default_2407")] pub fence: Integer, - #[serde(default = "default_2405")] + #[serde(default = "default_2408")] pub lease_until: Option, - #[serde(default = "default_2406")] + #[serde(default = "default_2409")] pub outcome: std::collections::HashMap, - #[serde(default = "default_2407")] + #[serde(default = "default_2410")] pub last_actor: String, pub created_at: String, pub updated_at: String, @@ -55393,7 +55399,7 @@ pub struct TaskPayload { #[non_exhaustive] pub struct TaskOutput { pub task: TaskPayload, - #[serde(default = "default_2408")] + #[serde(default = "default_2411")] pub seq: Integer, } @@ -55794,10 +55800,10 @@ impl TaskCompleteInput { pub struct InboxCount { pub inbox: String, pub status: String, - #[serde(default = "default_2409")] + #[serde(default = "default_2412")] pub blocked_on: String, pub n: Integer, - #[serde(default = "default_2410")] + #[serde(default = "default_2413")] pub oldest: Option, } @@ -55884,7 +55890,7 @@ pub struct TaskCreateOutput { pub task: TaskPayload, pub created: bool, pub seq: Integer, - #[serde(default = "default_2411")] + #[serde(default = "default_2414")] pub next: String, } @@ -56223,7 +56229,7 @@ impl TaskFailInput { #[non_exhaustive] pub struct TaskGetOutput { pub found: bool, - #[serde(default = "default_2412")] + #[serde(default = "default_2415")] pub task: Option, } @@ -56357,23 +56363,23 @@ pub struct TaskEventPayload { pub task_id: String, pub inbox: String, pub event: String, - #[serde(default = "default_2413")] + #[serde(default = "default_2416")] pub from_status: String, - #[serde(default = "default_2414")] + #[serde(default = "default_2417")] pub to_status: String, - #[serde(default = "default_2415")] + #[serde(default = "default_2418")] pub actor: String, - #[serde(default = "default_2416")] + #[serde(default = "default_2419")] pub agent: String, - #[serde(default = "default_2417")] + #[serde(default = "default_2420")] pub fence: Integer, - #[serde(default = "default_2418")] + #[serde(default = "default_2421")] pub version: Integer, - #[serde(default = "default_2419")] + #[serde(default = "default_2422")] pub reason: String, - #[serde(default = "default_2420")] + #[serde(default = "default_2423")] pub patch: std::collections::HashMap, - #[serde(default = "default_2421")] + #[serde(default = "default_2424")] pub note: String, pub ts: String, } @@ -56713,7 +56719,7 @@ pub struct TaskPullOutput { pub tasks: Vec, pub waited_ms: Integer, pub backend: String, - #[serde(default = "default_2422")] + #[serde(default = "default_2425")] pub note: String, } @@ -57109,7 +57115,7 @@ impl TaskUnblockInput { pub struct TaskUpdateOutput { pub task: TaskPayload, pub seq: Integer, - #[serde(default = "default_2423")] + #[serde(default = "default_2426")] pub conflict: bool, } @@ -57472,19 +57478,19 @@ impl TaskReasonInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerAnswerOutput { - #[serde(default = "default_2424")] + #[serde(default = "default_2427")] pub intent: String, - #[serde(default = "default_2425")] + #[serde(default = "default_2428")] pub anchors: std::collections::HashMap, - #[serde(default = "default_2426")] + #[serde(default = "default_2429")] pub sections: Vec>, - #[serde(default = "default_2427")] + #[serde(default = "default_2430")] pub searched: Vec, - #[serde(default = "default_2428")] + #[serde(default = "default_2431")] pub lines: Vec, - #[serde(default = "default_2429")] + #[serde(default = "default_2432")] pub restricted: bool, - #[serde(default = "default_2430")] + #[serde(default = "default_2433")] pub verdict: String, } @@ -57580,17 +57586,17 @@ impl TrackerAnswerInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerBindingOutput { - #[serde(default = "default_2431")] + #[serde(default = "default_2434")] pub tracker_namespace: String, - #[serde(default = "default_2432")] + #[serde(default = "default_2435")] pub tracker_namespaces: Vec, - #[serde(default = "default_2433")] + #[serde(default = "default_2436")] pub restricted: bool, - #[serde(default = "default_2434")] + #[serde(default = "default_2437")] pub kind: String, - #[serde(default = "default_2435")] + #[serde(default = "default_2438")] pub authorized: bool, - #[serde(default = "default_2436")] + #[serde(default = "default_2439")] pub templates: Vec, } @@ -57643,13 +57649,13 @@ impl TrackerBindingInput { #[non_exhaustive] pub struct TrackerComponentOutput { pub component: String, - #[serde(default = "default_2437")] + #[serde(default = "default_2440")] pub risk: std::collections::HashMap, - #[serde(default = "default_2438")] + #[serde(default = "default_2441")] pub open_issues: Vec>, - #[serde(default = "default_2439")] + #[serde(default = "default_2442")] pub known: bool, - #[serde(default = "default_2440")] + #[serde(default = "default_2443")] pub tracker_unavailable: bool, } @@ -57710,9 +57716,9 @@ impl TrackerComponentInput { #[non_exhaustive] pub struct TrackerContractOutput { pub database: String, - #[serde(default = "default_2441")] + #[serde(default = "default_2444")] pub tables: Vec>, - #[serde(default = "default_2442")] + #[serde(default = "default_2445")] pub templates: std::collections::HashMap, } @@ -57765,66 +57771,66 @@ impl TrackerContractInput { #[non_exhaustive] pub struct TrackerLegStatus { pub name: String, - #[serde(default = "default_2453")] + #[serde(default = "default_2456")] pub status: String, - #[serde(default = "default_2454")] + #[serde(default = "default_2457")] pub reason: String, - #[serde(default = "default_2455")] + #[serde(default = "default_2458")] pub message: String, - #[serde(default = "default_2456")] + #[serde(default = "default_2459")] pub retried: bool, - #[serde(default = "default_2457")] + #[serde(default = "default_2460")] pub ms: Integer, - #[serde(default = "default_2458")] + #[serde(default = "default_2461")] pub cause: String, - #[serde(default = "default_2459")] + #[serde(default = "default_2462")] pub namespace: String, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerDuplicateCheckOutput { - #[serde(default = "default_2443")] + #[serde(default = "default_2446")] pub verdict: String, - #[serde(default = "default_2444")] + #[serde(default = "default_2447")] pub items: Vec>, - #[serde(default = "default_2445")] + #[serde(default = "default_2448")] pub undecided: bool, - #[serde(default = "default_2446")] + #[serde(default = "default_2449")] pub epistemic: String, - #[serde(default = "default_2447")] + #[serde(default = "default_2450")] pub thresholds: std::collections::HashMap, - #[serde(default = "default_2448")] + #[serde(default = "default_2451")] pub judge: std::collections::HashMap, - #[serde(default = "default_2449")] + #[serde(default = "default_2452")] pub fit_at: String, - #[serde(default = "default_2450")] + #[serde(default = "default_2453")] pub fit: std::collections::HashMap, - #[serde(default = "default_2451")] + #[serde(default = "default_2454")] pub query: std::collections::HashMap, - #[serde(default = "default_2452")] + #[serde(default = "default_2455")] pub legs: std::collections::HashMap, - #[serde(default = "default_2460")] + #[serde(default = "default_2463")] pub leg_status: Vec, - #[serde(default = "default_2461")] + #[serde(default = "default_2464")] pub tracker_unavailable: bool, - #[serde(default = "default_2462")] + #[serde(default = "default_2465")] pub namespaces: Vec, - #[serde(default = "default_2463")] + #[serde(default = "default_2466")] pub by_namespace: std::collections::HashMap>, - #[serde(default = "default_2464")] + #[serde(default = "default_2467")] pub closest: Vec>, - #[serde(default = "default_2465")] + #[serde(default = "default_2468")] pub needs: Vec>, - #[serde(default = "default_2466")] + #[serde(default = "default_2469")] pub closest_note: String, - #[serde(default = "default_2467")] + #[serde(default = "default_2470")] pub nearest: Vec>, - #[serde(default = "default_2468")] + #[serde(default = "default_2471")] pub rerank: std::collections::HashMap, - #[serde(default = "default_2469")] + #[serde(default = "default_2472")] pub answer: String, - #[serde(default = "default_2470")] + #[serde(default = "default_2473")] pub related_prs: Vec>, } @@ -58031,17 +58037,17 @@ impl TrackerDuplicateCheckInput { #[non_exhaustive] pub struct TrackerFlakyOutput { pub test_name: String, - #[serde(default = "default_2471")] + #[serde(default = "default_2474")] pub known_flaky: bool, - #[serde(default = "default_2472")] + #[serde(default = "default_2475")] pub open_issues: Integer, - #[serde(default = "default_2473")] + #[serde(default = "default_2476")] pub issues: Vec>, - #[serde(default = "default_2474")] + #[serde(default = "default_2477")] pub verdict: String, - #[serde(default = "default_2475")] + #[serde(default = "default_2478")] pub tracker_unavailable: bool, - #[serde(default = "default_2476")] + #[serde(default = "default_2479")] pub signal: Option>, } @@ -58124,9 +58130,9 @@ impl TrackerFlakyInput { #[non_exhaustive] pub struct TrackerItemOutput { pub items: Vec>, - #[serde(default = "default_2477")] + #[serde(default = "default_2480")] pub unknown: Vec, - #[serde(default = "default_2478")] + #[serde(default = "default_2481")] pub tracker_unavailable: bool, } @@ -58175,19 +58181,19 @@ impl TrackerItemInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerLinksOutput { - #[serde(default = "default_2479")] + #[serde(default = "default_2482")] pub subject: std::collections::HashMap, - #[serde(default = "default_2480")] + #[serde(default = "default_2483")] pub verdict: String, - #[serde(default = "default_2481")] + #[serde(default = "default_2484")] pub items: Vec>, - #[serde(default = "default_2482")] + #[serde(default = "default_2485")] pub epistemic: String, - #[serde(default = "default_2483")] + #[serde(default = "default_2486")] pub record: std::collections::HashMap, - #[serde(default = "default_2484")] + #[serde(default = "default_2487")] pub computed_at: String, - #[serde(default = "default_2485")] + #[serde(default = "default_2488")] pub tracker_unavailable: bool, } @@ -58285,11 +58291,11 @@ impl TrackerLinksInput { pub struct TrackerReleaseOutput { pub version: String, pub blockers: Vec>, - #[serde(default = "default_2486")] + #[serde(default = "default_2489")] pub active_blockers: Integer, - #[serde(default = "default_2487")] + #[serde(default = "default_2490")] pub health: std::collections::HashMap, - #[serde(default = "default_2488")] + #[serde(default = "default_2491")] pub tracker_unavailable: bool, } @@ -58338,17 +58344,17 @@ impl TrackerReleaseInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerSimilarOutput { - #[serde(default = "default_2489")] + #[serde(default = "default_2492")] pub items: Vec>, - #[serde(default = "default_2490")] + #[serde(default = "default_2493")] pub query: std::collections::HashMap, - #[serde(default = "default_2491")] + #[serde(default = "default_2494")] pub legs: std::collections::HashMap, - #[serde(default = "default_2492")] + #[serde(default = "default_2495")] pub epistemic: String, - #[serde(default = "default_2493")] + #[serde(default = "default_2496")] pub tracker_unavailable: bool, - #[serde(default = "default_2494")] + #[serde(default = "default_2497")] pub namespaces: Vec, } @@ -58469,19 +58475,19 @@ pub struct TrackerSourceAddOutput { pub name: String, pub host: String, pub database: String, - #[serde(default = "default_2495")] + #[serde(default = "default_2498")] pub namespaces: Vec>, - #[serde(default = "default_2496")] + #[serde(default = "default_2499")] pub contract: std::collections::HashMap, - #[serde(default = "default_2497")] + #[serde(default = "default_2500")] pub roles: Vec, - #[serde(default = "default_2498")] + #[serde(default = "default_2501")] pub my_role: String, - #[serde(default = "default_2499")] + #[serde(default = "default_2502")] pub dry_run: bool, - #[serde(default = "default_2500")] + #[serde(default = "default_2503")] pub written: bool, - #[serde(default = "default_2501")] + #[serde(default = "default_2504")] pub view_templates: std::collections::HashMap, } @@ -58644,13 +58650,13 @@ impl TrackerSourceAddInput { #[non_exhaustive] pub struct TrackerSourceCheckOutput { pub name: String, - #[serde(default = "default_2502")] + #[serde(default = "default_2505")] pub database: String, - #[serde(default = "default_2503")] + #[serde(default = "default_2506")] pub reachable: bool, - #[serde(default = "default_2504")] + #[serde(default = "default_2507")] pub contract: std::collections::HashMap, - #[serde(default = "default_2505")] + #[serde(default = "default_2508")] pub view_templates: std::collections::HashMap, } @@ -58690,11 +58696,11 @@ impl TrackerSourceCheckInput { pub struct TrackerSourceInspectOutput { pub host: String, pub database: String, - #[serde(default = "default_2506")] + #[serde(default = "default_2509")] pub tables: Vec>, - #[serde(default = "default_2507")] + #[serde(default = "default_2510")] pub roles: Vec, - #[serde(default = "default_2508")] + #[serde(default = "default_2511")] pub proposal: std::collections::HashMap, } @@ -58823,9 +58829,9 @@ impl TrackerSourceInspectInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct TrackerSourceListOutput { - #[serde(default = "default_2509")] + #[serde(default = "default_2512")] pub sources: Vec>, - #[serde(default = "default_2510")] + #[serde(default = "default_2513")] pub self_service: bool, } @@ -58878,9 +58884,9 @@ impl TrackerSourceListInput { #[non_exhaustive] pub struct TrackerSourceRemoveOutput { pub name: String, - #[serde(default = "default_2511")] + #[serde(default = "default_2514")] pub deactivated: bool, - #[serde(default = "default_2512")] + #[serde(default = "default_2515")] pub namespaces_retired: Vec, } @@ -58921,9 +58927,9 @@ impl TrackerSourceRemoveInput { #[non_exhaustive] pub struct TrackerSourceRotateOutput { pub name: String, - #[serde(default = "default_2513")] + #[serde(default = "default_2516")] pub contract: std::collections::HashMap, - #[serde(default = "default_2514")] + #[serde(default = "default_2517")] pub rotated_at: String, } @@ -58970,11 +58976,11 @@ impl TrackerSourceRotateInput { #[non_exhaustive] pub struct TrackerSourceSetMappingOutput { pub name: String, - #[serde(default = "default_2515")] + #[serde(default = "default_2518")] pub contract: std::collections::HashMap, - #[serde(default = "default_2516")] + #[serde(default = "default_2519")] pub dry_run: bool, - #[serde(default = "default_2517")] + #[serde(default = "default_2520")] pub written: bool, } @@ -59041,45 +59047,45 @@ impl TrackerSourceSetMappingInput { #[non_exhaustive] pub struct TrackerTestSignalOutput { pub test_name: String, - #[serde(default = "default_2518")] + #[serde(default = "default_2521")] pub verdict: String, - #[serde(default = "default_2519")] + #[serde(default = "default_2522")] pub why: Vec, - #[serde(default = "default_2520")] + #[serde(default = "default_2523")] pub lower_bound: f64, - #[serde(default = "default_2521")] + #[serde(default = "default_2524")] pub window_days: Integer, - #[serde(default = "default_2522")] + #[serde(default = "default_2525")] pub since: String, - #[serde(default = "default_2523")] + #[serde(default = "default_2526")] pub features: std::collections::HashMap, - #[serde(default = "default_2524")] + #[serde(default = "default_2527")] pub infra: std::collections::HashMap, - #[serde(default = "default_2525")] + #[serde(default = "default_2528")] pub churn: std::collections::HashMap, - #[serde(default = "default_2526")] + #[serde(default = "default_2529")] pub thresholds: std::collections::HashMap, - #[serde(default = "default_2527")] + #[serde(default = "default_2530")] pub source: String, - #[serde(default = "default_2528")] + #[serde(default = "default_2531")] pub timings_ms: std::collections::HashMap, - #[serde(default = "default_2529")] + #[serde(default = "default_2532")] pub tracker_unavailable: bool, - #[serde(default = "default_2530")] + #[serde(default = "default_2533")] pub rollup: std::collections::HashMap, - #[serde(default = "default_2531")] + #[serde(default = "default_2534")] pub streak: std::collections::HashMap, - #[serde(default = "default_2532")] + #[serde(default = "default_2535")] pub smells: std::collections::HashMap, - #[serde(default = "default_2533")] + #[serde(default = "default_2536")] pub prior: std::collections::HashMap, - #[serde(default = "default_2534")] + #[serde(default = "default_2537")] pub unavailable_reason: String, - #[serde(default = "default_2535")] + #[serde(default = "default_2538")] pub candidates: Vec>, - #[serde(default = "default_2536")] + #[serde(default = "default_2539")] pub candidate_matches: Integer, - #[serde(default = "default_2537")] + #[serde(default = "default_2540")] pub resolved_from: String, } @@ -59183,9 +59189,9 @@ impl TrackerTestSignalInput { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct UiVitalsOutput { - #[serde(default = "default_2538")] + #[serde(default = "default_2541")] pub recorded: bool, - #[serde(default = "default_2539")] + #[serde(default = "default_2542")] pub route: String, } @@ -59369,7 +59375,7 @@ pub struct WebhookDelivery { #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct WebhookDeliveriesOutput { - #[serde(default = "default_2540")] + #[serde(default = "default_2543")] pub deliveries: Vec, } @@ -59491,14 +59497,14 @@ pub struct WebhookInfo { pub secret_ref: String, pub events: Vec, pub created_at: String, - #[serde(default = "default_2541")] + #[serde(default = "default_2544")] pub secret_present: bool, } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct WebhookListOutput { - #[serde(default = "default_2542")] + #[serde(default = "default_2545")] pub webhooks: Vec, } @@ -59680,7 +59686,7 @@ pub struct WorkingMemoryMutationOutput { pub version: Integer, pub char_limit: Integer, pub value_length: Integer, - #[serde(default = "default_2543")] + #[serde(default = "default_2546")] pub fill_ratio: f64, } @@ -59904,15 +59910,15 @@ impl WorkingMemoryDeleteInput { pub struct WorkingMemoryGetOutput { pub found: bool, pub block_key: String, - #[serde(default = "default_2544")] + #[serde(default = "default_2547")] pub content: String, - #[serde(default = "default_2545")] + #[serde(default = "default_2548")] pub char_limit: Integer, - #[serde(default = "default_2546")] + #[serde(default = "default_2549")] pub version: Integer, - #[serde(default = "default_2547")] + #[serde(default = "default_2550")] pub updated_at: Option, - #[serde(default = "default_2548")] + #[serde(default = "default_2551")] pub fill_ratio: f64, } @@ -60023,7 +60029,7 @@ pub struct WorkingMemoryBlock { pub content: String, pub char_limit: Integer, pub version: Integer, - #[serde(default = "default_2549")] + #[serde(default = "default_2552")] pub updated_at: Option, } @@ -60031,7 +60037,7 @@ pub struct WorkingMemoryBlock { #[non_exhaustive] pub struct WorkingMemoryRenderOutput { pub rendered: String, - #[serde(default = "default_2550")] + #[serde(default = "default_2553")] pub blocks: Vec, pub block_count: Integer, pub total_chars: Integer, @@ -62818,315 +62824,315 @@ fn default_804() -> Vec> { fn default_805() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_806() -> Vec { +fn default_806() -> Vec> { + serde_json::from_str("[]").expect("schema default") +} +fn default_807() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_807() -> Vec> { +fn default_808() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_808() -> bool { +fn default_809() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_809() -> Integer { +fn default_810() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_810() -> Integer { +fn default_811() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_811() -> bool { +fn default_812() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_813() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_812() -> bool { +fn default_814() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_813() -> bool { +fn default_815() -> bool { + serde_json::from_str("false").expect("schema default") +} +fn default_816() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_814() -> String { +fn default_817() -> String { serde_json::from_str("\"lower_bound\"").expect("schema default") } -fn default_815() -> Vec { +fn default_818() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_816() -> std::collections::HashMap { +fn default_819() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_817() -> String { +fn default_820() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_818() -> String { +fn default_821() -> String { serde_json::from_str("\"unknown\"").expect("schema default") } -fn default_819() -> String { +fn default_822() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_820() -> Vec> { +fn default_823() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_821() -> Vec { +fn default_824() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_822() -> Vec { +fn default_825() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_823() -> Integer { +fn default_826() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_824() -> std::collections::HashMap { +fn default_827() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_825() -> String { +fn default_828() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_826() -> Vec> { +fn default_829() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_827() -> Integer { +fn default_830() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_828() -> bool { +fn default_831() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_829() -> Vec> { +fn default_832() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_830() -> String { +fn default_833() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_831() -> bool { +fn default_834() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_832() -> Vec { +fn default_835() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_833() -> std::collections::HashMap { +fn default_836() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_834() -> Integer { +fn default_837() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_835() -> Integer { +fn default_838() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_836() -> String { +fn default_839() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_837() -> Integer { +fn default_840() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_838() -> String { +fn default_841() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_839() -> String { +fn default_842() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_840() -> Vec> { +fn default_843() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_841() -> std::collections::HashMap { +fn default_844() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_842() -> String { +fn default_845() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_843() -> String { +fn default_846() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_844() -> std::collections::HashMap { +fn default_847() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_845() -> Vec> { +fn default_848() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_846() -> Vec> { +fn default_849() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_847() -> bool { +fn default_850() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_848() -> std::collections::HashMap { +fn default_851() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_849() -> std::collections::HashMap { +fn default_852() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_850() -> std::collections::HashMap { +fn default_853() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_851() -> Vec { +fn default_854() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_852() -> Integer { +fn default_855() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_853() -> std::collections::HashMap { +fn default_856() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_854() -> String { +fn default_857() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_855() -> String { +fn default_858() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_856() -> String { +fn default_859() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_857() -> String { +fn default_860() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_858() -> String { +fn default_861() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_859() -> String { +fn default_862() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_860() -> String { +fn default_863() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_861() -> Option { +fn default_864() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_862() -> Option { +fn default_865() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_863() -> Option { +fn default_866() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_864() -> Option { +fn default_867() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_865() -> Option> { +fn default_868() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_866() -> Vec { +fn default_869() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_867() -> String { +fn default_870() -> String { serde_json::from_str("\"conflicts.resolve\"").expect("schema default") } -fn default_868() -> Vec { +fn default_871() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_869() -> String { +fn default_872() -> String { serde_json::from_str("\"No changes were applied.\"").expect("schema default") } -fn default_870() -> Option { +fn default_873() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_871() -> Option { +fn default_874() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_872() -> Option { +fn default_875() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_873() -> Vec { +fn default_876() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_874() -> String { +fn default_877() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_875() -> String { +fn default_878() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_876() -> String { +fn default_879() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_877() -> Integer { +fn default_880() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_878() -> Integer { +fn default_881() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_879() -> Integer { +fn default_882() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_880() -> Integer { +fn default_883() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_881() -> Integer { +fn default_884() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_882() -> Option { +fn default_885() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_883() -> bool { +fn default_886() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_884() -> ConversationAppendOutputReason { +fn default_887() -> ConversationAppendOutputReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_885() -> String { +fn default_888() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_886() -> Integer { +fn default_889() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_887() -> Integer { +fn default_890() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_888() -> String { +fn default_891() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_889() -> String { +fn default_892() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_890() -> std::collections::HashMap { +fn default_893() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_891() -> String { +fn default_894() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_892() -> String { +fn default_895() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_893() -> String { +fn default_896() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_894() -> Option { +fn default_897() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_895() -> Option { +fn default_898() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_896() -> Integer { +fn default_899() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_897() -> String { +fn default_900() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_898() -> Vec { +fn default_901() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_899() -> Option { +fn default_902() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_900() -> Option { +fn default_903() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_901() -> Option { +fn default_904() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_902() -> ConversationSaveMessageOutputReason { +fn default_905() -> ConversationSaveMessageOutputReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_903() -> String { +fn default_906() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_904() -> Vec { +fn default_907() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_905() -> bool { +fn default_908() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_906() -> Option { - serde_json::from_str("null").expect("schema default") -} -fn default_907() -> Option { - serde_json::from_str("null").expect("schema default") -} -fn default_908() -> Option { - serde_json::from_str("null").expect("schema default") -} fn default_909() -> Option { serde_json::from_str("null").expect("schema default") } @@ -63142,32 +63148,32 @@ fn default_912() -> Option { fn default_913() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_914() -> Option { +fn default_914() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_915() -> Option { +fn default_915() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_916() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_916() -> Option { + serde_json::from_str("null").expect("schema default") } -fn default_917() -> Vec { - serde_json::from_str("[]").expect("schema default") +fn default_917() -> Option { + serde_json::from_str("null").expect("schema default") } -fn default_918() -> f64 { - serde_json::from_str("0.0").expect("schema default") +fn default_918() -> Option { + serde_json::from_str("null").expect("schema default") } fn default_919() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_920() -> Option { - serde_json::from_str("null").expect("schema default") +fn default_920() -> Vec { + serde_json::from_str("[]").expect("schema default") } -fn default_921() -> Option { - serde_json::from_str("null").expect("schema default") +fn default_921() -> f64 { + serde_json::from_str("0.0").expect("schema default") } -fn default_922() -> Option { - serde_json::from_str("null").expect("schema default") +fn default_922() -> Integer { + serde_json::from_str("0").expect("schema default") } fn default_923() -> Option { serde_json::from_str("null").expect("schema default") @@ -63190,648 +63196,648 @@ fn default_928() -> Option { fn default_929() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_930() -> Integer { +fn default_930() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_931() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_932() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_933() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_931() -> f64 { +fn default_934() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_932() -> Integer { +fn default_935() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_933() -> f64 { +fn default_936() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_934() -> String { +fn default_937() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_935() -> String { +fn default_938() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_936() -> String { +fn default_939() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_937() -> String { +fn default_940() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_938() -> Vec { +fn default_941() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_939() -> Option { +fn default_942() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_940() -> String { +fn default_943() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_941() -> String { +fn default_944() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_942() -> String { +fn default_945() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_943() -> Option { +fn default_946() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_944() -> String { +fn default_947() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_945() -> DecisionRowStage { +fn default_948() -> DecisionRowStage { serde_json::from_str("\"decided\"").expect("schema default") } -fn default_946() -> f64 { +fn default_949() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_947() -> Option { +fn default_950() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_948() -> Option { +fn default_951() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_949() -> Integer { +fn default_952() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_950() -> String { +fn default_953() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_951() -> bool { +fn default_954() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_952() -> Integer { +fn default_955() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_953() -> String { +fn default_956() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_954() -> bool { +fn default_957() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_955() -> Option { +fn default_958() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_956() -> String { +fn default_959() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_957() -> Integer { +fn default_960() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_958() -> Integer { +fn default_961() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_959() -> Integer { +fn default_962() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_960() -> Option { +fn default_963() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_961() -> String { +fn default_964() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_962() -> Option { +fn default_965() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_963() -> Integer { +fn default_966() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_964() -> std::collections::HashMap { +fn default_967() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_965() -> Option { +fn default_968() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_966() -> Option> { +fn default_969() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_967() -> bool { +fn default_970() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_968() -> String { +fn default_971() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_969() -> Vec { +fn default_972() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_970() -> Option { +fn default_973() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_971() -> Option { +fn default_974() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_972() -> Option { +fn default_975() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_973() -> Option { +fn default_976() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_974() -> Option { +fn default_977() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_975() -> Option { +fn default_978() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_976() -> Option { +fn default_979() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_977() -> Option { +fn default_980() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_978() -> Option { +fn default_981() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_979() -> Integer { +fn default_982() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_980() -> std::collections::HashMap { +fn default_983() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_981() -> Option { +fn default_984() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_982() -> Option> { +fn default_985() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_983() -> bool { +fn default_986() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_984() -> String { +fn default_987() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_985() -> String { +fn default_988() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_986() -> String { +fn default_989() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_987() -> Option { +fn default_990() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_988() -> String { +fn default_991() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_989() -> String { +fn default_992() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_990() -> Option { +fn default_993() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_991() -> Vec { +fn default_994() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_992() -> String { +fn default_995() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_993() -> Vec { +fn default_996() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_994() -> Vec { +fn default_997() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_995() -> bool { +fn default_998() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_996() -> bool { +fn default_999() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_997() -> String { +fn default_1000() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_998() -> String { +fn default_1001() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_999() -> Option { +fn default_1002() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1000() -> Option { +fn default_1003() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1001() -> Option { +fn default_1004() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1002() -> bool { +fn default_1005() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1003() -> Integer { +fn default_1006() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1004() -> String { +fn default_1007() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1005() -> String { +fn default_1008() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1006() -> String { +fn default_1009() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1007() -> String { +fn default_1010() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1008() -> String { +fn default_1011() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1009() -> Option { +fn default_1012() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1010() -> Vec { +fn default_1013() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1011() -> bool { +fn default_1014() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1012() -> Vec { +fn default_1015() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1013() -> Option { +fn default_1016() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1014() -> Option { +fn default_1017() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1015() -> bool { +fn default_1018() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1016() -> String { +fn default_1019() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_1017() -> Option { +fn default_1020() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1018() -> Option { +fn default_1021() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1019() -> Option { +fn default_1022() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1020() -> String { +fn default_1023() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1021() -> String { +fn default_1024() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1022() -> String { +fn default_1025() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1023() -> HelpGetOutputAudience { +fn default_1026() -> HelpGetOutputAudience { serde_json::from_str("\"user\"").expect("schema default") } -fn default_1024() -> String { +fn default_1027() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1025() -> bool { +fn default_1028() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1026() -> Integer { +fn default_1029() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1027() -> String { +fn default_1030() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1028() -> Vec { +fn default_1031() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1029() -> String { +fn default_1032() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1030() -> Vec { +fn default_1033() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1031() -> Vec { +fn default_1034() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1032() -> String { +fn default_1035() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1033() -> String { +fn default_1036() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1034() -> String { +fn default_1037() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1035() -> Vec { +fn default_1038() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1036() -> String { +fn default_1039() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1037() -> bool { +fn default_1040() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1038() -> Vec { +fn default_1041() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1039() -> Vec { +fn default_1042() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1040() -> Option { +fn default_1043() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1041() -> bool { +fn default_1044() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1042() -> bool { +fn default_1045() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1043() -> Vec { +fn default_1046() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1044() -> Vec> { +fn default_1047() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1045() -> Integer { +fn default_1048() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1046() -> bool { +fn default_1049() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1047() -> String { +fn default_1050() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1048() -> String { +fn default_1051() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1049() -> Integer { +fn default_1052() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1050() -> Integer { +fn default_1053() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1051() -> Vec { +fn default_1054() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1052() -> Integer { +fn default_1055() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1053() -> Vec { +fn default_1056() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1054() -> bool { +fn default_1057() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1055() -> String { +fn default_1058() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1056() -> Option { +fn default_1059() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1057() -> Option { +fn default_1060() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1058() -> Vec> { +fn default_1061() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1059() -> Option { +fn default_1062() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1060() -> bool { +fn default_1063() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1061() -> Integer { +fn default_1064() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1062() -> Vec { +fn default_1065() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1063() -> Vec> { +fn default_1066() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1064() -> Vec { +fn default_1067() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1065() -> Vec> { +fn default_1068() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1066() -> Vec { +fn default_1069() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1067() -> String { +fn default_1070() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1068() -> Vec { +fn default_1071() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1069() -> Vec { +fn default_1072() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1070() -> Option { +fn default_1073() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1071() -> Vec { +fn default_1074() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1072() -> Integer { +fn default_1075() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1073() -> Vec { +fn default_1076() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1074() -> String { +fn default_1077() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1075() -> Vec { +fn default_1078() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1076() -> Vec { +fn default_1079() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1077() -> Option { +fn default_1080() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1078() -> Option { +fn default_1081() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1079() -> bool { +fn default_1082() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1080() -> String { +fn default_1083() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1081() -> String { +fn default_1084() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1082() -> bool { +fn default_1085() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1083() -> String { +fn default_1086() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1084() -> String { +fn default_1087() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1085() -> String { +fn default_1088() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1086() -> Integer { +fn default_1089() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1087() -> String { +fn default_1090() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1088() -> String { +fn default_1091() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1089() -> String { +fn default_1092() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1090() -> Option> { +fn default_1093() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_1091() -> Vec { +fn default_1094() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1092() -> Integer { +fn default_1095() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1093() -> Integer { +fn default_1096() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1094() -> Option { +fn default_1097() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1095() -> String { +fn default_1098() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1096() -> String { +fn default_1099() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1097() -> bool { +fn default_1100() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1098() -> Option { +fn default_1101() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1099() -> Option { +fn default_1102() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1100() -> Option { +fn default_1103() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1101() -> Option { +fn default_1104() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1102() -> Option { +fn default_1105() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1103() -> Vec { +fn default_1106() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1104() -> Vec { +fn default_1107() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1105() -> Option { +fn default_1108() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1106() -> Option { +fn default_1109() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1107() -> Option { +fn default_1110() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1108() -> String { +fn default_1111() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1109() -> Option { +fn default_1112() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1110() -> Option { +fn default_1113() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1111() -> Option { +fn default_1114() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1112() -> Vec { +fn default_1115() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1113() -> Vec { +fn default_1116() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1114() -> Option { +fn default_1117() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1115() -> String { +fn default_1118() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1116() -> Option { +fn default_1119() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1117() -> Vec { +fn default_1120() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1118() -> Option { +fn default_1121() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1119() -> Option { +fn default_1122() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1120() -> Option { +fn default_1123() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1121() -> String { +fn default_1124() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1122() -> Option { +fn default_1125() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1123() -> Option { +fn default_1126() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1124() -> bool { +fn default_1127() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1125() -> bool { +fn default_1128() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1126() -> Option { +fn default_1129() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1127() -> Vec { +fn default_1130() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1128() -> bool { +fn default_1131() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1129() -> Option { +fn default_1132() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1130() -> Option { +fn default_1133() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1131() -> Vec { +fn default_1134() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1132() -> String { +fn default_1135() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1133() -> String { +fn default_1136() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1134() -> Vec { +fn default_1137() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1135() -> Integer { +fn default_1138() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1136() -> Vec { +fn default_1139() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1137() -> Vec { +fn default_1140() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1138() -> Vec { +fn default_1141() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1139() -> Vec { +fn default_1142() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1140() -> Vec { +fn default_1143() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1141() -> Option { - serde_json::from_str("null").expect("schema default") -} -fn default_1142() -> Option { - serde_json::from_str("null").expect("schema default") -} -fn default_1143() -> Option { - serde_json::from_str("null").expect("schema default") -} fn default_1144() -> Option { serde_json::from_str("null").expect("schema default") } @@ -63853,22 +63859,22 @@ fn default_1149() -> Option { fn default_1150() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1151() -> Option { +fn default_1151() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1152() -> Option { +fn default_1152() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1153() -> Vec { - serde_json::from_str("[]").expect("schema default") +fn default_1153() -> Option { + serde_json::from_str("null").expect("schema default") } -fn default_1154() -> Option { +fn default_1154() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1155() -> Option { +fn default_1155() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1156() -> Vec { +fn default_1156() -> Vec { serde_json::from_str("[]").expect("schema default") } fn default_1157() -> Option { @@ -63877,1853 +63883,1853 @@ fn default_1157() -> Option { fn default_1158() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1159() -> Vec { +fn default_1159() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1160() -> String { +fn default_1160() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_1161() -> Option { + serde_json::from_str("null").expect("schema default") +} +fn default_1162() -> Vec { + serde_json::from_str("[]").expect("schema default") +} +fn default_1163() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1161() -> String { +fn default_1164() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1162() -> Vec { +fn default_1165() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1163() -> Vec { +fn default_1166() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1164() -> Integer { +fn default_1167() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1165() -> Vec { +fn default_1168() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1166() -> Vec { +fn default_1169() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1167() -> Vec { +fn default_1170() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1168() -> Vec { +fn default_1171() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1169() -> Option { +fn default_1172() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1170() -> String { +fn default_1173() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1171() -> bool { +fn default_1174() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1172() -> KnowledgeMoveResultReason { +fn default_1175() -> KnowledgeMoveResultReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_1173() -> Vec { +fn default_1176() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1174() -> String { +fn default_1177() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1175() -> bool { +fn default_1178() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1176() -> Integer { +fn default_1179() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1177() -> Vec { +fn default_1180() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1178() -> Option { +fn default_1181() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1179() -> Vec { +fn default_1182() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1180() -> Vec> { +fn default_1183() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1181() -> bool { +fn default_1184() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1182() -> Vec { +fn default_1185() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1183() -> bool { +fn default_1186() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1184() -> Vec { +fn default_1187() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1185() -> Vec> { +fn default_1188() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1186() -> KnowledgeRestoreOutputReason { +fn default_1189() -> KnowledgeRestoreOutputReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_1187() -> String { +fn default_1190() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1188() -> Option { +fn default_1191() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1189() -> Integer { +fn default_1192() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1190() -> KnowledgeRestoreOutputOriginal { +fn default_1193() -> KnowledgeRestoreOutputOriginal { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1191() -> Vec> { +fn default_1194() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1192() -> Vec { +fn default_1195() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1193() -> std::collections::HashMap { +fn default_1196() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1194() -> Integer { +fn default_1197() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1195() -> bool { +fn default_1198() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1196() -> Vec { +fn default_1199() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1197() -> Integer { +fn default_1200() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1198() -> bool { +fn default_1201() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1199() -> KnowledgeSourceProbe { +fn default_1202() -> KnowledgeSourceProbe { serde_json::from_str( "{\"documents\":0,\"more\":false,\"sample\":[],\"checked\":0,\"sampled\":false}", ) .expect("schema default") } -fn default_1200() -> bool { +fn default_1203() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1201() -> bool { +fn default_1204() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1202() -> Integer { +fn default_1205() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1203() -> bool { +fn default_1206() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1204() -> Vec { +fn default_1207() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1205() -> Integer { +fn default_1208() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1206() -> bool { +fn default_1209() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1207() -> String { +fn default_1210() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1208() -> String { +fn default_1211() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1209() -> String { +fn default_1212() -> String { serde_json::from_str("\"shared\"").expect("schema default") } -fn default_1210() -> String { +fn default_1213() -> String { serde_json::from_str("\"namespace\"").expect("schema default") } -fn default_1211() -> String { +fn default_1214() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1212() -> Vec> { +fn default_1215() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1213() -> Vec { +fn default_1216() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1214() -> std::collections::HashMap { +fn default_1217() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1215() -> String { +fn default_1218() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1216() -> String { +fn default_1219() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1217() -> String { +fn default_1220() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1218() -> String { +fn default_1221() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1219() -> String { +fn default_1222() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1220() -> Integer { +fn default_1223() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1221() -> Integer { +fn default_1224() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1222() -> Integer { +fn default_1225() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1223() -> Integer { +fn default_1226() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1224() -> std::collections::HashMap { +fn default_1227() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1225() -> Integer { +fn default_1228() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1226() -> String { +fn default_1229() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1227() -> Integer { +fn default_1230() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1228() -> String { +fn default_1231() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1229() -> Integer { +fn default_1232() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1230() -> Integer { +fn default_1233() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1231() -> Integer { +fn default_1234() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1232() -> String { +fn default_1235() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1233() -> KnowledgeSourceSync { +fn default_1236() -> 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_1234() -> String { +fn default_1237() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1235() -> String { +fn default_1238() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1236() -> String { +fn default_1239() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1237() -> Vec { +fn default_1240() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1238() -> String { +fn default_1241() -> String { serde_json::from_str("\"shared\"").expect("schema default") } -fn default_1239() -> String { +fn default_1242() -> String { serde_json::from_str("\"namespace\"").expect("schema default") } -fn default_1240() -> String { +fn default_1243() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1241() -> Vec> { +fn default_1244() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1242() -> Vec { +fn default_1245() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1243() -> std::collections::HashMap { +fn default_1246() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1244() -> String { +fn default_1247() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1245() -> String { +fn default_1248() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1246() -> KnowledgeSourceSync { +fn default_1249() -> 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_1247() -> Vec { +fn default_1250() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1248() -> bool { +fn default_1251() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1249() -> bool { +fn default_1252() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1250() -> String { +fn default_1253() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1251() -> std::collections::HashMap { +fn default_1254() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1252() -> String { +fn default_1255() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1253() -> Vec { +fn default_1256() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1254() -> bool { +fn default_1257() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1255() -> String { +fn default_1258() -> String { serde_json::from_str("\"disabled\"").expect("schema default") } -fn default_1256() -> String { +fn default_1259() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1257() -> String { +fn default_1260() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1258() -> String { +fn default_1261() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1259() -> String { +fn default_1262() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1260() -> String { +fn default_1263() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1261() -> String { +fn default_1264() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1262() -> Integer { +fn default_1265() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1263() -> f64 { +fn default_1266() -> f64 { serde_json::from_str("0").expect("schema default") } -fn default_1264() -> Integer { +fn default_1267() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1265() -> KnowledgeSourceProbe { +fn default_1268() -> KnowledgeSourceProbe { serde_json::from_str( "{\"documents\":0,\"more\":false,\"sample\":[],\"checked\":0,\"sampled\":false}", ) .expect("schema default") } -fn default_1266() -> String { +fn default_1269() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1267() -> bool { +fn default_1270() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1268() -> Vec> { +fn default_1271() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1269() -> Vec { +fn default_1272() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1270() -> std::collections::HashMap { +fn default_1273() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1271() -> Vec> { +fn default_1274() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1272() -> Vec> { +fn default_1275() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1273() -> KnowledgeSourceProbe { +fn default_1276() -> KnowledgeSourceProbe { serde_json::from_str( "{\"documents\":0,\"more\":false,\"sample\":[],\"checked\":0,\"sampled\":false}", ) .expect("schema default") } -fn default_1274() -> Vec { +fn default_1277() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1275() -> Integer { +fn default_1278() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1276() -> Option> { +fn default_1279() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_1277() -> Vec { +fn default_1280() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1278() -> Vec { +fn default_1281() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1279() -> bool { +fn default_1282() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1280() -> bool { +fn default_1283() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1281() -> String { +fn default_1284() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1282() -> String { +fn default_1285() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1283() -> Vec> { +fn default_1286() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1284() -> bool { +fn default_1287() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1285() -> Vec { +fn default_1288() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1286() -> Vec { +fn default_1289() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1287() -> String { +fn default_1290() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1288() -> String { +fn default_1291() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1289() -> String { +fn default_1292() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1290() -> Vec { +fn default_1293() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1291() -> Integer { +fn default_1294() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1292() -> String { +fn default_1295() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1293() -> Integer { +fn default_1296() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1294() -> String { +fn default_1297() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1295() -> String { +fn default_1298() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1296() -> Integer { +fn default_1299() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1297() -> Integer { +fn default_1300() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1298() -> String { +fn default_1301() -> String { serde_json::from_str("\"memory_supporters\"").expect("schema default") } -fn default_1299() -> String { +fn default_1302() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1300() -> String { +fn default_1303() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1301() -> Option { +fn default_1304() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1302() -> String { +fn default_1305() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1303() -> String { +fn default_1306() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1304() -> bool { +fn default_1307() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1305() -> bool { +fn default_1308() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1306() -> String { +fn default_1309() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1307() -> std::collections::HashMap { +fn default_1310() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1308() -> Vec { +fn default_1311() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1309() -> String { +fn default_1312() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1310() -> String { +fn default_1313() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1311() -> String { +fn default_1314() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1312() -> Vec { +fn default_1315() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1313() -> String { +fn default_1316() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1314() -> String { +fn default_1317() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1315() -> Vec { +fn default_1318() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1316() -> Vec { +fn default_1319() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1317() -> Vec { +fn default_1320() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1318() -> Vec { +fn default_1321() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1319() -> Integer { +fn default_1322() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1320() -> Vec { +fn default_1323() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1321() -> Vec { +fn default_1324() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1322() -> Vec { +fn default_1325() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1323() -> Integer { +fn default_1326() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1324() -> Vec { +fn default_1327() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1325() -> std::collections::HashMap { +fn default_1328() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1326() -> std::collections::HashMap { +fn default_1329() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1327() -> Integer { +fn default_1330() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1328() -> Integer { +fn default_1331() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1329() -> Integer { +fn default_1332() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1330() -> Integer { +fn default_1333() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1331() -> Integer { +fn default_1334() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1332() -> Integer { +fn default_1335() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1333() -> bool { +fn default_1336() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1334() -> String { +fn default_1337() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1335() -> String { +fn default_1338() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1336() -> String { +fn default_1339() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1337() -> String { +fn default_1340() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1338() -> Option { +fn default_1341() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1339() -> String { +fn default_1342() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1340() -> Vec { +fn default_1343() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1341() -> String { +fn default_1344() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1342() -> MemoryAskOutputSource { +fn default_1345() -> MemoryAskOutputSource { serde_json::from_str("\"synthesized\"").expect("schema default") } -fn default_1343() -> bool { +fn default_1346() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1344() -> String { +fn default_1347() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1345() -> Vec { +fn default_1348() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1346() -> Vec { +fn default_1349() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1347() -> Vec { +fn default_1350() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1348() -> String { +fn default_1351() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1349() -> String { +fn default_1352() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1350() -> MemoryAskOutputRouteTier { +fn default_1353() -> MemoryAskOutputRouteTier { serde_json::from_str("\"\"").expect("schema default") } -fn default_1351() -> String { +fn default_1354() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1352() -> Integer { +fn default_1355() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1353() -> Integer { +fn default_1356() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1354() -> bool { +fn default_1357() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1355() -> f64 { +fn default_1358() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1356() -> Option { +fn default_1359() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1357() -> Option { +fn default_1360() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1358() -> bool { +fn default_1361() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1359() -> String { +fn default_1362() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1360() -> Integer { +fn default_1363() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1361() -> Integer { +fn default_1364() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1362() -> Integer { +fn default_1365() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1363() -> Integer { +fn default_1366() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1364() -> String { +fn default_1367() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1365() -> Vec { +fn default_1368() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1366() -> Integer { +fn default_1369() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1367() -> MemoryAskOutputConsistency { +fn default_1370() -> MemoryAskOutputConsistency { serde_json::from_str("\"\"").expect("schema default") } -fn default_1368() -> f64 { +fn default_1371() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1369() -> String { +fn default_1372() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1370() -> Integer { +fn default_1373() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1371() -> Integer { +fn default_1374() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1372() -> String { +fn default_1375() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1373() -> String { +fn default_1376() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1374() -> String { +fn default_1377() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1375() -> String { +fn default_1378() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1376() -> MemoryAskOutputDepth { +fn default_1379() -> MemoryAskOutputDepth { serde_json::from_str("\"\"").expect("schema default") } -fn default_1377() -> bool { +fn default_1380() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1378() -> Vec { +fn default_1381() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1379() -> Integer { +fn default_1382() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1380() -> Integer { +fn default_1383() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1381() -> Integer { +fn default_1384() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1382() -> Vec { +fn default_1385() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1383() -> Integer { +fn default_1386() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1384() -> Integer { +fn default_1387() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1385() -> Integer { +fn default_1388() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1386() -> MemoryAskOutputGrounding { +fn default_1389() -> MemoryAskOutputGrounding { serde_json::from_str("\"\"").expect("schema default") } -fn default_1387() -> String { +fn default_1390() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1388() -> Vec { +fn default_1391() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1389() -> Integer { +fn default_1392() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1390() -> Integer { +fn default_1393() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1391() -> Integer { +fn default_1394() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1392() -> Integer { +fn default_1395() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1393() -> std::collections::HashMap { +fn default_1396() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1394() -> MemoryAskOutputDeepSelector { +fn default_1397() -> MemoryAskOutputDeepSelector { serde_json::from_str("\"\"").expect("schema default") } -fn default_1395() -> MemoryAskOutputDeepFirst { +fn default_1398() -> MemoryAskOutputDeepFirst { serde_json::from_str("\"\"").expect("schema default") } -fn default_1396() -> Integer { +fn default_1399() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1397() -> Integer { +fn default_1400() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1398() -> Integer { +fn default_1401() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1399() -> Integer { +fn default_1402() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1400() -> f64 { +fn default_1403() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1401() -> Integer { +fn default_1404() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1402() -> Integer { +fn default_1405() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1403() -> Integer { +fn default_1406() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1404() -> Integer { +fn default_1407() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1405() -> Integer { +fn default_1408() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1406() -> bool { +fn default_1409() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1407() -> String { +fn default_1410() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1408() -> String { +fn default_1411() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1409() -> String { +fn default_1412() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1410() -> String { +fn default_1413() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1411() -> String { +fn default_1414() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1412() -> String { +fn default_1415() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1413() -> bool { +fn default_1416() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1414() -> String { +fn default_1417() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1415() -> Option { +fn default_1418() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1416() -> String { +fn default_1419() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1417() -> String { +fn default_1420() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1418() -> Vec { +fn default_1421() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1419() -> Option { +fn default_1422() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1420() -> bool { +fn default_1423() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1421() -> String { +fn default_1424() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1422() -> String { +fn default_1425() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1423() -> Vec { +fn default_1426() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1424() -> String { +fn default_1427() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1425() -> Vec { +fn default_1428() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1426() -> String { +fn default_1429() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1427() -> String { +fn default_1430() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1428() -> Vec { +fn default_1431() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1429() -> Vec { +fn default_1432() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1430() -> Integer { +fn default_1433() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1431() -> Vec { +fn default_1434() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1432() -> Vec { +fn default_1435() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1433() -> String { +fn default_1436() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1434() -> String { +fn default_1437() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1435() -> bool { +fn default_1438() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1436() -> String { +fn default_1439() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1437() -> String { +fn default_1440() -> String { serde_json::from_str("\"fact\"").expect("schema default") } -fn default_1438() -> String { +fn default_1441() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1439() -> bool { +fn default_1442() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1440() -> String { +fn default_1443() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1441() -> String { +fn default_1444() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1442() -> String { +fn default_1445() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1443() -> Vec { +fn default_1446() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1444() -> Vec { +fn default_1447() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1445() -> Vec { +fn default_1448() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1446() -> std::collections::HashMap { +fn default_1449() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1447() -> Vec { +fn default_1450() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1448() -> Integer { +fn default_1451() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1449() -> Vec { +fn default_1452() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1450() -> Integer { +fn default_1453() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1451() -> Integer { +fn default_1454() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1452() -> Integer { +fn default_1455() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1453() -> Integer { +fn default_1456() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1454() -> Integer { +fn default_1457() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1455() -> Integer { +fn default_1458() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1456() -> Integer { +fn default_1459() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1457() -> String { +fn default_1460() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1458() -> String { +fn default_1461() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1459() -> String { +fn default_1462() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1460() -> String { +fn default_1463() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1461() -> bool { +fn default_1464() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1462() -> Integer { +fn default_1465() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1463() -> Integer { +fn default_1466() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1464() -> Integer { +fn default_1467() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1465() -> Integer { +fn default_1468() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1466() -> Integer { +fn default_1469() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1467() -> bool { +fn default_1470() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1468() -> Vec { +fn default_1471() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1469() -> String { +fn default_1472() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1470() -> String { +fn default_1473() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1471() -> Option { +fn default_1474() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1472() -> Vec { +fn default_1475() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1473() -> bool { +fn default_1476() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1474() -> bool { +fn default_1477() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1475() -> Vec { +fn default_1478() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1476() -> bool { +fn default_1479() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1477() -> Option { +fn default_1480() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1478() -> Vec { +fn default_1481() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1479() -> Option { +fn default_1482() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1480() -> Option { +fn default_1483() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1481() -> Vec { +fn default_1484() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1482() -> Integer { +fn default_1485() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1483() -> bool { +fn default_1486() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1484() -> String { +fn default_1487() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1485() -> Integer { +fn default_1488() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1486() -> Integer { +fn default_1489() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1487() -> std::collections::HashMap { +fn default_1490() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1488() -> String { +fn default_1491() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1489() -> f64 { +fn default_1492() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1490() -> bool { +fn default_1493() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1491() -> String { +fn default_1494() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1492() -> String { +fn default_1495() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1493() -> Integer { +fn default_1496() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1494() -> Integer { +fn default_1497() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1495() -> Option { +fn default_1498() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1496() -> Vec { +fn default_1499() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1497() -> Vec { +fn default_1500() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1498() -> Option { +fn default_1501() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1499() -> Option { +fn default_1502() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1500() -> Integer { +fn default_1503() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1501() -> bool { +fn default_1504() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1502() -> String { +fn default_1505() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1503() -> String { +fn default_1506() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1504() -> String { +fn default_1507() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1505() -> String { +fn default_1508() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1506() -> Option { +fn default_1509() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1507() -> String { +fn default_1510() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1508() -> Integer { +fn default_1511() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1509() -> Integer { +fn default_1512() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1510() -> String { +fn default_1513() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1511() -> Vec { +fn default_1514() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1512() -> bool { +fn default_1515() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1513() -> Integer { +fn default_1516() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1514() -> Integer { +fn default_1517() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1515() -> Integer { +fn default_1518() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1516() -> Integer { +fn default_1519() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1517() -> Integer { +fn default_1520() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1518() -> String { +fn default_1521() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1519() -> String { +fn default_1522() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1520() -> String { +fn default_1523() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1521() -> String { +fn default_1524() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1522() -> Vec { +fn default_1525() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1523() -> Integer { +fn default_1526() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1524() -> Integer { +fn default_1527() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1525() -> String { +fn default_1528() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1526() -> String { +fn default_1529() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1527() -> Vec { +fn default_1530() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1528() -> String { +fn default_1531() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1529() -> String { +fn default_1532() -> String { serde_json::from_str("\"-\"").expect("schema default") } -fn default_1530() -> Vec { +fn default_1533() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1531() -> Vec { +fn default_1534() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1532() -> String { +fn default_1535() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1533() -> String { +fn default_1536() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1534() -> Vec { +fn default_1537() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1535() -> f64 { +fn default_1538() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1536() -> String { +fn default_1539() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1537() -> String { +fn default_1540() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1538() -> Vec { +fn default_1541() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1539() -> bool { +fn default_1542() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1540() -> String { +fn default_1543() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1541() -> Integer { +fn default_1544() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1542() -> Vec { +fn default_1545() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1543() -> Vec { +fn default_1546() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1544() -> Vec { +fn default_1547() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1545() -> Vec { +fn default_1548() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1546() -> Vec { +fn default_1549() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1547() -> Option { +fn default_1550() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1548() -> Option { +fn default_1551() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1549() -> Vec { +fn default_1552() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1550() -> Integer { +fn default_1553() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1551() -> Integer { +fn default_1554() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1552() -> Vec { +fn default_1555() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1553() -> Vec { +fn default_1556() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1554() -> Integer { +fn default_1557() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1555() -> Integer { +fn default_1558() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1556() -> bool { +fn default_1559() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1557() -> Vec { +fn default_1560() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1558() -> f64 { +fn default_1561() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1559() -> bool { +fn default_1562() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1560() -> String { +fn default_1563() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1561() -> String { +fn default_1564() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1562() -> Option { +fn default_1565() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1563() -> String { +fn default_1566() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1564() -> String { +fn default_1567() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1565() -> String { +fn default_1568() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1566() -> String { +fn default_1569() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1567() -> MemoryForFileHitSupersedesKind { +fn default_1570() -> MemoryForFileHitSupersedesKind { serde_json::from_str("\"\"").expect("schema default") } -fn default_1568() -> Vec { +fn default_1571() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1569() -> String { +fn default_1572() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1570() -> MemoryForFileHitVerification { +fn default_1573() -> MemoryForFileHitVerification { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1571() -> MemoryForFileHitCodeState { +fn default_1574() -> MemoryForFileHitCodeState { serde_json::from_str("\"\"").expect("schema default") } -fn default_1572() -> Vec { +fn default_1575() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1573() -> String { +fn default_1576() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1574() -> Integer { +fn default_1577() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1575() -> bool { +fn default_1578() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1576() -> String { +fn default_1579() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1577() -> String { +fn default_1580() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1578() -> String { +fn default_1581() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1579() -> String { +fn default_1582() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1580() -> String { +fn default_1583() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1581() -> String { +fn default_1584() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1582() -> Option { +fn default_1585() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1583() -> Value { +fn default_1586() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1584() -> Option { +fn default_1587() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1585() -> Option { +fn default_1588() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1586() -> Option { +fn default_1589() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1587() -> Option { +fn default_1590() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1588() -> Option { +fn default_1591() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1589() -> Option { +fn default_1592() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1590() -> bool { +fn default_1593() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1591() -> String { +fn default_1594() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1592() -> String { +fn default_1595() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1593() -> Option { +fn default_1596() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1594() -> String { +fn default_1597() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1595() -> String { +fn default_1598() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1596() -> String { +fn default_1599() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1597() -> String { +fn default_1600() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1598() -> String { +fn default_1601() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1599() -> String { +fn default_1602() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1600() -> Option { +fn default_1603() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1601() -> String { +fn default_1604() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1602() -> String { +fn default_1605() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1603() -> String { +fn default_1606() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1604() -> Integer { +fn default_1607() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1605() -> Vec { +fn default_1608() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1606() -> Integer { +fn default_1609() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1607() -> Option { +fn default_1610() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1608() -> Vec { +fn default_1611() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1609() -> std::collections::HashMap { +fn default_1612() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1610() -> Integer { +fn default_1613() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1611() -> f64 { +fn default_1614() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1612() -> Integer { +fn default_1615() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1613() -> Integer { +fn default_1616() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1614() -> Integer { +fn default_1617() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1615() -> Integer { +fn default_1618() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1616() -> Integer { +fn default_1619() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1617() -> MemoryHealthStaleness { +fn default_1620() -> 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_1618() -> Integer { +fn default_1621() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1619() -> Integer { +fn default_1622() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1620() -> f64 { +fn default_1623() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1621() -> MemoryHealthFootprint { +fn default_1624() -> MemoryHealthFootprint { serde_json::from_str("{\"value_chars\":0,\"value_tokens_est\":0,\"tokens_per_row_est\":0.0}") .expect("schema default") } -fn default_1622() -> String { +fn default_1625() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1623() -> Value { +fn default_1626() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1624() -> String { +fn default_1627() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1625() -> bool { +fn default_1628() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1626() -> Option { +fn default_1629() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1627() -> Option { +fn default_1630() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1628() -> Option { +fn default_1631() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1629() -> String { +fn default_1632() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1630() -> String { +fn default_1633() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1631() -> String { +fn default_1634() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1632() -> String { +fn default_1635() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1633() -> String { +fn default_1636() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1634() -> Option { +fn default_1637() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1635() -> String { +fn default_1638() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1636() -> Vec { +fn default_1639() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1637() -> Vec { +fn default_1640() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1638() -> Option { +fn default_1641() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1639() -> String { +fn default_1642() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1640() -> String { +fn default_1643() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1641() -> String { +fn default_1644() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1642() -> String { +fn default_1645() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1643() -> Option { +fn default_1646() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1644() -> Integer { +fn default_1647() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1645() -> Integer { +fn default_1648() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1646() -> Integer { +fn default_1649() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1647() -> Integer { +fn default_1650() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1648() -> MemoryImportResultReason { +fn default_1651() -> MemoryImportResultReason { serde_json::from_str("\"\"").expect("schema default") } -fn default_1649() -> String { +fn default_1652() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1650() -> MemoryImportResultNote { +fn default_1653() -> MemoryImportResultNote { serde_json::from_str("\"\"").expect("schema default") } -fn default_1651() -> bool { +fn default_1654() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1652() -> String { +fn default_1655() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1653() -> Option { +fn default_1656() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1654() -> Integer { +fn default_1657() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1655() -> Integer { +fn default_1658() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1656() -> Integer { +fn default_1659() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1657() -> String { +fn default_1660() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1658() -> Integer { +fn default_1661() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1659() -> Vec { +fn default_1662() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1660() -> Integer { +fn default_1663() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1661() -> Integer { +fn default_1664() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1662() -> Vec { +fn default_1665() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1663() -> Integer { +fn default_1666() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1664() -> Vec { +fn default_1667() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1665() -> Vec { +fn default_1668() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1666() -> Vec { +fn default_1669() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1667() -> Vec { +fn default_1670() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1668() -> Vec { +fn default_1671() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1669() -> Option { +fn default_1672() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1670() -> Option { +fn default_1673() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1671() -> String { +fn default_1674() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1672() -> Integer { +fn default_1675() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1673() -> String { +fn default_1676() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1674() -> Vec { +fn default_1677() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1675() -> bool { +fn default_1678() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1676() -> Vec { +fn default_1679() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1677() -> Option { +fn default_1680() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1678() -> Option { +fn default_1681() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1679() -> String { +fn default_1682() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1680() -> Integer { +fn default_1683() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1681() -> String { +fn default_1684() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1682() -> Integer { +fn default_1685() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1683() -> Option { +fn default_1686() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1684() -> String { +fn default_1687() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1685() -> String { +fn default_1688() -> 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_1686() -> Vec { +fn default_1689() -> Vec { serde_json::from_str("[\"memory.set_from_messages\",\"extraction_instructions\"]") .expect("schema default") } -fn default_1687() -> Vec { +fn default_1690() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1688() -> bool { +fn default_1691() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1689() -> String { +fn default_1692() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1690() -> String { +fn default_1693() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1691() -> Option { +fn default_1694() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1692() -> String { +fn default_1695() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1693() -> String { +fn default_1696() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1694() -> String { +fn default_1697() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1695() -> MemoryLineageOutputMechanism { +fn default_1698() -> MemoryLineageOutputMechanism { serde_json::from_str("\"unknown\"").expect("schema default") } -fn default_1696() -> Vec { +fn default_1699() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1697() -> String { +fn default_1700() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1698() -> String { +fn default_1701() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1699() -> Option { +fn default_1702() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1700() -> Vec { +fn default_1703() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1701() -> f64 { +fn default_1704() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1702() -> bool { +fn default_1705() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1703() -> bool { +fn default_1706() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1704() -> Integer { +fn default_1707() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1705() -> Integer { +fn default_1708() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1706() -> String { +fn default_1709() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1707() -> bool { +fn default_1710() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1708() -> Integer { +fn default_1711() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1709() -> String { +fn default_1712() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1710() -> String { +fn default_1713() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1711() -> String { +fn default_1714() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1712() -> Option { +fn default_1715() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1713() -> String { +fn default_1716() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1714() -> Option { +fn default_1717() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1715() -> String { +fn default_1718() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1716() -> String { +fn default_1719() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1717() -> String { +fn default_1720() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1718() -> Integer { +fn default_1721() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1719() -> String { +fn default_1722() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1720() -> Vec { +fn default_1723() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1721() -> bool { +fn default_1724() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1722() -> String { +fn default_1725() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1723() -> String { +fn default_1726() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1724() -> String { +fn default_1727() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1725() -> bool { +fn default_1728() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1726() -> std::collections::HashMap { +fn default_1729() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1727() -> String { +fn default_1730() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1728() -> String { +fn default_1731() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1729() -> Integer { +fn default_1732() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1730() -> Integer { +fn default_1733() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1731() -> Vec { +fn default_1734() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1732() -> Integer { +fn default_1735() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1733() -> Integer { +fn default_1736() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1734() -> Vec { +fn default_1737() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1735() -> String { +fn default_1738() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1736() -> Integer { +fn default_1739() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1737() -> String { +fn default_1740() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1738() -> Vec { +fn default_1741() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1739() -> Integer { +fn default_1742() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1740() -> Option { +fn default_1743() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1741() -> Vec { +fn default_1744() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1742() -> Integer { +fn default_1745() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1743() -> String { +fn default_1746() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1744() -> String { +fn default_1747() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1745() -> Vec { +fn default_1748() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1746() -> String { +fn default_1749() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1747() -> String { +fn default_1750() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1748() -> String { +fn default_1751() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1749() -> String { +fn default_1752() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1750() -> String { +fn default_1753() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1751() -> Vec { +fn default_1754() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1752() -> String { +fn default_1755() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1753() -> Integer { +fn default_1756() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1754() -> Integer { +fn default_1757() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1755() -> String { +fn default_1758() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1756() -> Integer { +fn default_1759() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1757() -> Integer { +fn default_1760() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1758() -> MemoryProposalReady { +fn default_1761() -> MemoryProposalReady { serde_json::from_str("\"\"").expect("schema default") } -fn default_1759() -> Vec { +fn default_1762() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1760() -> Vec { +fn default_1763() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1761() -> Integer { +fn default_1764() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1762() -> ProposalPolicyMode { +fn default_1765() -> ProposalPolicyMode { serde_json::from_str("\"manual\"").expect("schema default") } -fn default_1763() -> Integer { +fn default_1766() -> Integer { serde_json::from_str("2").expect("schema default") } -fn default_1764() -> Integer { +fn default_1767() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1765() -> Integer { +fn default_1768() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1766() -> ProposalPolicy { +fn default_1769() -> ProposalPolicy { serde_json::from_str( "{\"mode\":\"manual\",\"min_passes\":2,\"max_fails\":0,\"reject_after_fails\":0}", ) .expect("schema default") } -fn default_1767() -> String { - serde_json::from_str("\"\"").expect("schema default") -} -fn default_1768() -> String { - serde_json::from_str("\"\"").expect("schema default") -} -fn default_1769() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_1770() -> String { serde_json::from_str("\"\"").expect("schema default") } @@ -65733,8 +65739,8 @@ fn default_1771() -> String { fn default_1772() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1773() -> bool { - serde_json::from_str("false").expect("schema default") +fn default_1773() -> String { + serde_json::from_str("\"\"").expect("schema default") } fn default_1774() -> String { serde_json::from_str("\"\"").expect("schema default") @@ -65742,8 +65748,8 @@ fn default_1774() -> String { fn default_1775() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1776() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_1776() -> bool { + serde_json::from_str("false").expect("schema default") } fn default_1777() -> String { serde_json::from_str("\"\"").expect("schema default") @@ -65763,573 +65769,573 @@ fn default_1781() -> String { fn default_1782() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1783() -> Vec { +fn default_1783() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1784() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1785() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_1786() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1784() -> f64 { +fn default_1787() -> f64 { serde_json::from_str("1.0").expect("schema default") } -fn default_1785() -> String { +fn default_1788() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1786() -> String { +fn default_1789() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1787() -> Vec { +fn default_1790() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1788() -> String { +fn default_1791() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1789() -> String { +fn default_1792() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1790() -> String { +fn default_1793() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1791() -> String { +fn default_1794() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1792() -> bool { +fn default_1795() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1793() -> Integer { +fn default_1796() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1794() -> Integer { +fn default_1797() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1795() -> Integer { +fn default_1798() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1796() -> bool { +fn default_1799() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1797() -> String { +fn default_1800() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1798() -> Integer { +fn default_1801() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_1799() -> MemoryRecallOutputOrder { +fn default_1802() -> MemoryRecallOutputOrder { serde_json::from_str("\"recent\"").expect("schema default") } -fn default_1800() -> Vec { +fn default_1803() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1801() -> Integer { +fn default_1804() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1802() -> Value { +fn default_1805() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1803() -> Value { +fn default_1806() -> Value { serde_json::from_str("null").expect("schema default") } -fn default_1804() -> String { +fn default_1807() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1805() -> String { +fn default_1808() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1806() -> Option { +fn default_1809() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1807() -> Option { +fn default_1810() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1808() -> bool { +fn default_1811() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1809() -> String { +fn default_1812() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1810() -> String { +fn default_1813() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1811() -> std::collections::HashMap { +fn default_1814() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1812() -> std::collections::HashMap { +fn default_1815() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1813() -> MemoryRecordRowStatus { +fn default_1816() -> MemoryRecordRowStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1814() -> Option { +fn default_1817() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1815() -> Option { +fn default_1818() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1816() -> bool { +fn default_1819() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1817() -> String { +fn default_1820() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1818() -> MemoryRecordWriteOutputKeySource { +fn default_1821() -> MemoryRecordWriteOutputKeySource { serde_json::from_str("\"anonymous\"").expect("schema default") } -fn default_1819() -> std::collections::HashMap { +fn default_1822() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1820() -> String { +fn default_1823() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1821() -> Integer { +fn default_1824() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1822() -> bool { +fn default_1825() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1823() -> Option { +fn default_1826() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1824() -> Integer { +fn default_1827() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1825() -> Integer { +fn default_1828() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1826() -> Option { +fn default_1829() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1827() -> String { +fn default_1830() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1828() -> Integer { +fn default_1831() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1829() -> Integer { +fn default_1832() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1830() -> bool { +fn default_1833() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1831() -> Vec { +fn default_1834() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1832() -> Option { +fn default_1835() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1833() -> Option { +fn default_1836() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1834() -> bool { +fn default_1837() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1835() -> bool { +fn default_1838() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1836() -> String { +fn default_1839() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1837() -> f64 { +fn default_1840() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_1838() -> String { +fn default_1841() -> String { serde_json::from_str("\"fact\"").expect("schema default") } -fn default_1839() -> String { +fn default_1842() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1840() -> std::collections::HashMap { +fn default_1843() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1841() -> bool { +fn default_1844() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1842() -> Integer { +fn default_1845() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1843() -> String { +fn default_1846() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1844() -> Vec { +fn default_1847() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1845() -> Vec { +fn default_1848() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1846() -> Integer { +fn default_1849() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1847() -> Integer { +fn default_1850() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1848() -> String { +fn default_1851() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1849() -> String { +fn default_1852() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1850() -> Integer { +fn default_1853() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_1851() -> Integer { +fn default_1854() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1852() -> Integer { +fn default_1855() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1853() -> Vec { +fn default_1856() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1854() -> Integer { +fn default_1857() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1855() -> Integer { +fn default_1858() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1856() -> Integer { +fn default_1859() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1857() -> Integer { +fn default_1860() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1858() -> Vec { +fn default_1861() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1859() -> String { +fn default_1862() -> String { serde_json::from_str("\"whole\"").expect("schema default") } -fn default_1860() -> Integer { +fn default_1863() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1861() -> Vec { +fn default_1864() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1862() -> Vec { +fn default_1865() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1863() -> Integer { +fn default_1866() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1864() -> Vec { +fn default_1867() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1865() -> Integer { +fn default_1868() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1866() -> Vec { +fn default_1869() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1867() -> Vec { +fn default_1870() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1868() -> bool { +fn default_1871() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1869() -> String { +fn default_1872() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1870() -> String { +fn default_1873() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1871() -> std::collections::HashMap { +fn default_1874() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1872() -> String { +fn default_1875() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1873() -> bool { +fn default_1876() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1874() -> Vec { +fn default_1877() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1875() -> Integer { +fn default_1878() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1876() -> Integer { +fn default_1879() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1877() -> String { +fn default_1880() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1878() -> String { +fn default_1881() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1879() -> String { +fn default_1882() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1880() -> bool { +fn default_1883() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1881() -> Integer { +fn default_1884() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1882() -> Option { +fn default_1885() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1883() -> String { +fn default_1886() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1884() -> String { +fn default_1887() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1885() -> String { +fn default_1888() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1886() -> Vec { +fn default_1889() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1887() -> Integer { +fn default_1890() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1888() -> Integer { +fn default_1891() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1889() -> Integer { +fn default_1892() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1890() -> Integer { +fn default_1893() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1891() -> Integer { +fn default_1894() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1892() -> Integer { +fn default_1895() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1893() -> bool { +fn default_1896() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1894() -> Vec> { +fn default_1897() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1895() -> Vec { +fn default_1898() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1896() -> Option { +fn default_1899() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1897() -> String { +fn default_1900() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1898() -> Integer { +fn default_1901() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1899() -> Option { +fn default_1902() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1900() -> Option { +fn default_1903() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1901() -> Option { +fn default_1904() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1902() -> Option { +fn default_1905() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1903() -> Vec { +fn default_1906() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1904() -> Integer { +fn default_1907() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1905() -> String { +fn default_1908() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1906() -> String { +fn default_1909() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1907() -> Option { +fn default_1910() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1908() -> String { +fn default_1911() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1909() -> String { +fn default_1912() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1910() -> String { +fn default_1913() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1911() -> String { +fn default_1914() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1912() -> Option { +fn default_1915() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1913() -> String { +fn default_1916() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1914() -> String { +fn default_1917() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1915() -> Integer { +fn default_1918() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1916() -> String { +fn default_1919() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1917() -> String { +fn default_1920() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1918() -> String { +fn default_1921() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1919() -> String { +fn default_1922() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1920() -> String { +fn default_1923() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1921() -> Integer { +fn default_1924() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1922() -> String { +fn default_1925() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1923() -> Vec { +fn default_1926() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1924() -> String { +fn default_1927() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1925() -> Integer { +fn default_1928() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1926() -> String { +fn default_1929() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1927() -> Integer { +fn default_1930() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1928() -> String { +fn default_1931() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1929() -> String { +fn default_1932() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1930() -> Integer { +fn default_1933() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1931() -> String { +fn default_1934() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1932() -> bool { +fn default_1935() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1933() -> String { +fn default_1936() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1934() -> String { +fn default_1937() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1935() -> String { +fn default_1938() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1936() -> String { +fn default_1939() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1937() -> Option { +fn default_1940() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1938() -> String { +fn default_1941() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1939() -> Integer { +fn default_1942() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1940() -> String { +fn default_1943() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1941() -> String { +fn default_1944() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1942() -> String { +fn default_1945() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_1943() -> bool { +fn default_1946() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1944() -> Vec { +fn default_1947() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1945() -> std::collections::HashMap { +fn default_1948() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1946() -> String { +fn default_1949() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1947() -> Vec { +fn default_1950() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1948() -> std::collections::HashMap { +fn default_1951() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1949() -> Integer { +fn default_1952() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1950() -> Option { +fn default_1953() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1951() -> String { +fn default_1954() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1952() -> bool { +fn default_1955() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1953() -> Vec { +fn default_1956() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1954() -> Vec { +fn default_1957() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1955() -> std::collections::HashMap { +fn default_1958() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_1956() -> Option { +fn default_1959() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1957() -> Vec { +fn default_1960() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1958() -> Integer { +fn default_1961() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1959() -> Integer { +fn default_1962() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1960() -> Vec { +fn default_1963() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1961() -> Option { +fn default_1964() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1962() -> Vec { +fn default_1965() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1963() -> Option { +fn default_1966() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1964() -> Option { +fn default_1967() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1965() -> Vec { +fn default_1968() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1966() -> bool { +fn default_1969() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1967() -> Vec { +fn default_1970() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1968() -> bool { +fn default_1971() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_1969() -> Integer { - serde_json::from_str("0").expect("schema default") -} -fn default_1970() -> Integer { - serde_json::from_str("0").expect("schema default") -} -fn default_1971() -> Integer { - serde_json::from_str("0").expect("schema default") -} fn default_1972() -> Integer { serde_json::from_str("0").expect("schema default") } @@ -66348,8 +66354,8 @@ fn default_1976() -> Integer { fn default_1977() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1978() -> f64 { - serde_json::from_str("0.0").expect("schema default") +fn default_1978() -> Integer { + serde_json::from_str("0").expect("schema default") } fn default_1979() -> Integer { serde_json::from_str("0").expect("schema default") @@ -66357,1052 +66363,1052 @@ fn default_1979() -> Integer { fn default_1980() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1981() -> Integer { - serde_json::from_str("0").expect("schema default") +fn default_1981() -> f64 { + serde_json::from_str("0.0").expect("schema default") } fn default_1982() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1983() -> Option { +fn default_1983() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_1984() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_1985() -> Integer { + serde_json::from_str("0").expect("schema default") +} +fn default_1986() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1984() -> Option { +fn default_1987() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_1985() -> Vec { +fn default_1988() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1986() -> String { +fn default_1989() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1987() -> String { +fn default_1990() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1988() -> Integer { +fn default_1991() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_1989() -> Vec> { +fn default_1992() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_1990() -> Vec { +fn default_1993() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_1991() -> String { +fn default_1994() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_1992() -> bool { +fn default_1995() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_1993() -> String { +fn default_1996() -> String { serde_json::from_str("\"approval\"").expect("schema default") } -fn default_1994() -> String { +fn default_1997() -> String { serde_json::from_str("\"public\"").expect("schema default") } -fn default_1995() -> BrowseEntryMyStatus { +fn default_1998() -> BrowseEntryMyStatus { serde_json::from_str("\"none\"").expect("schema default") } -fn default_1996() -> String { +fn default_1999() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1997() -> String { +fn default_2000() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1998() -> String { +fn default_2001() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_1999() -> Integer { +fn default_2002() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2000() -> String { +fn default_2003() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2001() -> Option { +fn default_2004() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2002() -> Option { +fn default_2005() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2003() -> Vec { +fn default_2006() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2004() -> Option { +fn default_2007() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2005() -> Option { +fn default_2008() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2006() -> Option { +fn default_2009() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2007() -> Option> { +fn default_2010() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2008() -> Option { +fn default_2011() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2009() -> Option { +fn default_2012() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2010() -> Option { +fn default_2013() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2011() -> Option { +fn default_2014() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2012() -> Option { +fn default_2015() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2013() -> Option { +fn default_2016() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2014() -> Option { +fn default_2017() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2015() -> Option { +fn default_2018() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2016() -> Option { +fn default_2019() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2017() -> Option { +fn default_2020() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2018() -> Option { +fn default_2021() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2019() -> Option { +fn default_2022() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2020() -> Option { +fn default_2023() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2021() -> Option { +fn default_2024() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2022() -> Option { +fn default_2025() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2023() -> Option> { +fn default_2026() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2024() -> Option { +fn default_2027() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2025() -> Option { +fn default_2028() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2026() -> Option { +fn default_2029() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2027() -> Option { +fn default_2030() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2028() -> Option { +fn default_2031() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2029() -> Option>> { +fn default_2032() -> Option>> { serde_json::from_str("null").expect("schema default") } -fn default_2030() -> Option { +fn default_2033() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2031() -> Option { +fn default_2034() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2032() -> Option { +fn default_2035() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2033() -> Option { +fn default_2036() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2034() -> Option { +fn default_2037() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2035() -> Integer { +fn default_2038() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2036() -> String { +fn default_2039() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2037() -> String { +fn default_2040() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2038() -> String { +fn default_2041() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2039() -> String { +fn default_2042() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2040() -> Option { +fn default_2043() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2041() -> bool { +fn default_2044() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2042() -> Integer { +fn default_2045() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2043() -> String { +fn default_2046() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2044() -> String { +fn default_2047() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2045() -> String { +fn default_2048() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2046() -> String { +fn default_2049() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2047() -> Option { +fn default_2050() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2048() -> Option { +fn default_2051() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2049() -> String { +fn default_2052() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2050() -> Vec { +fn default_2053() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2051() -> String { +fn default_2054() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2052() -> String { +fn default_2055() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2053() -> Option { +fn default_2056() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2054() -> Vec { +fn default_2057() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2055() -> Option { +fn default_2058() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2056() -> String { +fn default_2059() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2057() -> bool { +fn default_2060() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2058() -> f64 { +fn default_2061() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2059() -> f64 { +fn default_2062() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2060() -> String { +fn default_2063() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2061() -> Option { +fn default_2064() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2062() -> Integer { +fn default_2065() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2063() -> Integer { +fn default_2066() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2064() -> NamespaceEntryVisibility { +fn default_2067() -> NamespaceEntryVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2065() -> String { +fn default_2068() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2066() -> Option { +fn default_2069() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2067() -> Option { +fn default_2070() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2068() -> Vec { +fn default_2071() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2069() -> MineEntryVisibility { +fn default_2072() -> MineEntryVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2070() -> String { +fn default_2073() -> String { serde_json::from_str("\"memory\"").expect("schema default") } -fn default_2071() -> String { +fn default_2074() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2072() -> String { +fn default_2075() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2073() -> Option { +fn default_2076() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2074() -> bool { +fn default_2077() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2075() -> bool { +fn default_2078() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2076() -> String { +fn default_2079() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2077() -> NamespaceRegisterOutputVisibility { +fn default_2080() -> NamespaceRegisterOutputVisibility { serde_json::from_str("\"private\"").expect("schema default") } -fn default_2078() -> bool { +fn default_2081() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2079() -> Integer { +fn default_2082() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2080() -> Integer { +fn default_2083() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2081() -> bool { +fn default_2084() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2082() -> Vec> { +fn default_2085() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2083() -> Option { +fn default_2086() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2084() -> Option { +fn default_2087() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2085() -> Vec { +fn default_2088() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2086() -> Integer { +fn default_2089() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2087() -> String { +fn default_2090() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2088() -> String { +fn default_2091() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2089() -> String { +fn default_2092() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2090() -> String { +fn default_2093() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2091() -> String { +fn default_2094() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2092() -> Option { +fn default_2095() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2093() -> String { +fn default_2096() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2094() -> String { +fn default_2097() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2095() -> String { +fn default_2098() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2096() -> Vec { +fn default_2099() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2097() -> Option { +fn default_2100() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2098() -> Option { +fn default_2101() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2099() -> Option { +fn default_2102() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2100() -> Option { +fn default_2103() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2101() -> String { +fn default_2104() -> String { serde_json::from_str("\"{}\"").expect("schema default") } -fn default_2102() -> NamespaceSnapshotOutputSnapshotMemoryRowStatus { +fn default_2105() -> NamespaceSnapshotOutputSnapshotMemoryRowStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2103() -> Option { +fn default_2106() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2104() -> Vec { +fn default_2107() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2105() -> String { +fn default_2108() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2106() -> Integer { +fn default_2109() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2107() -> Integer { +fn default_2110() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2108() -> Option { +fn default_2111() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2109() -> String { +fn default_2112() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2110() -> String { +fn default_2113() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2111() -> String { +fn default_2114() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2112() -> String { +fn default_2115() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2113() -> Option { +fn default_2116() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2114() -> f64 { +fn default_2117() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2115() -> Option { +fn default_2118() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2116() -> Option { +fn default_2119() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2117() -> Integer { +fn default_2120() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2118() -> Option { +fn default_2121() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2119() -> Option { +fn default_2122() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2120() -> String { +fn default_2123() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2121() -> Option { +fn default_2124() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2122() -> String { +fn default_2125() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2123() -> String { +fn default_2126() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2124() -> String { +fn default_2127() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2125() -> Option { +fn default_2128() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2126() -> String { +fn default_2129() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2127() -> Option { +fn default_2130() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2128() -> String { +fn default_2131() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2129() -> String { +fn default_2132() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2130() -> Vec { +fn default_2133() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2131() -> Vec { +fn default_2134() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2132() -> Option { +fn default_2135() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2133() -> Integer { +fn default_2136() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2134() -> String { +fn default_2137() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2135() -> Vec { +fn default_2138() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2136() -> Vec { +fn default_2139() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2137() -> String { +fn default_2140() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2138() -> Option { +fn default_2141() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2139() -> Vec { +fn default_2142() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2140() -> Integer { +fn default_2143() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2141() -> Vec { +fn default_2144() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2142() -> Option { +fn default_2145() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2143() -> Vec { +fn default_2146() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2144() -> Vec { +fn default_2147() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2145() -> Option { +fn default_2148() -> Option { serde_json::from_str("0").expect("schema default") } -fn default_2146() -> TuneProposalEffect { +fn default_2149() -> TuneProposalEffect { serde_json::from_str("\"future\"").expect("schema default") } -fn default_2147() -> TuneApplyVia { +fn default_2150() -> TuneApplyVia { serde_json::from_str("\"op\"").expect("schema default") } -fn default_2148() -> bool { +fn default_2151() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2149() -> Vec { +fn default_2152() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2150() -> Option { +fn default_2153() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2151() -> Option { +fn default_2154() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2152() -> String { +fn default_2155() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2153() -> Vec { +fn default_2156() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2154() -> Vec { +fn default_2157() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2155() -> Option { +fn default_2158() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2156() -> Option { +fn default_2159() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2157() -> Option { +fn default_2160() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2158() -> String { +fn default_2161() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2159() -> Option { +fn default_2162() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2160() -> Option { +fn default_2163() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2161() -> Option { +fn default_2164() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2162() -> Vec { +fn default_2165() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2163() -> bool { +fn default_2166() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2164() -> Option { +fn default_2167() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2165() -> Option { +fn default_2168() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2166() -> Vec { +fn default_2169() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2167() -> String { +fn default_2170() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2168() -> String { +fn default_2171() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2169() -> Vec> { +fn default_2172() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2170() -> std::collections::HashMap { +fn default_2173() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2171() -> Vec { +fn default_2174() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2172() -> Integer { +fn default_2175() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2173() -> Integer { +fn default_2176() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2174() -> String { +fn default_2177() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2175() -> String { +fn default_2178() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2176() -> String { +fn default_2179() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2177() -> Vec { +fn default_2180() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2178() -> Vec { +fn default_2181() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2179() -> String { +fn default_2182() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2180() -> String { +fn default_2183() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2181() -> bool { +fn default_2184() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2182() -> Integer { +fn default_2185() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2183() -> String { +fn default_2186() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2184() -> String { +fn default_2187() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2185() -> String { +fn default_2188() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2186() -> String { +fn default_2189() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2187() -> Vec { +fn default_2190() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2188() -> String { +fn default_2191() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2189() -> String { +fn default_2192() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2190() -> std::collections::HashMap { +fn default_2193() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2191() -> String { +fn default_2194() -> String { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2192() -> Option { +fn default_2195() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2193() -> Option { +fn default_2196() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2194() -> bool { +fn default_2197() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2195() -> String { +fn default_2198() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2196() -> String { +fn default_2199() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2197() -> Vec { +fn default_2200() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2198() -> Integer { +fn default_2201() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2199() -> String { +fn default_2202() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2200() -> String { +fn default_2203() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2201() -> Option { +fn default_2204() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2202() -> bool { +fn default_2205() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2203() -> String { +fn default_2206() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2204() -> bool { +fn default_2207() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2205() -> String { +fn default_2208() -> String { serde_json::from_str("\"inherit\"").expect("schema default") } -fn default_2206() -> Option { +fn default_2209() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2207() -> Option { +fn default_2210() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2208() -> bool { +fn default_2211() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2209() -> Vec { +fn default_2212() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2210() -> Integer { +fn default_2213() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2211() -> ProcedureEvolveOutputGate { +fn default_2214() -> ProcedureEvolveOutputGate { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2212() -> String { +fn default_2215() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2213() -> f64 { +fn default_2216() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2214() -> std::collections::HashMap { +fn default_2217() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2215() -> std::collections::HashMap { +fn default_2218() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2216() -> std::collections::HashMap { +fn default_2219() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2217() -> std::collections::HashMap { +fn default_2220() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2218() -> String { +fn default_2221() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2219() -> Vec { +fn default_2222() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2220() -> Vec { +fn default_2223() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2221() -> Vec { +fn default_2224() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2222() -> std::collections::HashMap { +fn default_2225() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2223() -> Integer { +fn default_2226() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2224() -> bool { +fn default_2227() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2225() -> std::collections::HashMap { +fn default_2228() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2226() -> Vec { +fn default_2229() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2227() -> std::collections::HashMap { +fn default_2230() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2228() -> String { +fn default_2231() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2229() -> ProcedureLocateOutputStatus { +fn default_2232() -> ProcedureLocateOutputStatus { serde_json::from_str("\"authored\"").expect("schema default") } -fn default_2230() -> Option> { +fn default_2233() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2231() -> Vec>> { +fn default_2234() -> Vec>> { serde_json::from_str("[]").expect("schema default") } -fn default_2232() -> Vec { +fn default_2235() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2233() -> Vec { +fn default_2236() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2234() -> std::collections::HashMap { +fn default_2237() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2235() -> bool { +fn default_2238() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2236() -> Vec { +fn default_2239() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2237() -> Vec> { +fn default_2240() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2238() -> String { +fn default_2241() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2239() -> std::collections::HashMap { +fn default_2242() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2240() -> std::collections::HashMap { +fn default_2243() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2241() -> Vec { +fn default_2244() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2242() -> std::collections::HashMap { +fn default_2245() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2243() -> Option> { +fn default_2246() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2244() -> bool { +fn default_2247() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2245() -> std::collections::HashMap { +fn default_2248() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2246() -> ProcedureMatchStatus { +fn default_2249() -> ProcedureMatchStatus { serde_json::from_str("\"authored\"").expect("schema default") } -fn default_2247() -> Option> { +fn default_2250() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2248() -> Vec { +fn default_2251() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2249() -> Integer { +fn default_2252() -> Integer { serde_json::from_str("1").expect("schema default") } -fn default_2250() -> Vec> { +fn default_2253() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2251() -> f64 { +fn default_2254() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2252() -> f64 { +fn default_2255() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2253() -> f64 { +fn default_2256() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2254() -> Option { +fn default_2257() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2255() -> std::collections::HashMap { +fn default_2258() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2256() -> std::collections::HashMap> { +fn default_2259() -> std::collections::HashMap> { serde_json::from_str("{}").expect("schema default") } -fn default_2257() -> String { +fn default_2260() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2258() -> Integer { +fn default_2261() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2259() -> String { +fn default_2262() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2260() -> f64 { +fn default_2263() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2261() -> Vec { +fn default_2264() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2262() -> Vec { +fn default_2265() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2263() -> Vec { +fn default_2266() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2264() -> String { +fn default_2267() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2265() -> String { +fn default_2268() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2266() -> String { +fn default_2269() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2267() -> String { +fn default_2270() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2268() -> Option { +fn default_2271() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2269() -> Integer { +fn default_2272() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2270() -> Vec { +fn default_2273() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2271() -> std::collections::HashMap { +fn default_2274() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2272() -> Option { +fn default_2275() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2273() -> String { +fn default_2276() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2274() -> Integer { +fn default_2277() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2275() -> String { +fn default_2278() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2276() -> String { +fn default_2279() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2277() -> std::collections::HashMap { +fn default_2280() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2278() -> String { +fn default_2281() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2279() -> String { +fn default_2282() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2280() -> Option { +fn default_2283() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2281() -> RunBeginOutputStatus { +fn default_2284() -> RunBeginOutputStatus { serde_json::from_str("\"active\"").expect("schema default") } -fn default_2282() -> String { +fn default_2285() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2283() -> Integer { +fn default_2286() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2284() -> Integer { +fn default_2287() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2285() -> Integer { +fn default_2288() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2286() -> Vec { +fn default_2289() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2287() -> Integer { +fn default_2290() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_2288() -> Integer { +fn default_2291() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2289() -> Integer { +fn default_2292() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2290() -> String { +fn default_2293() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2291() -> String { +fn default_2294() -> String { serde_json::from_str("\"keep\"").expect("schema default") } -fn default_2292() -> Integer { +fn default_2295() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2293() -> Integer { +fn default_2296() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2294() -> Integer { +fn default_2297() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2295() -> Option { +fn default_2298() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2296() -> Integer { +fn default_2299() -> Integer { serde_json::from_str("-1").expect("schema default") } -fn default_2297() -> Vec { +fn default_2300() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2298() -> Vec { +fn default_2301() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2299() -> Integer { +fn default_2302() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2300() -> Integer { +fn default_2303() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2301() -> Integer { +fn default_2304() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2302() -> f64 { +fn default_2305() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2303() -> Integer { +fn default_2306() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2304() -> Vec { +fn default_2307() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2305() -> Integer { +fn default_2308() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2306() -> Vec { +fn default_2309() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2307() -> Integer { +fn default_2310() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2308() -> Integer { +fn default_2311() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2309() -> Integer { +fn default_2312() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2310() -> Vec { +fn default_2313() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2311() -> Option { +fn default_2314() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2312() -> Option> { +fn default_2315() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2313() -> LiveSearchResultsLive { +fn default_2316() -> LiveSearchResultsLive { serde_json::from_str("true").expect("schema default") } -fn default_2314() -> String { +fn default_2317() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2315() -> LiveSearchHitLive { +fn default_2318() -> LiveSearchHitLive { serde_json::from_str("true").expect("schema default") } -fn default_2316() -> Vec { +fn default_2319() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2317() -> Option { +fn default_2320() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2318() -> std::collections::HashMap { +fn default_2321() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2319() -> std::collections::HashMap { +fn default_2322() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2320() -> std::collections::HashMap { +fn default_2323() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2321() -> std::collections::HashMap { +fn default_2324() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2322() -> Option> { +fn default_2325() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2323() -> Vec { +fn default_2326() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2324() -> Integer { - serde_json::from_str("0").expect("schema default") -} -fn default_2325() -> String { - serde_json::from_str("\"\"").expect("schema default") -} -fn default_2326() -> Integer { +fn default_2327() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2327() -> String { - serde_json::from_str("\"\"").expect("schema default") -} fn default_2328() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2329() -> String { - serde_json::from_str("\"\"").expect("schema default") +fn default_2329() -> Integer { + serde_json::from_str("0").expect("schema default") } fn default_2330() -> String { serde_json::from_str("\"\"").expect("schema default") @@ -67419,8 +67425,8 @@ fn default_2333() -> String { fn default_2334() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2335() -> Vec { - serde_json::from_str("[]").expect("schema default") +fn default_2335() -> String { + serde_json::from_str("\"\"").expect("schema default") } fn default_2336() -> String { serde_json::from_str("\"\"").expect("schema default") @@ -67428,7 +67434,7 @@ fn default_2336() -> String { fn default_2337() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2338() -> Vec { +fn default_2338() -> Vec { serde_json::from_str("[]").expect("schema default") } fn default_2339() -> String { @@ -67437,633 +67443,642 @@ fn default_2339() -> String { fn default_2340() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2341() -> Vec { +fn default_2341() -> Vec { + serde_json::from_str("[]").expect("schema default") +} +fn default_2342() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2343() -> String { + serde_json::from_str("\"\"").expect("schema default") +} +fn default_2344() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2342() -> Vec { +fn default_2345() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2343() -> Vec { +fn default_2346() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2344() -> String { +fn default_2347() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2345() -> String { +fn default_2348() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2346() -> Vec { +fn default_2349() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2347() -> Vec { +fn default_2350() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2348() -> Vec { +fn default_2351() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2349() -> String { +fn default_2352() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2350() -> String { +fn default_2353() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2351() -> Option { +fn default_2354() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2352() -> String { +fn default_2355() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2353() -> String { +fn default_2356() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2354() -> String { +fn default_2357() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2355() -> String { +fn default_2358() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2356() -> String { +fn default_2359() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2357() -> String { +fn default_2360() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2358() -> Vec { +fn default_2361() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2359() -> Option { +fn default_2362() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2360() -> Integer { +fn default_2363() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2361() -> Integer { +fn default_2364() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2362() -> Integer { +fn default_2365() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2363() -> Integer { +fn default_2366() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2364() -> Integer { +fn default_2367() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2365() -> bool { +fn default_2368() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2366() -> String { +fn default_2369() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2367() -> String { +fn default_2370() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2368() -> String { +fn default_2371() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2369() -> String { +fn default_2372() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2370() -> String { +fn default_2373() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2371() -> String { +fn default_2374() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2372() -> String { +fn default_2375() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2373() -> Option { +fn default_2376() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2374() -> Integer { +fn default_2377() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2375() -> Integer { +fn default_2378() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2376() -> Vec { +fn default_2379() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2377() -> String { +fn default_2380() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2378() -> String { +fn default_2381() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2379() -> String { +fn default_2382() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2380() -> String { +fn default_2383() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2381() -> Integer { +fn default_2384() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2382() -> Integer { +fn default_2385() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2383() -> Integer { +fn default_2386() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2384() -> Integer { +fn default_2387() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2385() -> Integer { +fn default_2388() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2386() -> f64 { +fn default_2389() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2387() -> Integer { +fn default_2390() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2388() -> Integer { +fn default_2391() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2389() -> Integer { +fn default_2392() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2390() -> String { +fn default_2393() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2391() -> SessionBriefStats { +fn default_2394() -> 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_2392() -> String { +fn default_2395() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2393() -> String { +fn default_2396() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2394() -> Option { +fn default_2397() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2395() -> Option { +fn default_2398() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2396() -> Option { +fn default_2399() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2397() -> Integer { +fn default_2400() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2398() -> std::collections::HashMap { +fn default_2401() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2399() -> String { +fn default_2402() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2400() -> String { +fn default_2403() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2401() -> Option { +fn default_2404() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2402() -> String { +fn default_2405() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2403() -> Integer { +fn default_2406() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2404() -> Integer { +fn default_2407() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2405() -> Option { +fn default_2408() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2406() -> std::collections::HashMap { +fn default_2409() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2407() -> String { +fn default_2410() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2408() -> Integer { +fn default_2411() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2409() -> String { +fn default_2412() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2410() -> Option { +fn default_2413() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2411() -> String { +fn default_2414() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2412() -> Option { +fn default_2415() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2413() -> String { +fn default_2416() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2414() -> String { +fn default_2417() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2415() -> String { +fn default_2418() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2416() -> String { +fn default_2419() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2417() -> Integer { +fn default_2420() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2418() -> Integer { +fn default_2421() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2419() -> String { +fn default_2422() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2420() -> std::collections::HashMap { +fn default_2423() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2421() -> String { +fn default_2424() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2422() -> String { +fn default_2425() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2423() -> bool { +fn default_2426() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2424() -> String { +fn default_2427() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2425() -> std::collections::HashMap { +fn default_2428() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2426() -> Vec> { +fn default_2429() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2427() -> Vec { +fn default_2430() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2428() -> Vec { +fn default_2431() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2429() -> bool { +fn default_2432() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2430() -> String { +fn default_2433() -> String { serde_json::from_str("\"unknown\"").expect("schema default") } -fn default_2431() -> String { +fn default_2434() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2432() -> Vec { +fn default_2435() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2433() -> bool { +fn default_2436() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2434() -> String { +fn default_2437() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2435() -> bool { +fn default_2438() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2436() -> Vec { +fn default_2439() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2437() -> std::collections::HashMap { +fn default_2440() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2438() -> Vec> { +fn default_2441() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2439() -> bool { +fn default_2442() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2440() -> bool { +fn default_2443() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2441() -> Vec> { +fn default_2444() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2442() -> std::collections::HashMap { +fn default_2445() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2443() -> String { +fn default_2446() -> String { serde_json::from_str("\"none\"").expect("schema default") } -fn default_2444() -> Vec> { +fn default_2447() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2445() -> bool { +fn default_2448() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2446() -> String { +fn default_2449() -> String { serde_json::from_str("\"calibrated\"").expect("schema default") } -fn default_2447() -> std::collections::HashMap { +fn default_2450() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2448() -> std::collections::HashMap { +fn default_2451() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2449() -> String { +fn default_2452() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2450() -> std::collections::HashMap { +fn default_2453() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2451() -> std::collections::HashMap { +fn default_2454() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2452() -> std::collections::HashMap { +fn default_2455() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2453() -> String { +fn default_2456() -> String { serde_json::from_str("\"ok\"").expect("schema default") } -fn default_2454() -> String { +fn default_2457() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2455() -> String { +fn default_2458() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2456() -> bool { +fn default_2459() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2457() -> Integer { +fn default_2460() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2458() -> String { +fn default_2461() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2459() -> String { +fn default_2462() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2460() -> Vec { +fn default_2463() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2461() -> bool { +fn default_2464() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2462() -> Vec { +fn default_2465() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2463() -> std::collections::HashMap> { +fn default_2466() -> std::collections::HashMap> { serde_json::from_str("{}").expect("schema default") } -fn default_2464() -> Vec> { +fn default_2467() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2465() -> Vec> { +fn default_2468() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2466() -> String { +fn default_2469() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2467() -> Vec> { +fn default_2470() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2468() -> std::collections::HashMap { +fn default_2471() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2469() -> String { +fn default_2472() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2470() -> Vec> { +fn default_2473() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2471() -> bool { +fn default_2474() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2472() -> Integer { +fn default_2475() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2473() -> Vec> { +fn default_2476() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2474() -> String { +fn default_2477() -> String { serde_json::from_str("\"no_flaky_signal\"").expect("schema default") } -fn default_2475() -> bool { +fn default_2478() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2476() -> Option> { +fn default_2479() -> Option> { serde_json::from_str("null").expect("schema default") } -fn default_2477() -> Vec { +fn default_2480() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2478() -> bool { +fn default_2481() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2479() -> std::collections::HashMap { +fn default_2482() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2480() -> String { +fn default_2483() -> String { serde_json::from_str("\"not_computed\"").expect("schema default") } -fn default_2481() -> Vec> { +fn default_2484() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2482() -> String { +fn default_2485() -> String { serde_json::from_str("\"candidate\"").expect("schema default") } -fn default_2483() -> std::collections::HashMap { +fn default_2486() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2484() -> String { +fn default_2487() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2485() -> bool { +fn default_2488() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2486() -> Integer { +fn default_2489() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2487() -> std::collections::HashMap { +fn default_2490() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2488() -> bool { +fn default_2491() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2489() -> Vec> { +fn default_2492() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2490() -> std::collections::HashMap { +fn default_2493() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2491() -> std::collections::HashMap { +fn default_2494() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2492() -> String { +fn default_2495() -> String { serde_json::from_str("\"lower_bound\"").expect("schema default") } -fn default_2493() -> bool { +fn default_2496() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2494() -> Vec { +fn default_2497() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2495() -> Vec> { +fn default_2498() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2496() -> std::collections::HashMap { +fn default_2499() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2497() -> Vec { +fn default_2500() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2498() -> String { +fn default_2501() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2499() -> bool { +fn default_2502() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2500() -> bool { +fn default_2503() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2501() -> std::collections::HashMap { +fn default_2504() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2502() -> String { +fn default_2505() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2503() -> bool { +fn default_2506() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2504() -> std::collections::HashMap { +fn default_2507() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2505() -> std::collections::HashMap { +fn default_2508() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2506() -> Vec> { +fn default_2509() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2507() -> Vec { +fn default_2510() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2508() -> std::collections::HashMap { +fn default_2511() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2509() -> Vec> { +fn default_2512() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2510() -> bool { +fn default_2513() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2511() -> bool { +fn default_2514() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2512() -> Vec { +fn default_2515() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2513() -> std::collections::HashMap { +fn default_2516() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2514() -> String { +fn default_2517() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2515() -> std::collections::HashMap { +fn default_2518() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2516() -> bool { +fn default_2519() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2517() -> bool { +fn default_2520() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2518() -> String { +fn default_2521() -> String { serde_json::from_str("\"no_signal\"").expect("schema default") } -fn default_2519() -> Vec { +fn default_2522() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2520() -> f64 { +fn default_2523() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2521() -> Integer { +fn default_2524() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2522() -> String { +fn default_2525() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2523() -> std::collections::HashMap { +fn default_2526() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2524() -> std::collections::HashMap { +fn default_2527() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2525() -> std::collections::HashMap { +fn default_2528() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2526() -> std::collections::HashMap { +fn default_2529() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2527() -> String { +fn default_2530() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2528() -> std::collections::HashMap { +fn default_2531() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2529() -> bool { +fn default_2532() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2530() -> std::collections::HashMap { +fn default_2533() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2531() -> std::collections::HashMap { +fn default_2534() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2532() -> std::collections::HashMap { +fn default_2535() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2533() -> std::collections::HashMap { +fn default_2536() -> std::collections::HashMap { serde_json::from_str("{}").expect("schema default") } -fn default_2534() -> String { +fn default_2537() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2535() -> Vec> { +fn default_2538() -> Vec> { serde_json::from_str("[]").expect("schema default") } -fn default_2536() -> Integer { +fn default_2539() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2537() -> String { +fn default_2540() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2538() -> bool { +fn default_2541() -> bool { serde_json::from_str("true").expect("schema default") } -fn default_2539() -> String { +fn default_2542() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2540() -> Vec { +fn default_2543() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2541() -> bool { +fn default_2544() -> bool { serde_json::from_str("false").expect("schema default") } -fn default_2542() -> Vec { +fn default_2545() -> Vec { serde_json::from_str("[]").expect("schema default") } -fn default_2543() -> f64 { +fn default_2546() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2544() -> String { +fn default_2547() -> String { serde_json::from_str("\"\"").expect("schema default") } -fn default_2545() -> Integer { +fn default_2548() -> Integer { serde_json::from_str("4096").expect("schema default") } -fn default_2546() -> Integer { +fn default_2549() -> Integer { serde_json::from_str("0").expect("schema default") } -fn default_2547() -> Option { +fn default_2550() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2548() -> f64 { +fn default_2551() -> f64 { serde_json::from_str("0.0").expect("schema default") } -fn default_2549() -> Option { +fn default_2552() -> Option { serde_json::from_str("null").expect("schema default") } -fn default_2550() -> Vec { +fn default_2553() -> 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 f319369e4b0..679ea14c252 100644 --- a/sdk/rust/tests/registry_contracts.rs +++ b/sdk/rust/tests/registry_contracts.rs @@ -9199,6 +9199,11 @@ fn code_test_gate() { serde_json::from_str::("[]").unwrap(), "code.test_gate:untested" ); + assert_eq!( + encoded["unlinked"], + serde_json::from_str::("[]").unwrap(), + "code.test_gate:unlinked" + ); assert_eq!( encoded["changed_files"], serde_json::from_str::("[]").unwrap(), @@ -9224,6 +9229,11 @@ fn code_test_gate() { serde_json::from_str::("0").unwrap(), "code.test_gate:untested_total" ); + assert_eq!( + encoded["unlinked_total"], + serde_json::from_str::("0").unwrap(), + "code.test_gate:unlinked_total" + ); assert_eq!( encoded["tests_capped"], serde_json::from_str::("false").unwrap(), @@ -9234,6 +9244,11 @@ fn code_test_gate() { serde_json::from_str::("false").unwrap(), "code.test_gate:untested_capped" ); + assert_eq!( + encoded["unlinked_capped"], + serde_json::from_str::("false").unwrap(), + "code.test_gate:unlinked_capped" + ); assert_eq!( encoded["counts_floor"], serde_json::from_str::("true").unwrap(), diff --git a/sdk/typescript/src/generated/ops.ts b/sdk/typescript/src/generated/ops.ts index 41901ca9ddc..940ba1afdb1 100644 --- a/sdk/typescript/src/generated/ops.ts +++ b/sdk/typescript/src/generated/ops.ts @@ -1914,13 +1914,16 @@ export interface CodeTestGateInput { export interface CodeTestGateOutput { tests?: Array>; untested?: Array>; + unlinked?: Array>; changed_files?: string[]; touched_symbols?: Array>; obligations?: boolean; tests_total?: number; untested_total?: number; + unlinked_total?: number; tests_capped?: boolean; untested_capped?: boolean; + unlinked_capped?: boolean; counts_floor?: boolean; epistemic?: string; causes?: string[]; diff --git a/server/cli/code_maintenance.py b/server/cli/code_maintenance.py index cabb5b91289..21f9e3aef49 100644 --- a/server/cli/code_maintenance.py +++ b/server/cli/code_maintenance.py @@ -685,7 +685,7 @@ async def _repack(args: argparse.Namespace) -> int: # No hunks would read as "every function in these files changed". skipped += 1 continue - hunks, names = _parse_unified_diff_full(diff) + hunks, names, _ = _parse_unified_diff_full(diff) rows = await repo.functions_for_paths(org, ns, files[:60], limit=400) touched: list[dict[str, Any]] = [] for r in rows: diff --git a/server/code/api/models_symbol.py b/server/code/api/models_symbol.py index 7ebd2d8333e..68b4f7ddb6e 100644 --- a/server/code/api/models_symbol.py +++ b/server/code/api/models_symbol.py @@ -550,11 +550,11 @@ class CodeImpactInput(_CodeIdentity, _PrPostImage, _ResultLessons): # How many caller hops the radius walks from the seeds (1–2). depth: int = Field(default=2, ge=1, le=2) # Diff shape: repo-relative changed paths, and/or a unified diff whose - # hunk line ranges narrow the touched set from whole files to the + # changed lines narrow the touched set from whole files to the # symbols actually edited. files: list[str] = Field(default_factory=list, max_length=50) - # A unified diff (at most 200,000 chars); its hunk ranges pick the edited functions - # as seeds. + # A unified diff (at most 200,000 chars) against the revision the index holds; each + # changed line seeds the innermost function it sits in. diff: str = Field(default="", max_length=200_000) # Left out of `owners`: the change's own author(s) are not its reviewers. # GitHub logins as recorded on merged PRs. @@ -600,8 +600,8 @@ def _drop_unset(self, handler: SerializerFunctionWrapHandler) -> dict[str, Any]: # predictor of a revert or fix PR it is weak (within noise in a # calibration replay). blast_radius_score: float = 0.0 - # Diff shape only: the symbols the change touches (hunk-overlap when a - # diff was given, else every function in the files), and the files that + # Diff shape only: the symbols the change touches (the functions its changed + # lines sit in when a diff was given, else every function in the files), and the files that # historically co-change with the touched set but are absent from it — # the "did you forget to update X?" list. touched_symbols: list[dict[str, Any]] = Field(default_factory=list) diff --git a/server/code/api/models_testing.py b/server/code/api/models_testing.py index 7cd9b44b1ee..ed3bc007c8c 100644 --- a/server/code/api/models_testing.py +++ b/server/code/api/models_testing.py @@ -1,5 +1,5 @@ -"""The test plane: code.test_gate (tests to run and the untested blast radius), -code.test_home, code.tests_for and code.coverage_claim. +"""The test plane: code.test_gate (tests to run, and the touched definitions measured +unexecuted or linked to no test), code.test_home, code.tests_for and code.coverage_claim. """ from __future__ import annotations @@ -11,31 +11,33 @@ from server.code.api.models_common import _CodeIdentity, _drop_unset_resolved_by # ============================================================ -# code.test_gate (pre-PR obligations: tests to run + untested blast radius) +# code.test_gate (pre-PR obligations: tests to run + what no test is shown to run) # ============================================================ class CodeTestGateInput(_CodeIdentity): - """The pre-PR question in one call: for THIS change, which tests must - run, and which touched code no test reaches. Diff-shaped like - code.impact (files and/or a unified diff); the answer is two ordered - lists and one boolean, `obligations`, that a Stop hook or CI step can - gate on. Tests come back in EVIDENCE order — a changed test file first, - then the stem partner of a changed source file, then the mined test - map, then tests reached through the call graph — each row saying why - it is there and how to run it (or `run_unknown` when the harness is - not derivable from the path; never a guessed command).""" + """The pre-PR question in one call: for THIS change, which tests must run, and + which touched definitions no test is shown to run. Diff-shaped like code.impact + (files and/or a unified diff); the answer is the tests, two lists of touched + definitions and one boolean, `obligations`, that a Stop hook or CI step can gate on. + Tests come back in EVIDENCE order — a changed test file, then tests a coverage run + measured executing a touched definition, then tests a call chain links to one, then + tests that call other definitions of the edited files, then the mined test map — + each row saying why it is there and how to run it (or `run_unknown` when the harness + is not derivable from the path; never a guessed command).""" # Changed file paths; a test file here is itself a test to run. Unioned with the # diff's paths; files and/or `diff` must be given. files: list[str] = Field(default_factory=list, max_length=50) - # A unified diff; its hunks (line spans, hunk-header names) pick the touched functions. - # A file with no hunks, as from `files` alone, touches every function in it. + # A unified diff against the revision the index holds (the working tree against HEAD, a + # pull request against its merge base). Each changed line touches the innermost + # function or class it sits in; a line in neither touches nothing. A file with no + # hunks, as from `files` alone, touches every function in it. diff: str = Field(default="", max_length=200_000) # Reverse-edge hops to look for tests through. Two is code.impact's # ceiling; three reaches integration tests that sit behind a fixture. depth: int = Field(default=2, ge=1, le=3) - # At most this many rows in each of `tests` and `untested` (at most 200). + # At most this many rows in each of `tests`, `untested` and `unlinked` (at most 200). limit: int = Field(default=30, ge=1, le=200) @@ -157,39 +159,61 @@ def _drop_unset(self, handler: SerializerFunctionWrapHandler) -> dict[str, Any]: class CodeTestGateOutput(BaseModel): - # {test_path, why, evidence, run, run_unknown, [src_path], [confidence], [hop]} - # why in {changed_test, stem_partner, test_map, graph_hop}, strongest first. + # {test_path, why, evidence, run, run_unknown} per test file, strongest evidence first. + # `why` is the kind of evidence: `changed_test` (the file is in the diff), `coverage` + # (a coverage run measured it executing a touched definition; `links_to`), + # `static_call` (a call chain links its tests to a touched definition: `hop` of the + # nearest, `callers` how many of its tests do, `links_to` naming up to ten of the + # definitions, `confidence` 0.9 at one hop, 0.8 at two and 0.6 at three, + # `via` `constructor` when the test calls the class of a touched constructor, + # `enclosing` when it calls the function a touched nested function is defined in or + # `fixture` when it reaches through a fixture), `file_neighbor` (it calls `callees` + # other definitions of the edited files and says nothing about the touched ones), + # `test_map` (mined history about the file: `src_path`, `confidence`). Within a kind + # the nearest hop is first, then the file linked to more of the touched definitions, + # then the one with more tests or callees. tests: list[dict[str, Any]] = Field(default_factory=list) - # Touched source symbols no test reaches by any evidence class: - # {qualified_name, path, start_line}. The other half of the obligation. + # Touched source definitions a coverage run measured unexecuted, at a commit the index + # verified: {qualified_name, path, start_line, commit}. Empty without such a run. untested: list[dict[str, Any]] = Field(default_factory=list) + # Touched source definitions no coverage run measured and no call chain links a test + # to: {qualified_name, path, start_line}. Not proof that no test runs them: tests reach + # code through fixtures, string dispatch and entry points the graph has no edge for. A + # `file_neighbor` or `test_map` row never takes a definition off this list. + unlinked: list[dict[str, Any]] = Field(default_factory=list) # The change as the gate saw it. changed_files: list[str] = Field(default_factory=list) - # The source symbols the change touches, {qualified_name, path, start_line, tier}, by - # path and line (first 200). + # The source definitions the change touches, {qualified_name, path, start_line, tier}, + # by path and line (first 200). touched_symbols: list[dict[str, Any]] = Field(default_factory=list) - # True while either list is non-empty: run the tests, then rely on green; - # write a test for (or explain) the untested rows. + # True while `tests` or `untested` is non-empty: run the tests, then rely on green; + # write a test for (or explain) the untested rows. `unlinked` alone asks for nothing. obligations: bool = False # Rows of `tests` before `limit`. tests_total: int = 0 # Rows of `untested` before `limit`. untested_total: int = 0 + # Rows of `unlinked` before `limit`. + unlinked_total: int = 0 # True when `limit` cut `tests` short of `tests_total`. tests_capped: bool = False # True when `limit` cut `untested` short of `untested_total`. untested_capped: bool = False - # Same epistemic contract as code.callers: the graph is a floor, so - # "no test reaches this" means none the index can see. + # True when `limit` cut `unlinked` short of `unlinked_total`. + unlinked_capped: bool = False + # Same epistemic contract as code.callers: the graph is a floor, so a test missing + # from `tests` is one the index cannot see. counts_floor: bool = True - # Epistemic envelope, as on code.callers: "exact" when the compiler tier - # covers every seed file, no call site named like a seed was declined, - # and no override seed lacks its base; otherwise "lower_bound" with - # `causes` from {unresolved_calls, ambiguous_calls, dispatch_seeds_missing, - # treesitter_only_files, external_calls, ctor_edges_absent, truncated (a - # hop read hit its row limit)}. + # `measured` when a verified coverage run settled every touched definition and every + # changed line sat in one; otherwise `lower_bound` with `causes`. The gate never + # answers `exact`: a static graph cannot show that no test runs a definition. epistemic: str = "lower_bound" - # Why `epistemic` is lower_bound (values above); [] when it is exact. + # Why `epistemic` is lower_bound, from code.callers' causes (unresolved_calls, + # ambiguous_calls, treesitter_only_files, external_calls, truncated: a hop read hit its + # row limit) and two of its own: `unmapped_changes` (a changed line of an indexed file + # sits in no definition) and `no_coverage` (no verified coverage run measured a touched + # definition). Empty when `epistemic` is measured, or when the change touches no + # indexed source definition. causes: list[str] = Field(default_factory=list) # Distinct symbols reached per hop BEFORE any slicing: {1: n, 2: m}. # The true size of the radius when `truncated` says the rows are a page. diff --git a/server/code/app/coverage_freshness.py b/server/code/app/coverage_freshness.py index 3124aa02375..d487151028a 100644 --- a/server/code/app/coverage_freshness.py +++ b/server/code/app/coverage_freshness.py @@ -144,3 +144,42 @@ async def measured_for( unmeasured_paths=[p for p in src_paths if p not in files], ) return out + + +async def measured_definitions( + repo: CodeRepo, org: str, ns: str, rows: list[dict[str, Any]] +) -> dict[str, dict[str, Any]]: + """What a coverage run measured of each definition row (`symbol_id`, `path`, + `start_line`, `end_line`): symbol_id -> {executed, commit}. A definition is absent + unless the run measured its file at the commit the index parsed both the file and the + definition's span at; one measured unexecuted also needs the run at the index + watermark, as the coverage claim's `uncovered` does. No coverage rows, one read.""" + paths = list(dict.fromkeys(str(r.get("path") or "") for r in rows if r.get("path"))) + files = await repo.coverage_files_for(org, ns, paths) if paths else {} + if not files: + return {} + kinds = tuple(sorted({str(r.get("kind") or "function") for r in rows})) + (head, indexed), extents = await asyncio.gather( + source_identities(repo, org, ns, list(files)), + repo.functions_for_paths(org, ns, list(files), limit=2000, kinds=kinds, with_revision=True), + ) + parsed_at = { + (str(e["symbol_id"]), int(e["start_line"] or 0), int(e["end_line"] or 0)): str( + e.get("extent_commit") or "" + ).rstrip("\0") + for e in extents + } + out: dict[str, dict[str, Any]] = {} + for r in rows: + path, sid = str(r.get("path") or ""), str(r.get("symbol_id") or "") + start, end = int(r.get("start_line") or 0), int(r.get("end_line") or 0) + if path not in files or start <= 0 or end < start: + continue + commit = str(files[path].get("commit_sha") or "") + span_commit = parsed_at.get((sid, start, end), "") + if not verified_source(path, commit, head, indexed, {path: {span_commit}}): + continue + executed = cr.intersects(cr.json_ranges(str(files[path].get("lines") or "[]")), start, end) + if executed or commit == head: + out[sid] = {"executed": executed, "commit": commit} + return out diff --git a/server/code/app/symbol/diff.py b/server/code/app/symbol/diff.py index 3a357292e2f..546aaa45efe 100644 --- a/server/code/app/symbol/diff.py +++ b/server/code/app/symbol/diff.py @@ -1,12 +1,31 @@ """Unified-diff parsing for the diff-shaped ops (code.impact, code.test_gate): the changed -line ranges on the new side and the hunk context names, and the touched function rows -picked by name match and span overlap. +lines on the side the index holds, the new-side ranges and the hunk context names, and the +touched definitions those lines sit in. """ from __future__ import annotations import re -from typing import Any +from bisect import bisect_left, bisect_right +from typing import Any, NamedTuple + +# What a diff's changed lines are matched against. A class is a definition a diff can edit +# outside every method (an attribute, a decorator), and a line of its body is not the +# method's below it. +DEFINITION_KINDS = ("function", "method", "fixture", "class") + + +class Hunk(NamedTuple): + """What one hunk changes on the old side, the revision the index holds: a diff of a + working tree starts from HEAD, a pull request's from its merge base.""" + + # The function git named in the hunk header, '' when it named none. + name: str + # Old-side line ranges the hunk deletes or replaces, inclusive. + removed: tuple[tuple[int, int], ...] + # For each run of added lines that replaces nothing, the old line it follows (0 at the + # top of the file). + inserted: tuple[int, ...] def _hunk_context_name(ctx: str) -> str: @@ -35,17 +54,27 @@ def _hunk_context_name(ctx: str) -> str: return cand +_HUNK_RE = re.compile(r"@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(.*)$") + + def _parse_unified_diff_full( diff: str, -) -> tuple[dict[str, list[tuple[int, int]]], dict[str, set[str]]]: - """(ranges, header_names): the NEW-side line ranges per path, plus the function names - git put in each hunk header (`@@ … @@ `). The names are drift-proof: hunk - line numbers are as of the PR's commit and stop matching once master moves, but the - enclosing function's name does not, so seeds match by name first and by span second.""" +) -> tuple[dict[str, list[tuple[int, int]]], dict[str, set[str]], dict[str, list[Hunk]]]: + """(ranges, header_names, changes): per path, the NEW-side line ranges, the function + names git put in the hunk headers (`@@ … @@ `), and each hunk's OLD-side + changed lines. A hunk sent without its lines (the coding-agent hooks send headers + only, from a zero-context diff) changes what its header's old range says: `-12,3` + replaces lines 12 to 14, `-12,0` inserts after line 12. With context lines in a + headers-only diff the range includes them.""" ranges: dict[str, list[tuple[int, int]]] = {} names: dict[str, set[str]] = {} + changes: dict[str, list[Hunk]] = {} + lines = diff.splitlines() path = "" - for line in diff.splitlines(): + i = 0 + while i < len(lines): + line = lines[i] + i += 1 if line.startswith("+++ "): p = line[4:].strip() if p.startswith("b/"): @@ -54,16 +83,65 @@ def _parse_unified_diff_full( if path: ranges.setdefault(path, []) names.setdefault(path, set()) - elif path and line.startswith("@@"): - m = re.match(r"@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@(.*)$", line) - if m: - start = int(m.group(1)) - count = int(m.group(2) or 1) - ranges[path].append((start, max(start, start + count - 1))) - nm = _hunk_context_name(m.group(3) or "") - if nm: - names[path].add(nm) - return ranges, names + changes.setdefault(path, []) + continue + m = _HUNK_RE.match(line) if path and line.startswith("@@") else None + if not m: + continue + old_start, old_count = int(m.group(1)), int(m.group(2) or 1) + start, count = int(m.group(3)), int(m.group(4) or 1) + ranges[path].append((start, max(start, start + count - 1))) + nm = _hunk_context_name(m.group(5) or "") + if nm: + names[path].add(nm) + removed, inserted, i = _hunk_body(lines, i, old_start, old_count, count) + if not removed and not inserted: + if old_count: + removed = [(old_start, old_start + old_count - 1)] + else: + inserted = [old_start] + changes[path].append(Hunk(nm, tuple(removed), tuple(inserted))) + return ranges, names, changes + + +def _hunk_body( + lines: list[str], i: int, old_start: int, old_left: int, new_left: int +) -> tuple[list[tuple[int, int]], list[int], int]: + """(removed, inserted, next index): the old-side changes of the hunk body starting at + `lines[i]`, read for as long as the header's line counts last. A run of added lines + that follows removed lines replaces them and is no insertion of its own.""" + removed: list[tuple[int, int]] = [] + inserted: list[int] = [] + # A zero-count old range names the line the hunk follows, any other its first line. + old = old_start if old_left else old_start + 1 + in_run = False # inside a run of changed lines that already removed or inserted + seen = False + while i < len(lines) and (old_left > 0 or new_left > 0): + line = lines[i] + if line.startswith("\\"): # "\ No newline at end of file" + i += 1 + continue + # The next file's header, when the hunk came without its lines. + nxt = lines[i + 1] if i + 1 < len(lines) else "" + if not seen and line.startswith("--- ") and nxt.startswith("+++ "): + break + if line.startswith("-") and old_left > 0: + if in_run and removed and removed[-1][1] == old - 1: + removed[-1] = (removed[-1][0], old) + else: + removed.append((old, old)) + old, old_left, in_run = old + 1, old_left - 1, True + elif line.startswith("+") and new_left > 0: + if not in_run: + inserted.append(old - 1) + new_left, in_run = new_left - 1, True + elif (line.startswith(" ") or not line) and old_left > 0 and new_left > 0: + old, old_left, new_left, in_run = old + 1, old_left - 1, new_left - 1, False + else: + break + seen = True + i += 1 + return removed, inserted, i def _name_matches(qualified: str, header_name: str) -> bool: @@ -77,33 +155,94 @@ def _name_matches(qualified: str, header_name: str) -> bool: return False +def _span(r: dict[str, Any]) -> tuple[int, int]: + start = int(r["start_line"] or 0) + return start, max(start, int(r["end_line"] or 0)) + + +def _hunk_rows(rows: list[dict[str, Any]], hunk: Hunk) -> tuple[list[dict[str, Any]], int]: + """(the rows of one file the hunk edits, its changed lines that sit in none of them). + The edited definition is the innermost one whose span holds a changed line. An + insertion sits between two old lines and is inside a definition that holds both, or + directly above one (a decorator). `rows` is ordered widest span first.""" + out: dict[str, dict[str, Any]] = {} + unmapped = 0 + lo = min((_span(r)[0] for r in rows), default=1) + hi = max((_span(r)[1] for r in rows), default=0) + lines: list[int] = [] + for a, b in hunk.removed: + # Lines outside every definition of the file need no walk: a header may claim any range. + inside = range(max(a, lo), min(b, hi) + 1) + lines.extend(inside) + unmapped += (b - a + 1) - len(inside) + lines = sorted(set(lines)) + owner: dict[int, dict[str, Any]] = {} + for r in rows: # widest first, so the innermost definition is written last + start, end = _span(r) + for n in lines[bisect_left(lines, start) : bisect_right(lines, end)]: + owner[n] = r + for n in lines: + if n in owner: + out[str(owner[n]["symbol_id"])] = owner[n] + else: + unmapped += 1 + for after in hunk.inserted: + holders = [r for r in rows if _span(r)[0] <= after and after + 1 <= _span(r)[1]] + row = (holders or [r for r in rows if _span(r)[0] == after + 1])[-1:] + if row: + out[str(row[0]["symbol_id"])] = row[0] + else: + unmapped += 1 + return list(out.values()), unmapped + + +def _header_row(rows: list[dict[str, Any]], hunk: Hunk) -> dict[str, Any] | None: + """The definition a hunk's header names, for a hunk whose lines sit in none: the + nearest same-named row above the hunk, and only one the index holds no body extent + for (a compiler row of one line), where line numbers cannot tell.""" + first = min([a for a, _ in hunk.removed] + list(hunk.inserted), default=0) + above = [ + r + for r in rows + if _name_matches(str(r["qualified_name"]), hunk.name) and _span(r)[0] <= first + ] + if not above: + return None + row = max(above, key=lambda r: _span(r)[0]) + return row if _span(row)[0] == _span(row)[1] else None + + def _touched_rows_for_diff( symbol_rows: list[dict[str, Any]], - hunks: dict[str, list[tuple[int, int]]], - header_names: dict[str, set[str]], -) -> tuple[list[dict[str, Any]], list[str]]: - """(the touched function rows in seed order, the ids the walk seeds). Narrows the - functions of the changed files to the ones the hunks edit when hunk ranges are known; - a file without hunks (files-only shape) touches every function in it. Pure, so the - diff shape's seed rule is testable without a repo.""" - touched_rows: list[dict[str, Any]] = [] + changes: dict[str, list[Hunk]], +) -> tuple[list[dict[str, Any]], list[str], int]: + """(the touched definition rows in seed order, the ids the walk seeds, the changed + lines of indexed files that sit in no definition). A file with hunks touches the + definitions its changed lines sit in; a file without hunks (files-only shape) touches + every function in it. Pure, so the diff shape's seed rule is testable without a repo.""" + by_path: dict[str, list[dict[str, Any]]] = {} for r in symbol_rows: - p = str(r["path"]) - spans = hunks.get(p) - names = header_names.get(p) or set() - via = "file" - if spans: - # Name first (drift-proof: hunk lines are as of the PR's commit, symbols are as - # of master), span overlap second. - if any(_name_matches(str(r["qualified_name"]), n) for n in names): - via = "header" - elif any( - s <= int(r["end_line"] or 0) and e >= int(r["start_line"] or 0) for s, e in spans - ): - via = "hunk" + by_path.setdefault(str(r["path"]), []).append(r) + touched_rows: list[dict[str, Any]] = [] + unmapped = 0 + for p, rows in by_path.items(): + hunks = changes.get(p) + if not hunks: + touched_rows += [{**r, "via": "file"} for r in rows if str(r.get("kind")) != "class"] + continue + rows = sorted(rows, key=lambda r: _span(r)[0] - _span(r)[1]) + edited: set[str] = set() + for hunk in hunks: + found, missed = _hunk_rows(rows, hunk) + named = _header_row(rows, hunk) if not found and hunk.name else None + edited |= {str(r["qualified_name"]) for r in found} + if named is not None: + touched_rows.append({**named, "via": "header"}) else: - continue # file is in the diff but this function is not - touched_rows.append({**r, "via": via}) + unmapped += missed + # A definition the two tiers hold as two rows is edited in both, whichever row's + # span held the line (the compiler's may be its declaration line only). + touched_rows += [{**r, "via": "hunk"} for r in rows if str(r["qualified_name"]) in edited] # Both tiers index the same definition under different symbol_ids: one row per (path, # qualified_name), scip first, carrying every id of the rows it stands for (`tier_ids`). # The walk seeds all of them: parser-tier edges point at the parser-tier id, and a @@ -117,10 +256,10 @@ def _touched_rows_for_diff( first["tier_ids"] = list(dict.fromkeys([*first["tier_ids"], *map(str, ids)])) else: kept[key] = {**r, "tier_ids": list(dict.fromkeys(map(str, ids)))} - # Deterministic, explainable order: header-named symbols first (the function git - # itself says the hunk sits in), then span hits, then whole-file seeds. - rank = {"header": 0, "hunk": 1, "file": 2} - rows = sorted( + # Deterministic, explainable order: the definitions a changed line sits in, then the + # ones only a hunk header names, then whole-file seeds. + rank = {"hunk": 0, "header": 1, "file": 2} + out = sorted( kept.values(), key=lambda r: (rank[r["via"]], str(r["path"]), int(r["start_line"] or 0)) ) - return rows, list(dict.fromkeys(sid for r in rows for sid in r["tier_ids"])) + return out, list(dict.fromkeys(sid for r in out for sid in r["tier_ids"])), unmapped diff --git a/server/code/app/symbol/gate.py b/server/code/app/symbol/gate.py index f4e291bbad8..742457839c6 100644 --- a/server/code/app/symbol/gate.py +++ b/server/code/app/symbol/gate.py @@ -1,12 +1,11 @@ -"""code.test_gate: the tests a diff reaches through the callers graph, credited to -the touched symbols they were reached from. +"""code.test_gate: the tests the index links to a diff's touched definitions, each row +under its evidence, and the touched definitions no test is linked to. """ from __future__ import annotations import asyncio import time -from typing import Any from server.code.api.models_testing import CodeTestGateInput, CodeTestGateOutput from server.code.app.common import ( @@ -18,73 +17,30 @@ from server.code.app.spans import code_span, set_code_span_attributes, span_attrs from server.code.app.symbol.coverage import ( _declined_safe, - _env_fields, _graph_paths, _scip_coverage, _unindexed_paths, ) -from server.code.app.symbol.diff import _parse_unified_diff_full, _touched_rows_for_diff -from server.code.app.symbol.edges import _GRAPH_EDGE_KINDS, _hop_counts +from server.code.app.symbol.diff import ( + DEFINITION_KINDS, + _parse_unified_diff_full, + _touched_rows_for_diff, +) +from server.code.app.symbol.edges import _hop_counts +from server.code.app.symbol.test_links import link_tests +from server.code.domain.index.epistemic import CAUSE_NO_COVERAGE, CAUSE_UNMAPPED from server.code.domain.index.epistemic import envelope as _envelope from server.code.store.index import CodeRepo -from server.code.store.index import prefer_scip_edges as _prefer_scip_edges from server.core.errors import ValidationError from server.settings import settings _GATE_READ_LIMIT = 300 -async def _expand_impact_with_roots( - repo: CodeRepo, org: str, ns: str, root_of: dict[str, str], depth: int -) -> tuple[dict[str, dict[str, Any]], bool]: - """Like _expand_impact, but every reached node remembers WHICH touched symbols it is - reachable from (`roots`), so a test reached in the walk can be credited to the specific - touched symbols it covers: the per-symbol fact the untested complement needs. `root_of` - maps each seed id (every tier's, see `_seed_ids_of`) to its touched symbol. Depth <= 3. - Returns (impacted, capped): capped when a hop's read hit its row limit.""" - - roots_of: dict[str, set[str]] = {sid: {root} for sid, root in root_of.items()} - impacted: dict[str, dict[str, Any]] = {} - frontier = list(root_of) - capped = False - for hop in range(max(1, min(depth, 3))): - if not frontier: - break - rows = await repo.edges_for_symbols( - org, - ns, - frontier, - direction="callers", - edge_kinds=_GRAPH_EDGE_KINDS, - limit=_GATE_READ_LIMIT, - ) - capped = capped or len(rows) >= _GATE_READ_LIMIT - rows = _prefer_scip_edges(rows) - nxt: list[str] = [] - for r in rows: - sid, to = str(r["from_symbol_id"]), str(r["to_symbol_id"]) - inherited = set(roots_of.get(to) or ()) - if sid in roots_of and sid not in impacted: - continue # a seed calling a seed - if sid not in impacted: - impacted[sid] = { - "qualified_name": str(r["from_qualified_name"]), - "path": str(r["path"]), - "hop": hop + 1, - "tier": str(r["tier"]), - } - nxt.append(sid) - merged = roots_of.setdefault(sid, set()) - merged |= inherited - impacted[sid]["roots"] = sorted(merged) - frontier = nxt - return impacted, capped - - async def handle_code_test_gate(input: CodeTestGateInput) -> CodeTestGateOutput: - """Pre-PR obligations for a diff: tests to run (evidence-ordered, with a - run command when derivable) and the touched symbols no test reaches. - See code/domain/index/test_gate.py for the ordering rules.""" + """Pre-PR obligations for a diff: tests to run (evidence-ordered, with a run command + when derivable), the touched definitions a coverage run measured unexecuted and the + ones the index links no test to. See code/domain/index/test_gate.py for the rules.""" from server.code.domain.index.test_gate import GateInputs, build_gate, is_test_path require_code_intel() @@ -95,19 +51,19 @@ async def handle_code_test_gate(input: CodeTestGateInput) -> CodeTestGateOutput: repo = CodeRepo() with code_span("test_gate.diff_parse") as sp: - hunks, header_names = _parse_unified_diff_full(input.diff) if input.diff else ({}, {}) + hunks, _, changes = _parse_unified_diff_full(input.diff) if input.diff else ({}, {}, {}) span_attrs(sp, results=len(hunks)) changed = list(dict.fromkeys([*input.files, *hunks.keys()]))[:200] src_paths = [p for p in changed if not is_test_path(p)] with code_span("test_gate.functions_for_paths", seeds=len(src_paths)) as sp: symbol_rows = ( - await repo.functions_for_paths(org, ns, src_paths, limit=400) if src_paths else [] + await repo.functions_for_paths(org, ns, src_paths, limit=2000, kinds=DEFINITION_KINDS) + if src_paths + else [] ) span_attrs(sp, results=len(symbol_rows)) - rows, seed_ids = _touched_rows_for_diff(symbol_rows, hunks, header_names) - # every seed id credits the touched symbol it stands for - root_of = {sid: str(r["symbol_id"]) for r in rows for sid in r["tier_ids"]} + rows, seed_ids, unmapped = _touched_rows_for_diff(symbol_rows, changes) touched = sorted( ( { @@ -125,18 +81,26 @@ async def handle_code_test_gate(input: CodeTestGateInput) -> CodeTestGateOutput: with code_span("test_gate.hop_walk", seeds=len(seed_ids), depth=input.depth) as sp: known_paths, bare_paths = _graph_paths(src_paths, symbol_rows) ( - (impacted, capped), + links, (unresolved_n, ambiguous_n), scip_paths, unindexed, ) = await asyncio.gather( - _expand_impact_with_roots(repo, org, ns, root_of, input.depth) - if seed_ids - else _empty_impacted(), + link_tests( + repo, + org, + ns, + rows, + symbol_rows, + depth=input.depth, + read_limit=_GATE_READ_LIMIT, + neighbors=input.limit, + ), _declined_safe(repo, org, ns, touched), _scip_coverage(repo, org, ns, known_paths, symbol_rows), _unindexed_paths(repo, org, ns, bare_paths), ) + impacted = links.impacted span_attrs(sp, results=len(impacted)) with code_span("test_gate.tests", seeds=len(src_paths)) as sp: test_map = await repo.test_map_for(org, ns, src_paths, limit=200) if src_paths else [] @@ -148,6 +112,9 @@ async def handle_code_test_gate(input: CodeTestGateInput) -> CodeTestGateOutput: touched=touched, impacted=impacted, test_map=test_map, + neighbors=links.neighbors, + measured=links.measured, + coverage=links.coverage, run_overrides_json=str(settings.code_test_gate_run_templates), limit=input.limit, ) @@ -160,8 +127,17 @@ async def handle_code_test_gate(input: CodeTestGateInput) -> CodeTestGateOutput: seed_paths=[*known_paths, *sorted(unindexed)], scip_paths=scip_paths, unindexed_paths=unindexed, - truncated=capped, + truncated=links.capped, ) + # The graph is never proof that no test runs a definition: the answer is `measured` + # only when a coverage run settled every touched definition and every changed line sat + # in one. + causes = [ + *env.causes, + *([CAUSE_UNMAPPED] if unmapped else []), + *([CAUSE_NO_COVERAGE] if gate.unmeasured else []), + ] + measured = bool(touched) and not unmapped and not gate.unmeasured trace_run_id = new_trace_run_id() schedule_code_trace( org=org, @@ -194,18 +170,18 @@ async def handle_code_test_gate(input: CodeTestGateInput) -> CodeTestGateOutput: return CodeTestGateOutput( tests=gate.tests, untested=gate.untested, + unlinked=gate.unlinked, changed_files=changed, touched_symbols=[{k: v for k, v in t.items() if k != "symbol_id"} for t in touched][:200], obligations=gate.obligations, tests_total=gate.tests_total, untested_total=gate.untested_total, + unlinked_total=gate.unlinked_total, tests_capped=gate.tests_total > len(gate.tests), untested_capped=gate.untested_total > len(gate.untested), + unlinked_capped=gate.unlinked_total > len(gate.unlinked), by_hop_counts=by_hop_counts, - **_env_fields(env), + epistemic="measured" if measured else "lower_bound", + causes=[] if measured else causes, trace_run_id=trace_run_id, ) - - -async def _empty_impacted() -> tuple[dict[str, dict[str, Any]], bool]: - return {}, False diff --git a/server/code/app/symbol/impact.py b/server/code/app/symbol/impact.py index 2419d2b9ee1..3fecc8e6222 100644 --- a/server/code/app/symbol/impact.py +++ b/server/code/app/symbol/impact.py @@ -29,7 +29,11 @@ _scip_coverage, _unindexed_paths, ) -from server.code.app.symbol.diff import _parse_unified_diff_full, _touched_rows_for_diff +from server.code.app.symbol.diff import ( + DEFINITION_KINDS, + _parse_unified_diff_full, + _touched_rows_for_diff, +) from server.code.app.symbol.dispatch import _dispatch_missing, _dispatch_seeds from server.code.app.symbol.edges import ( _IMPACT_READ_LIMIT, @@ -130,19 +134,26 @@ async def _diff_seeds( overlay: Any, ) -> tuple[list[str], list[dict[str, Any]], list[dict[str, Any]], list[str]]: """Diff shape: (seed paths, the index's function rows in them, the touched rows, the - ids the walk seeds). Hunk ranges narrow whole files to the functions actually edited, - which is what makes this sharper than a flat file-level reaching set; the functions an - open PR adds are seeds the index lacks, appended as tier `overlay`.""" + ids the walk seeds). The changed lines narrow whole files to the functions actually + edited, which is what makes this sharper than a flat file-level reaching set; the + functions an open PR adds are seeds the index lacks, appended as tier `overlay`.""" with code_span("impact.diff_parse") as sp: - hunks, header_names = _parse_unified_diff_full(in_diff) if in_diff else ({}, {}) + hunks, _, changes = _parse_unified_diff_full(in_diff) if in_diff else ({}, {}, {}) span_attrs(sp, results=len(hunks)) seed_paths = list(dict.fromkeys([*in_files, *hunks.keys()]))[:200] with code_span("impact.functions_for_paths", seeds=len(seed_paths)) as sp: - symbol_rows = ( - await repo.functions_for_paths(org, ns, seed_paths, limit=400) if seed_paths else [] + definitions = ( + await repo.functions_for_paths(org, ns, seed_paths, limit=2000, kinds=DEFINITION_KINDS) + if seed_paths + else [] ) - span_attrs(sp, results=len(symbol_rows)) - touched_rows, seed_ids = _touched_rows_for_diff(symbol_rows, hunks, header_names) + span_attrs(sp, results=len(definitions)) + # Classes are read so that a line of a class body is not taken for the method below it; + # the radius is seeded by functions only. + touched_rows, _, _ = _touched_rows_for_diff(definitions, changes) + touched_rows = [r for r in touched_rows if str(r.get("kind")) != "class"] + seed_ids = list(dict.fromkeys(sid for r in touched_rows for sid in r["tier_ids"])) + symbol_rows = [r for r in definitions if str(r.get("kind")) != "class"] added_rows = _overlay_added_rows(overlay) if added_rows: touched_rows = [*touched_rows, *added_rows] diff --git a/server/code/app/symbol/test_links.py b/server/code/app/symbol/test_links.py new file mode 100644 index 00000000000..4a64801e4d3 --- /dev/null +++ b/server/code/app/symbol/test_links.py @@ -0,0 +1,183 @@ +"""The tests the index links to a set of touched definitions, and what a coverage run +measured of each: the reverse walk through the call graph, the test files that call the +other definitions of the edited files, and the imported execution evidence. +""" + +from __future__ import annotations + +import asyncio +from dataclasses import dataclass, field +from typing import Any + +from server.code.app.coverage_freshness import measured_definitions, partition_coverage_rows +from server.code.app.symbol.edges import _GRAPH_EDGE_KINDS +from server.code.domain.index import coverage_runs as cr +from server.code.store.index import CodeRepo +from server.code.store.index import prefer_scip_edges as _prefer_scip_edges + +# A Python class call ends at the class symbol: a test that builds the object runs these. +_CONSTRUCTORS = ("__init__", "__new__") + + +@dataclass +class Links: + # reverse-edge reach: {symbol_id: {qualified_name, path, hop, tier, roots, [via]}}, where + # roots is the touched symbol ids the node reaches and via is `constructor`, `enclosing` + # or `fixture` + impacted: dict[str, dict[str, Any]] = field(default_factory=dict) + # True when a hop's read hit its row limit + capped: bool = False + # {path, callees}: test files calling other definitions of the edited files + neighbors: list[dict[str, Any]] = field(default_factory=list) + # touched symbol_id -> {executed, commit}, for the definitions a verified run measured + measured: dict[str, dict[str, Any]] = field(default_factory=dict) + # {test_path, roots}: tests a verified run measured executing touched definitions + coverage: list[dict[str, Any]] = field(default_factory=list) + + +def _seed_roots( + touched: list[dict[str, Any]], symbol_rows: list[dict[str, Any]] +) -> tuple[dict[str, set[str]], dict[str, str]]: + """(seed id -> the touched symbol ids it stands for, seed id -> how it stands for a + definition it is not). Every tier's id of a touched definition seeds it. Two kinds of + definition have no callers of their own in a call graph, so another definition's + callers are theirs: the class of a touched `__init__` or `__new__` (`constructor`), + and every function a touched nested function is defined in (`enclosing`).""" + roots: dict[str, set[str]] = {} + for r in touched: + for sid in r.get("tier_ids") or [r["symbol_id"]]: + roots.setdefault(str(sid), set()).add(str(r["symbol_id"])) + own = set(roots) + by_name = {(str(r["path"]), str(r["qualified_name"])): r for r in symbol_rows} + stands: dict[str, str] = {} + + def alias(row: dict[str, Any], root: str, how: str) -> None: + for sid in row.get("tier_ids") or [row["symbol_id"]]: + roots.setdefault(str(sid), set()).add(root) + if str(sid) not in own: + stands.setdefault(str(sid), how) + + for r in touched: + owner, _, name = str(r["qualified_name"]).rpartition("::") + parent = by_name.get((str(r["path"]), owner)) + if parent is not None and str(parent.get("kind")) == "class": + if name in _CONSTRUCTORS: + alias(parent, str(r["symbol_id"]), "constructor") + continue + while parent is not None and str(parent.get("kind")) != "class": + alias(parent, str(r["symbol_id"]), "enclosing") + owner = owner.rpartition("::")[0] + parent = by_name.get((str(r["path"]), owner)) + return roots, stands + + +async def _walk( + repo: CodeRepo, + org: str, + ns: str, + roots: dict[str, set[str]], + stands: dict[str, str], + *, + depth: int, + read_limit: int, +) -> tuple[dict[str, dict[str, Any]], bool]: + """Reverse edges from the seeds, depth <= 3. Every reached node remembers which touched + symbols it reaches (`roots`), so a test is credited to the definitions it links to. + Returns (impacted, capped): capped when a hop's read hit `read_limit`.""" + roots_of = {sid: set(ids) for sid, ids in roots.items()} + impacted: dict[str, dict[str, Any]] = {} + frontier = list(roots) + capped = False + for hop in range(max(1, min(depth, 3))): + if not frontier: + break + rows = await repo.edges_for_symbols( + org, + ns, + frontier, + direction="callers", + edge_kinds=_GRAPH_EDGE_KINDS, + limit=read_limit, + ) + capped = capped or len(rows) >= read_limit + nxt: list[str] = [] + for r in _prefer_scip_edges(rows): + sid, to = str(r["from_symbol_id"]), str(r["to_symbol_id"]) + if sid in roots and sid not in impacted: + continue # a seed calling a seed + if sid not in impacted: + impacted[sid] = { + "qualified_name": str(r["from_qualified_name"]), + "path": str(r["path"]), + "hop": hop + 1, + "tier": str(r["tier"]), + "roots": [], + } + if str(r.get("edge_kind")) == "fixture_use": + impacted[sid]["via"] = "fixture" + elif to in stands: + impacted[sid]["via"] = stands[to] + nxt.append(sid) + merged = roots_of.setdefault(sid, set()) + merged |= roots_of.get(to) or set() + impacted[sid]["roots"] = sorted(merged) + frontier = nxt + return impacted, capped + + +async def _coverage( + repo: CodeRepo, org: str, ns: str, touched: list[dict[str, Any]] +) -> tuple[dict[str, dict[str, Any]], list[dict[str, Any]]]: + """(what a verified coverage run measured of each touched definition, the tests it + measured executing them). The definitions' identity is settled by + `measured_definitions`; a test row also needs its own file at the run's commit.""" + measured = await measured_definitions(repo, org, ns, touched) + executed = [r for r in touched if measured.get(str(r["symbol_id"]), {}).get("executed")] + if not executed: + return measured, [] + paths = list(dict.fromkeys(str(r["path"]) for r in executed)) + current, _ = await partition_coverage_rows( + repo, org, ns, await repo.coverage_rows_for(org, ns, paths) + ) + tests: dict[str, set[str]] = {} + for row in current: + ranges = cr.evidence_ranges(str(row.get("evidence") or "")) + for r in executed: + if str(r["path"]) == str(row.get("src_path")) and cr.intersects( + ranges, int(r["start_line"] or 0), int(r["end_line"] or 0) + ): + tests.setdefault(str(row.get("test_path") or ""), set()).add(str(r["symbol_id"])) + return measured, [{"test_path": tp, "roots": sorted(ids)} for tp, ids in tests.items() if tp] + + +async def link_tests( + repo: CodeRepo, + org: str, + ns: str, + touched: list[dict[str, Any]], + symbol_rows: list[dict[str, Any]], + *, + depth: int, + read_limit: int, + neighbors: int, +) -> Links: + """The test links of `touched` (rows of `symbol_rows`, the definitions of the edited + source files): the walk, at most `neighbors` file neighbours and the measured status, + read together. A change that touches no definition (module-level lines) still has file + neighbours.""" + if not symbol_rows: + return Links() + roots, stands = _seed_roots(touched, symbol_rows) + others = [str(r["symbol_id"]) for r in symbol_rows if str(r["symbol_id"]) not in roots] + (impacted, capped), near, (measured, coverage) = await asyncio.gather( + _walk(repo, org, ns, roots, stands, depth=depth, read_limit=read_limit), + repo.test_files_calling(org, ns, others, limit=neighbors), + _coverage(repo, org, ns, touched), + ) + return Links( + impacted=impacted, + capped=capped, + neighbors=[{"path": str(r["path"]), "callees": int(r["callees"])} for r in near], + measured=measured, + coverage=coverage, + ) diff --git a/server/code/domain/index/epistemic.py b/server/code/domain/index/epistemic.py index f3bdbd30ab3..fd2ccef8235 100644 --- a/server/code/domain/index/epistemic.py +++ b/server/code/domain/index/epistemic.py @@ -55,6 +55,12 @@ CAUSE_STALE = "scip_stale_files" # The walk stopped before the graph did: whatever else holds, the rows are part of it. CAUSE_TRUNCATED = "truncated" +# code.test_gate only. A changed line of an indexed file sits in no definition the index +# holds (module-level code), so no definition answers for it. +CAUSE_UNMAPPED = "unmapped_changes" +# code.test_gate only. No verified coverage run measured a touched definition: its status +# comes from the static graph, which cannot show that no test runs it. +CAUSE_NO_COVERAGE = "no_coverage" CAUSES: tuple[str, ...] = ( CAUSE_UNRESOLVED, CAUSE_AMBIGUOUS, diff --git a/server/code/domain/index/test_gate.py b/server/code/domain/index/test_gate.py index 1e69c2a71b6..5f77ce866c7 100644 --- a/server/code/domain/index/test_gate.py +++ b/server/code/domain/index/test_gate.py @@ -1,17 +1,21 @@ """Pure helpers for code.test_gate: the pre-PR obligation list. -A change carries two obligations before "done": the tests that reach it -must run, and the parts of its blast radius that NO test reaches must be -named (so the author writes one, or says why not). This module turns the -raw evidence — the diff's own files, the test map, the reverse-edge walk — -into rows ordered by the STRENGTH of their evidence, each saying why it is -there and how to run it, and into the untested complement. - -Why evidence order and not confidence order: a test file that is itself in the diff is -an obligation on its own evidence (you edited it, run it); a stem partner (`foo.py` → -`test_foo.py`) is the repository's own naming convention; a test-map row is mined -history; a graph hop is a call chain. Naming the tests before the agent declares done is -what cuts agent-caused regressions. +A change carries two obligations before "done": the tests linked to it must run, and the +parts of it a coverage run measured unexecuted must be named (so the author writes a test, +or says why not). This module turns the raw evidence into test rows ordered by the +STRENGTH of their evidence, each saying why it is there and how to run it, and sorts the +touched definitions into `untested` (measured unexecuted) and `unlinked` (no coverage run +and no static link). + +Why evidence order: a test file that is itself in the diff is an obligation on its own +evidence (you edited it, run it); a coverage run measured its tests executing the +definition; a static call chain names a test that reaches the definition; a file +neighbour is a test that calls other definitions of the edited file and says nothing +about this one; a test-map row is mined history about the file. + +A static graph cannot prove that no test runs a definition: tests reach code through +fixtures, string dispatch and public entry points the graph holds no edge for. So only a +coverage run says `untested`, and a file-level row never clears `unlinked`. Run commands: a row carries a runnable `run` when the harness is derivable from the path, else `run_unknown=True` — never a guessed suite command. @@ -25,13 +29,19 @@ from pathlib import PurePosixPath from typing import Any -# Evidence classes, strongest first. The integer is the sort key and rides -# the wire as `why` text; keep the order stable — the plugin renders it. +# Evidence kinds, strongest first. The integer is the sort key and the name rides the wire +# as `why`; keep the order stable — the plugin renders it. CHANGED_TEST = "changed_test" -STEM_PARTNER = "stem_partner" +COVERAGE = "coverage" +STATIC_CALL = "static_call" +FILE_NEIGHBOR = "file_neighbor" TEST_MAP = "test_map" -GRAPH_HOP = "graph_hop" -_ORDER = {CHANGED_TEST: 0, STEM_PARTNER: 1, TEST_MAP: 2, GRAPH_HOP: 3} +_ORDER = {CHANGED_TEST: 0, COVERAGE: 1, STATIC_CALL: 2, FILE_NEIGHBOR: 3, TEST_MAP: 4} +# How often the test a `static_call` row names executes the definition it links to, by hop: +# the share measured against per-test coverage of two repositories, to one decimal. +_HOP_CONFIDENCE = {1: 0.9, 2: 0.8, 3: 0.6} +# Definitions a row names in `links_to`. +_LINKS_SHOWN = 10 _TEST_DIR_RE = re.compile(r"(^|/)(tests?|__tests__|spec|specs)(/|$)") _TEST_FILE_RE = re.compile( @@ -52,29 +62,6 @@ def is_test_path(path: str) -> bool: return bool(_TEST_DIR_RE.search(p) or _TEST_FILE_RE.search(p)) -def _stem(path: str) -> str: - name = PurePosixPath(path).stem.lower() - # 02345_foo_bar.sql -> foo_bar; test_foo -> foo; foo_test -> foo - name = re.sub(r"^\d+_", "", name) - name = re.sub(r"^test_?", "", name) - name = re.sub(r"_?tests?$", "", name) - name = re.sub(r"\.(test|spec)$", "", name) - return name - - -def stem_partners(test_path: str, src_paths: list[str]) -> list[str]: - """Source files among `src_paths` whose stem the test's stem contains, - the same rule the test-map worker uses (`src/**/tests/` name-stem match). - Stems under 3 characters never match: 'io' is inside everything.""" - t = _stem(test_path) - out = [] - for s in src_paths: - ss = _stem(s) - if len(ss) >= 3 and ss in t: - out.append(s) - return out - - # ---- run recipes ----------------------------------------------------------- # (regex over the repo-relative path, template). Templates may use {path}, # {dir}, {stem}, {name} (file name without extension), {parent} (name of the @@ -142,13 +129,19 @@ def run_command_for(test_path: str, overrides_json: str = "") -> tuple[str, bool @dataclass class GateInputs: changed_paths: list[str] - # symbols the change touches: {symbol_id, qualified_name, path} + # definitions the change touches: {symbol_id, qualified_name, path, start_line} touched: list[dict[str, Any]] - # reverse-edge reach: {symbol_id: {qualified_name, path, hop, roots}} where - # roots is the set of touched symbol_ids this node is reachable from + # reverse-edge reach: {symbol_id: {qualified_name, path, hop, roots, [via]}} where + # roots is the touched symbol_ids this node reaches impacted: dict[str, dict[str, Any]] # code_test_map rows for the change's source paths test_map: list[dict[str, Any]] + # {path, callees}: test files calling other definitions of the edited files, most first + neighbors: list[dict[str, Any]] = field(default_factory=list) + # touched symbol_id -> {executed, commit}: what a verified coverage run measured + measured: dict[str, dict[str, Any]] = field(default_factory=dict) + # {test_path, roots}: tests a verified coverage run measured executing touched symbols + coverage: list[dict[str, Any]] = field(default_factory=list) run_overrides_json: str = "" limit: int = 30 @@ -157,17 +150,48 @@ class GateInputs: class Gate: tests: list[dict[str, Any]] = field(default_factory=list) untested: list[dict[str, Any]] = field(default_factory=list) + unlinked: list[dict[str, Any]] = field(default_factory=list) tests_total: int = 0 untested_total: int = 0 + unlinked_total: int = 0 + # touched source definitions no verified coverage run measured + unmeasured: int = 0 @property def obligations(self) -> bool: return bool(self.tests_total or self.untested_total) -def build_gate(inp: GateInputs) -> Gate: - src_changed = [p for p in inp.changed_paths if not is_test_path(p)] - rows: dict[str, dict[str, Any]] = {} # test_path -> row (first = strongest) +def _links_to(roots: set[str], names: dict[str, str]) -> list[str]: + return sorted(names[r] for r in roots if r in names)[:_LINKS_SHOWN] + + +def _static_files(inp: GateInputs) -> tuple[list[dict[str, Any]], set[str]]: + """(per test file a call chain reaches the change from: its nearest test node, the + touched symbol ids its tests link to and how many of its tests do; the touched symbol + ids any test links to).""" + files: dict[str, dict[str, Any]] = {} + linked: set[str] = set() + # Nearest hop first; within a hop the walk's own order stands (the surest edge first), + # so the test a file's row names is the one the index is surest of. + nodes = sorted( + (v for v in inp.impacted.values() if is_test_path(str(v.get("path") or ""))), + key=lambda v: int(v.get("hop") or 0), + ) + for v in nodes: + roots = set(v.get("roots") or ()) + linked |= roots + f = files.setdefault(str(v["path"]), {"node": v, "roots": set(), "callers": 0}) + f["roots"] |= roots + f["callers"] += 1 + return [{"path": p, **f} for p, f in files.items()], linked + + +def _test_rows(inp: GateInputs, names: dict[str, str]) -> tuple[list[dict[str, Any]], set[str]]: + """(one row per test file under its strongest evidence, the touched symbol ids a + static call chain links a test to).""" + rows: dict[str, dict[str, Any]] = {} + rank: dict[str, tuple[int, int]] = {} # test_path -> (touched definitions linked, tests) def add(test_path: str, why: str, **extra: Any) -> None: if not test_path or test_path in rows: @@ -185,14 +209,44 @@ def add(test_path: str, why: str, **extra: Any) -> None: for p in inp.changed_paths: if is_test_path(p): add(p, CHANGED_TEST, evidence="in the diff") - # 2. stem partners of changed source files, by the repo's own naming + # 2. tests a coverage run measured executing a touched definition + for c in inp.coverage: + roots = set(c.get("roots") or ()) + links = _links_to(roots, names) + rank.setdefault(str(c.get("test_path") or ""), (len(roots), 0)) + add( + str(c.get("test_path") or ""), + COVERAGE, + evidence=f"a coverage run measured it executing {', '.join(links[:3])}", + links_to=links, + ) + # 3. tests a call chain reaches a touched definition from + static, linked = _static_files(inp) + for f in static: + v, hop = f["node"], int(f["node"].get("hop") or 0) + rank.setdefault(f["path"], (len(f["roots"]), int(f["callers"]))) + add( + f["path"], + STATIC_CALL, + evidence=f"{v.get('qualified_name', '')} reaches the change in {hop} hop(s)", + hop=hop, + callers=int(f["callers"]), + confidence=_HOP_CONFIDENCE.get(hop, min(_HOP_CONFIDENCE.values())), + links_to=_links_to(f["roots"], names), + **({"via": str(v["via"])} if v.get("via") else {}), + ) + # 4. tests that call other definitions of the edited files: about the file, not about + # any touched definition + for n in inp.neighbors: + callees = int(n.get("callees") or 0) + add( + str(n.get("path") or ""), + FILE_NEIGHBOR, + evidence=f"calls {callees} other definition(s) of the edited files", + callees=callees, + ) + # 5. the mined test map for t in inp.test_map: - tp = str(t.get("test_path") or "") - partners = stem_partners(tp, src_changed) - if partners: - add(tp, STEM_PARTNER, evidence=f"stem of {partners[0]}", src_path=partners[0]) - # 3. the mined test map, confidence-ordered - for t in sorted(inp.test_map, key=lambda r: -float(r.get("confidence") or 0.0)): add( str(t.get("test_path") or ""), TEST_MAP, @@ -200,60 +254,61 @@ def add(test_path: str, why: str, **extra: Any) -> None: src_path=str(t.get("src_path") or ""), confidence=round(float(t.get("confidence") or 0.0), 3), ) - # 4. tests reached through the call graph, nearest hop first - graph_tested_roots: set[str] = set() - test_nodes = sorted( - (v for v in inp.impacted.values() if is_test_path(str(v.get("path") or ""))), - key=lambda v: (int(v.get("hop") or 0), str(v.get("path") or "")), - ) - for v in test_nodes: - graph_tested_roots |= set(v.get("roots") or ()) - qn, hop = v.get("qualified_name", ""), v.get("hop", "?") - add( - str(v["path"]), - GRAPH_HOP, - evidence=f"{qn} reaches the change in {hop} hop(s)", - hop=int(v.get("hop") or 0), - ) - + # Within a kind: the nearest hop, then the file that links to more of the touched + # definitions, then the one with more tests doing so: a module's own test file calls it + # from many tests, a bystander from one. ordered = sorted( rows.values(), key=lambda r: ( _ORDER[r["why"]], - -float(r.get("confidence") or 0.0), int(r.get("hop") or 0), + -rank.get(r["test_path"], (0, 0))[0], + -rank.get(r["test_path"], (0, 0))[1], + -int(r.get("callees") or 0), + -float(r.get("confidence") or 0.0), r["test_path"], ), ) + return ordered, linked - # Untested complement: touched source symbols no test reaches by any - # evidence class — not via the test map (its path has no row), not via - # the graph (no test node has it as a root). - mapped_src = {str(t.get("src_path") or "") for t in inp.test_map} - stem_covered = { - str(r.get("src_path")) for r in ordered if r["why"] == STEM_PARTNER and r.get("src_path") - } + +def build_gate(inp: GateInputs) -> Gate: + names = {str(s.get("symbol_id") or ""): str(s.get("qualified_name") or "") for s in inp.touched} + ordered, linked = _test_rows(inp, names) + + # A touched source definition is `untested` only when a coverage run measured it + # unexecuted, and `unlinked` when no run measured it and no call chain links a test to + # it. File-level rows (a neighbour, the test map) say nothing about one definition. untested: list[dict[str, Any]] = [] + unlinked: list[dict[str, Any]] = [] + unmeasured = 0 for s in inp.touched: path = str(s.get("path") or "") if is_test_path(path): continue sid = str(s.get("symbol_id") or "") - if path in mapped_src or path in stem_covered or sid in graph_tested_roots: - continue - untested.append( - { - "qualified_name": str(s.get("qualified_name") or ""), - "path": path, - "start_line": int(s.get("start_line") or 0), - } - ) + row = { + "qualified_name": str(s.get("qualified_name") or ""), + "path": path, + "start_line": int(s.get("start_line") or 0), + } + run = inp.measured.get(sid) + if run is None: + unmeasured += 1 + if sid not in linked: + unlinked.append(row) + elif not run.get("executed"): + untested.append({**row, "commit": str(run.get("commit") or "")}) untested.sort(key=lambda r: (r["path"], r["start_line"])) + unlinked.sort(key=lambda r: (r["path"], r["start_line"])) lim = max(1, int(inp.limit or 30)) return Gate( tests=ordered[:lim], untested=untested[:lim], + unlinked=unlinked[:lim], tests_total=len(ordered), untested_total=len(untested), + unlinked_total=len(unlinked), + unmeasured=unmeasured, ) diff --git a/server/code/store/index/edges.py b/server/code/store/index/edges.py index bd9869728f0..de03b2848dd 100644 --- a/server/code/store/index/edges.py +++ b/server/code/store/index/edges.py @@ -1,6 +1,7 @@ """Reads over loom.code_edges, loom.code_call_sites_unresolved and loom.code_caller_guards: call edges in both directions, declined call -sites, caller guards, caller counts and include edges. +sites, caller guards, caller counts, the test files calling a set of +definitions and include edges. """ from __future__ import annotations @@ -621,6 +622,43 @@ async def caller_counts( for r in rows } + async def test_files_calling( + self, org: str, ns: str, symbol_ids: list[str], *, limit: int = 30 + ) -> list[dict[str, Any]]: + """Test files with a live `calls` edge into `symbol_ids` (the first 1,000), each + with how many of them it calls (`callees`), most first, then by path. One grouped + read on the edge table's (org, namespace, tier, to_symbol_id) prefix; the test-path + filter runs before the cap, so production callers take none of it.""" + ids = [s for s in dict.fromkeys(symbol_ids) if s][:1000] + if not ids: + return [] + rows: list[dict[str, Any]] = await self._ch.query_all( + """ + SELECT path, uniqExact(to_symbol_id) AS callees + FROM ( + SELECT tier, to_symbol_id, from_symbol_id, path, line, + argMax(tombstoned_at IS NULL, version) AS is_live + FROM loom.code_edges + WHERE org = {org:String} AND namespace = {ns:String} + AND to_symbol_id IN {ids:Array(String)} AND edge_kind = 'calls' + AND match(path, {test_path_pattern:String}) + GROUP BY tier, to_symbol_id, from_symbol_id, path, line + HAVING is_live = 1 + ) + GROUP BY path + ORDER BY callees DESC, path + LIMIT {limit:UInt32} + """, + { + "org": org, + "ns": ns, + "ids": ids, + "test_path_pattern": TEST_PATH_PATTERN, + "limit": int(limit), + }, + ) + return rows + async def include_edges(self, org: str, ns: str) -> list[tuple[str, str]]: """(from_path, include_target) pairs, live, both tiers.""" rows = await self._ch.query_all( diff --git a/server/transport/mcp_descriptions.py b/server/transport/mcp_descriptions.py index 0a3abad2cd0..1d4481852d2 100644 --- a/server/transport/mcp_descriptions.py +++ b/server/transport/mcp_descriptions.py @@ -1338,16 +1338,22 @@ def revision_policy(update: str) -> str: ), "code.test_gate": ( "BEFORE you say done: pass your changed files (and/or the unified " - "diff) and get the two pre-PR obligations in one call — the tests " - "that reach the change, in evidence order (a test you edited, the " - "stem partner of a file you changed, the mined test map, then " - "call-graph hops), each with WHY it is listed and a `run` command " - "when the harness is derivable from the path (never guessed: " - "run_unknown says so) — and `untested`: the touched functions no " - "test reaches at all. `obligations` is true while either list is " - "non-empty: run the tests, then rely on green; write a test for the " - "untested rows or say why not. Counts are floors (the graph misses " - "dynamic dispatch), so an empty list means none the index can see." + "diff against the indexed revision) and get the pre-PR obligations " + "in one call — the tests to run, in evidence order, each with WHY it " + "is listed (`changed_test`: a test you edited; `coverage`: a " + "coverage run measured it executing a touched definition; " + "`static_call`: a call chain links it to one, named in `links_to`; " + "`file_neighbor`: it calls other definitions of the edited files; " + "`test_map`: mined history about the file) and a `run` command when " + "the harness is derivable from the path (never guessed: run_unknown " + "says so) — `untested`: the touched definitions a coverage run " + "measured unexecuted, and `unlinked`: the ones no coverage run " + "measured and no call chain links a test to. `obligations` is true " + "while `tests` or `untested` is non-empty: run the tests, then rely " + "on green; write a test for the untested rows or say why not. " + "`unlinked` is not proof that no test runs a definition (tests reach " + "code through fixtures and entry points the graph has no edge for): " + "read it as 'the index cannot say'." ), "code.trace": ( "Paste a stack trace / fatal-log backtrace / sanitizer report and " diff --git a/tests/analyzer/cases/code.py b/tests/analyzer/cases/code.py index 25c3c9fa7a5..71ad7df865b 100644 --- a/tests/analyzer/cases/code.py +++ b/tests/analyzer/cases/code.py @@ -387,6 +387,8 @@ async def _point_readers(ch: RecordingCH, c: dict[str, Any]) -> None: ["getSubcolumnNameForStream(subpath,"], ) await repo.caller_counts(ORG, NS, ["s1", "s2"]) + # code.test_gate's file neighbours: the test files calling a file's other definitions + await repo.test_files_calling(ORG, NS, ["s1", "s2"], limit=30) await repo.coverage_gaps(ORG, NS) await repo.coverage(ORG, NS) await repo.index_errors(ORG, NS, limit=10) diff --git a/tests/analyzer/shapes.txt b/tests/analyzer/shapes.txt index c1f304c6016..8ed32c818bf 100644 --- a/tests/analyzer/shapes.txt +++ b/tests/analyzer/shapes.txt @@ -1064,6 +1064,7 @@ 7ba38135d909 WITH (SELECT toFloat64(count()) FROM loom.memory_embeddings FINAL WHERE org = {org:String} AND namespace = {ns:String} AND tombstoned_at IS NULL) AS n_keys, (SELECT mapFromArrays(groupArray(s), groupA 7baded054596 SELECT count() AS n FROM loom.knowledge_ingestions WHERE org = {org:String} AND namespace = {ns:String} AND ? 7bb1d4059098 SELECT (SELECT count() FROM ( SELECT e.org AS org, e.namespace AS namespace, e.memory_key AS memory_key FROM ( SELECT org, namespace, agent, user_id, memory_key FROM loom.entity_vectors FINAL WHERE to +7bb3901d8e50 SELECT path, uniqExact(to_symbol_id) AS callees FROM ( SELECT tier, to_symbol_id, from_symbol_id, path, line, argMax(tombstoned_at IS NULL, version) AS is_live FROM loom.code_edges WHERE org = {org:St 7bb9d891b190 SELECT thread_id, msg_id, role, content_excerpt AS embedded_text, ts, cosineDistance(embedding, {q:Array(Float32)}) AS distance FROM loom.conversation_embeddings FINAL WHERE org = {org:String} AND nam 7bcba9ce8741 SELECT state_value FROM loom.code_index_state FINAL WHERE org = {org:String} AND namespace = {ns:String} AND state_key = ? LIMIT ? 7c06e9fdda88 ALTER TABLE loom.knowledge_uploads DELETE WHERE (org = {org:String} AND namespace = {ns:String}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? diff --git a/tests/unit/test_code_epistemic_envelope.py b/tests/unit/test_code_epistemic_envelope.py index c1b15bc7ea4..288c6235966 100644 --- a/tests/unit/test_code_epistemic_envelope.py +++ b/tests/unit/test_code_epistemic_envelope.py @@ -179,6 +179,12 @@ async def functions_for_paths(self, org, ns, paths, *, limit=400, **_kw): async def test_map_for(self, org, ns, paths, *, limit=30): return [] + async def test_files_calling(self, org, ns, ids, *, limit=30): + return [] + + async def coverage_files_for(self, org, ns, paths): + return {} + async def pr_history_for(self, org, ns, *, paths, limit): return [] @@ -426,7 +432,9 @@ async def test_test_gate_carries_envelope(intel) -> None: out = await gate.handle_code_test_gate( CodeTestGateInput(org="o", namespace="n", files=["src/A.cpp"]) ) - assert out.epistemic == "lower_bound" and out.causes == ["unresolved_calls"] + # the graph's own cause, then the gate's: no coverage run measured the touched function + assert out.epistemic == "lower_bound" + assert out.causes == ["unresolved_calls", "no_coverage"] assert out.by_hop_counts == {1: 2, 2: 3} diff --git a/tests/unit/test_code_impact_dispatch.py b/tests/unit/test_code_impact_dispatch.py index cc0424ee38d..88ffcbeb293 100644 --- a/tests/unit/test_code_impact_dispatch.py +++ b/tests/unit/test_code_impact_dispatch.py @@ -308,7 +308,7 @@ def test_partial_relationship_languages() -> None: assert not dispatch._partial_relationships("") -def test_touched_rows_fold_a_definitions_tier_ids_and_rank_header_first() -> None: +def test_touched_rows_fold_a_definitions_tier_ids_and_rank_changed_lines_first() -> None: def row(sid: str, name: str, path: str, start: int, end: int, tier: str) -> dict: return { "symbol_id": sid, @@ -323,16 +323,23 @@ def row(sid: str, name: str, path: str, start: int, end: int, tier: str) -> dict row("ts_f", "DB::f", "src/a.cpp", 10, 20, "treesitter"), # same definition, parser tier row("sc_f", "DB::f", "src/a.cpp", 10, 10, "scip"), row("sc_g", "DB::g", "src/a.cpp", 30, 40, "scip"), # a hunk inside g - row("sc_h", "DB::h", "src/a.cpp", 90, 99, "scip"), # untouched + row("sc_h", "DB::h", "src/a.cpp", 90, 90, "scip"), # one line: only a header can name it + row("sc_i", "DB::i", "src/a.cpp", 50, 60, "scip"), # only headers name it row("sc_k", "DB::k", "src/b.cpp", 1, 5, "scip"), # files-only: every function ] - touched, seed_ids = diff._touched_rows_for_diff( - rows, {"src/a.cpp": [(35, 36)]}, {"src/a.cpp": {"f"}} - ) + hunks = [ + diff.Hunk("i", ((35, 36),), ()), # its lines sit in g, whatever the header says + diff.Hunk("", ((15, 15),), ()), # inside f's parser span + diff.Hunk("h", ((95, 95),), ()), # in no definition; h has no body extent + diff.Hunk("i", ((70, 70),), ()), # in no definition; i's body ends above it + ] + touched, seed_ids, unmapped = diff._touched_rows_for_diff(rows, {"src/a.cpp": hunks}) assert [(r["symbol_id"], r["via"]) for r in touched] == [ - ("sc_f", "header"), + ("sc_f", "hunk"), ("sc_g", "hunk"), + ("sc_h", "header"), ("sc_k", "file"), ] assert touched[0]["tier_ids"] == ["sc_f", "ts_f"] - assert seed_ids == ["sc_f", "ts_f", "sc_g", "sc_k"] + assert seed_ids == ["sc_f", "ts_f", "sc_g", "sc_h", "sc_k"] + assert unmapped == 1 diff --git a/tests/unit/test_code_test_gate.py b/tests/unit/test_code_test_gate.py index 68d99afd890..ecdeb2595cb 100644 --- a/tests/unit/test_code_test_gate.py +++ b/tests/unit/test_code_test_gate.py @@ -34,15 +34,6 @@ def test_is_test_path(path, expected) -> None: assert tg.is_test_path(path) is expected -def test_stem_partners_follow_the_worker_rule() -> None: - srcs = ["src/Storages/MergeTree/MergeTreeData.cpp", "src/IO/io.cpp", "server/foo.py"] - assert tg.stem_partners("src/Storages/MergeTree/tests/gtest_merge_tree_data.cpp", srcs) == [] - assert tg.stem_partners("src/Storages/tests/gtest_mergetreedata.cpp", srcs) == [srcs[0]] - assert tg.stem_partners("tests/unit/test_foo.py", srcs) == ["server/foo.py"] - # short stems never match: "io" is inside everything - assert tg.stem_partners("tests/unit/test_io.py", srcs) == [] - - @pytest.mark.parametrize( "path, run, unknown", [ @@ -89,18 +80,17 @@ def _touched(sid: str, path: str, name: str = "f") -> dict[str, Any]: return {"symbol_id": sid, "qualified_name": name, "path": path, "start_line": 1} +def _node(name: str, path: str, hop: int, roots: list[str], **extra: Any) -> dict[str, Any]: + return {"qualified_name": name, "path": path, "hop": hop, "roots": roots, **extra} + + def test_build_gate_orders_by_evidence_and_dedupes() -> None: inp = tg.GateInputs( changed_paths=["src/alpha.py", "tests/unit/test_zeta.py", "src/b.py"], touched=[_touched("s1", "src/alpha.py", "alpha"), _touched("s2", "src/b.py", "b")], impacted={ - "t1": { - "qualified_name": "test_b_hop", - "path": "tests/unit/test_hop.py", - "hop": 2, - "roots": ["s2"], - }, - "c1": {"qualified_name": "caller", "path": "src/c.py", "hop": 1, "roots": ["s1"]}, + "t1": _node("test_b_hop", "tests/unit/test_hop.py", 2, ["s2"]), + "c1": _node("caller", "src/c.py", 1, ["s1"]), }, test_map=[ {"test_path": "tests/unit/test_hop.py", "src_path": "src/b.py", "confidence": 0.4}, @@ -111,55 +101,110 @@ def test_build_gate_orders_by_evidence_and_dedupes() -> None: }, {"test_path": "tests/unit/test_zeta.py", "src_path": "src/alpha.py", "confidence": 0.9}, ], + neighbors=[ + {"path": "tests/unit/test_near.py", "callees": 3}, + {"path": "tests/unit/test_hop.py", "callees": 9}, + ], + measured={"s1": {"executed": True, "commit": "c1"}}, + coverage=[{"test_path": "tests/unit/test_ran.py", "roots": ["s1"]}], ) g = tg.build_gate(inp) - assert [r["why"] for r in g.tests] == ["changed_test", "stem_partner", "test_map"] - assert [r["test_path"] for r in g.tests] == [ - "tests/unit/test_zeta.py", - "tests/unit/test_alpha.py", - "tests/unit/test_hop.py", + assert [(r["test_path"], r["why"]) for r in g.tests] == [ + ("tests/unit/test_zeta.py", "changed_test"), + ("tests/unit/test_ran.py", "coverage"), + ("tests/unit/test_hop.py", "static_call"), + ("tests/unit/test_near.py", "file_neighbor"), + ("tests/unit/test_alpha.py", "test_map"), ] - # The changed test keeps its first (strongest) evidence even though the - # test map also names it; the graph-hop test was already listed via the map. + # A test file keeps its first (strongest) evidence: the changed test is also in the + # map, and the call chain's test is also a neighbour and in the map. assert g.tests[0]["evidence"] == "in the diff" - assert g.tests[1]["src_path"] == "src/alpha.py" - assert ( - g.tests[2]["run"] == "pytest tests/unit/test_hop.py" and g.tests[2]["run_unknown"] is False - ) - assert g.tests_total == 3 and g.untested == [] and g.untested_total == 0 + assert g.tests[1]["links_to"] == ["alpha"] + hop = g.tests[2] + assert hop["hop"] == 2 and hop["evidence"] == "test_b_hop reaches the change in 2 hop(s)" + assert hop["links_to"] == ["b"] and hop["callers"] == 1 and hop["confidence"] == 0.8 + assert hop["run"] == "pytest tests/unit/test_hop.py" and hop["run_unknown"] is False + assert g.tests[3]["callees"] == 3 and g.tests[4]["src_path"] == "src/alpha.py" + assert g.tests_total == 5 and g.untested == [] and g.unlinked == [] assert g.obligations is True -def test_untested_complement_by_map_stem_and_graph() -> None: +def test_static_rows_put_the_file_with_more_links_and_more_tests_first() -> None: + """Within a hop, the file whose tests link to more of the touched definitions is first, + then the one with more tests doing so: a module's own test file before a bystander.""" + inp = tg.GateInputs( + changed_paths=["src/a.py"], + touched=[_touched("s1", "src/a.py", "m::A::__init__"), _touched("s2", "src/a.py", "m::f")], + impacted={ + "a1": _node("tests.test_a::test_one", "tests/test_a.py", 1, ["s1"], via="constructor"), + "a2": _node("tests.test_a::test_two", "tests/test_a.py", 1, ["s1"]), + "b1": _node("tests.test_b::test_b", "tests/test_b.py", 1, ["s1", "s2"]), + "0": _node("tests.aaa::test_one_call", "tests/aaa.py", 1, ["s1"]), + "far": _node("tests.test_far::test_far", "tests/test_far.py", 2, ["s1", "s2"]), + }, + test_map=[], + ) + g = tg.build_gate(inp) + assert [r["test_path"] for r in g.tests] == [ + "tests/test_b.py", # links to both touched definitions + "tests/test_a.py", # two tests link to one + "tests/aaa.py", # one test links to one + "tests/test_far.py", # a hop further, whatever it links to + ] + by_path = {r["test_path"]: r for r in g.tests} + assert by_path["tests/test_b.py"]["links_to"] == ["m::A::__init__", "m::f"] + assert by_path["tests/test_a.py"]["callers"] == 2 + assert by_path["tests/test_a.py"]["via"] == "constructor" + assert by_path["tests/test_a.py"]["confidence"] == 0.9 + assert "via" not in by_path["tests/test_b.py"] + + +def test_untested_needs_a_measurement_and_unlinked_needs_no_link() -> None: inp = tg.GateInputs( - changed_paths=["src/a.py", "src/b.py", "src/c.py", "src/d.py"], + changed_paths=["src/a.py", "src/b.py", "src/c.py", "src/d.py", "src/e.py"], touched=[ _touched("s1", "src/a.py", "a"), _touched("s2", "src/b.py", "b"), _touched("s3", "src/c.py", "c"), _touched("s4", "src/d.py", "d"), + _touched("s5", "src/e.py", "e"), ], impacted={ - # a test reaches s3 through the graph in two hops - "t": { - "qualified_name": "test_c", - "path": "tests/x/test_other.py", - "hop": 2, - "roots": ["s3"], - }, + # a test reaches s3 through the graph in two hops, and s5 in one + "t": _node("test_c", "tests/x/test_other.py", 2, ["s3", "s5"]), }, test_map=[ {"test_path": "tests/unit/test_a.py", "src_path": "src/a.py", "confidence": 0.7}, - {"test_path": "tests/unit/test_bee.py", "src_path": "src/zzz.py", "confidence": 0.5}, ], + neighbors=[{"path": "tests/unit/test_b_neighbor.py", "callees": 4}], + measured={ + "s4": {"executed": True, "commit": "abc"}, + "s5": {"executed": False, "commit": "abc"}, + }, ) g = tg.build_gate(inp) - # s1 via the map, s3 via the graph; s2 and s4 reach no test at all. - assert [u["path"] for u in g.untested] == ["src/b.py", "src/d.py"] - assert g.untested_total == 2 - assert {r["why"] for r in g.tests} == {"test_map", "graph_hop"} - hop = next(r for r in g.tests if r["why"] == "graph_hop") - assert hop["hop"] == 2 and "test_c reaches the change in 2 hop(s)" == hop["evidence"] + # s1 has only a test-map row and s2 only a file neighbour: both are about the file. + # s3 is linked by a call chain. s4 was measured executed. s5 was measured unexecuted, + # whatever the graph says. + assert [u["qualified_name"] for u in g.unlinked] == ["a", "b"] + assert g.untested == [ + {"qualified_name": "e", "path": "src/e.py", "start_line": 1, "commit": "abc"} + ] + assert (g.unlinked_total, g.untested_total, g.unmeasured) == (2, 1, 3) + assert {r["why"] for r in g.tests} == {"static_call", "file_neighbor", "test_map"} + + +def test_unlinked_alone_is_no_obligation() -> None: + g = tg.build_gate( + tg.GateInputs( + changed_paths=["src/a.py"], + touched=[_touched("s1", "src/a.py", "a")], + impacted={}, + test_map=[], + ) + ) + assert [u["qualified_name"] for u in g.unlinked] == ["a"] + assert g.tests == [] and g.untested == [] and g.obligations is False def test_gate_caps_and_reports_totals() -> None: @@ -171,27 +216,34 @@ def test_gate_caps_and_reports_totals() -> None: {"test_path": f"tests/unit/test_{i}.py", "src_path": "src/a.py", "confidence": 0.5} for i in range(4) ], - limit=2, + measured={ + "s0": {"executed": False, "commit": "c"}, + "s1": {"executed": False, "commit": "c"}, + }, + limit=1, ) g = tg.build_gate(inp) - assert len(g.tests) == 2 and g.tests_total == 4 - assert len(g.untested) == 2 and g.untested_total == 5 + assert len(g.tests) == 1 and g.tests_total == 4 + assert len(g.untested) == 1 and g.untested_total == 2 + assert len(g.unlinked) == 1 and g.unlinked_total == 3 def test_no_change_no_obligations() -> None: g = tg.build_gate(tg.GateInputs(changed_paths=[], touched=[], impacted={}, test_map=[])) - assert g.obligations is False and g.tests == [] and g.untested == [] + assert g.obligations is False and g.tests == [] and g.untested == [] and g.unlinked == [] # ---- handler over a fake repo ---------------------------------------------------- -def _sym(sid: str, name: str, path: str, start: int, end: int) -> dict[str, Any]: +def _sym( + sid: str, name: str, path: str, start: int, end: int, kind: str = "function" +) -> dict[str, Any]: return { "symbol_id": sid, "qualified_name": name, "name": name.split("::")[-1], - "kind": "function", + "kind": kind, "path": path, "start_line": start, "end_line": end, @@ -201,7 +253,7 @@ def _sym(sid: str, name: str, path: str, start: int, end: int) -> dict[str, Any] } -def _edge(frm: str, to: str, fq: str, path: str) -> dict[str, Any]: +def _edge(frm: str, to: str, fq: str, path: str, kind: str = "calls") -> dict[str, Any]: return { "from_symbol_id": frm, "to_symbol_id": to, @@ -210,7 +262,7 @@ def _edge(frm: str, to: str, fq: str, path: str) -> dict[str, Any]: "path": path, "line": 5, "tier": "scip", - "edge_kind": "calls", + "edge_kind": kind, "confidence": 1.0, } @@ -225,9 +277,16 @@ def __init__(self) -> None: "sA": [_edge("sX", "sA", "DB::X::x", "src/X.cpp")], "sX": [_edge("tT", "sX", "TEST_F(Parts, x)", "src/tests/gtest_parts.cpp")], } + self.neighbors: list[dict[str, Any]] = [] + self.neighbor_ids: list[str] = [] + self.coverage_files: dict[str, dict[str, Any]] = {} + self.coverage_rows: list[dict[str, Any]] = [] + self.kinds: tuple[str, ...] = () - async def functions_for_paths(self, org, ns, paths, *, limit=400, **_kw): - return [s for s in self.symbols if s["path"] in paths] + async def functions_for_paths(self, org, ns, paths, *, kinds=(), with_revision=False, **_kw): + self.kinds = self.kinds or tuple(kinds) + rows = [s for s in self.symbols if s["path"] in paths and s["kind"] in kinds] + return [{**s, "extent_commit": "c" * 40} for s in rows] if with_revision else rows async def edges_for_symbols( self, org, ns, ids, *, direction, edge_kinds=None, limit=200, min_confidence=0.0 @@ -235,6 +294,10 @@ async def edges_for_symbols( assert direction == "callers" return [e for sid in ids for e in self.callers.get(sid, [])] + async def test_files_calling(self, org, ns, ids, *, limit=30): + self.neighbor_ids = list(ids) + return self.neighbors[:limit] + async def test_map_for(self, org, ns, paths, *, limit=30): return [ { @@ -244,6 +307,18 @@ async def test_map_for(self, org, ns, paths, *, limit=30): } ] + async def coverage_files_for(self, org, ns, paths): + return {p: f for p, f in self.coverage_files.items() if p in paths} + + async def coverage_rows_for(self, org, ns, paths, *, limit=2000): + return [r for r in self.coverage_rows if r["src_path"] in paths] + + async def get_state(self, org, ns, key): + return "c" * 40 + + async def file_rows_for_paths(self, org, ns, paths): + return {p: {"indexed_commit": "c" * 40} for p in paths} + @pytest.fixture def intel(monkeypatch: pytest.MonkeyPatch): @@ -264,45 +339,51 @@ def intel(monkeypatch: pytest.MonkeyPatch): """ -async def test_handler_diff_shape_walks_roots_to_tests(intel) -> None: +async def _gate(intel, repo: _Repo, **kw: Any): from server.code.api.models_testing import CodeTestGateInput - with patch.object(intel, "CodeRepo", return_value=_Repo()): - out = await intel.handle_code_test_gate( - CodeTestGateInput(org="o", namespace="n", diff=_DIFF, depth=2) - ) + with patch.object(intel, "CodeRepo", return_value=repo): + return await intel.handle_code_test_gate(CodeTestGateInput(org="o", namespace="n", **kw)) + + +async def test_handler_diff_shape_walks_roots_to_tests(intel) -> None: + repo = _Repo() + repo.neighbors = [{"path": "src/tests/gtest_g.cpp", "callees": 1}] + out = await _gate(intel, repo, diff=_DIFF, depth=2) assert out.changed_files == ["src/A.cpp"] - # hunk overlap picks f (lines 10-20), not g (40-60) + # the added line sits in f (lines 10-20), not in g (40-60) assert [t["qualified_name"] for t in out.touched_symbols] == ["DB::A::f"] assert "symbol_id" not in out.touched_symbols[0] - whys = [t["why"] for t in out.tests] - assert whys == ["test_map", "graph_hop"] - assert out.tests[0]["run"] == "tests/clickhouse-test 01234_a" - assert out.tests[1]["test_path"] == "src/tests/gtest_parts.cpp" - assert out.tests[1]["hop"] == 2 and out.tests[1]["run_unknown"] is True - # f is covered (map + graph) so nothing is untested; obligations still hold - assert out.untested == [] and out.obligations is True - assert out.tests_total == 2 and out.counts_floor is True - - -async def test_handler_files_shape_and_untested(intel) -> None: - from server.code.api.models_testing import CodeTestGateInput - + assert repo.kinds == ("function", "method", "fixture", "class") + # the neighbours are asked for the file's other definitions only + assert repo.neighbor_ids == ["sB"] + assert [t["why"] for t in out.tests] == ["static_call", "file_neighbor", "test_map"] + assert out.tests[0]["test_path"] == "src/tests/gtest_parts.cpp" + assert out.tests[0]["hop"] == 2 and out.tests[0]["run_unknown"] is True + assert out.tests[0]["links_to"] == ["DB::A::f"] + assert out.tests[2]["run"] == "tests/clickhouse-test 01234_a" + # a call chain links a test to f; nothing was measured + assert out.untested == [] and out.unlinked == [] and out.obligations is True + assert out.tests_total == 3 and out.counts_floor is True + assert out.epistemic == "lower_bound" and "no_coverage" in out.causes + + +async def test_handler_files_shape_lists_unlinked_functions(intel) -> None: repo = _Repo() + repo.symbols.append(_sym("cA", "DB::A", "src/A.cpp", 5, 70, kind="class")) repo.callers = {} # no graph at all async def no_tests(org, ns, paths, *, limit=30): return [] repo.test_map_for = no_tests # type: ignore[method-assign] - with patch.object(intel, "CodeRepo", return_value=repo): - out = await intel.handle_code_test_gate( - CodeTestGateInput(org="o", namespace="n", files=["src/A.cpp"], depth=1) - ) + out = await _gate(intel, repo, files=["src/A.cpp"], depth=1) + # a file given without hunks touches every function in it, and no class assert [t["qualified_name"] for t in out.touched_symbols] == ["DB::A::f", "DB::A::g"] - assert out.tests == [] - assert [u["qualified_name"] for u in out.untested] == ["DB::A::f", "DB::A::g"] - assert out.obligations is True and out.untested_total == 2 + assert out.tests == [] and out.untested == [] + assert [u["qualified_name"] for u in out.unlinked] == ["DB::A::f", "DB::A::g"] + # the index cannot say, so nothing is asked for + assert out.obligations is False and out.unlinked_total == 2 async def test_handler_requires_a_change(intel) -> None: @@ -316,8 +397,6 @@ async def test_handler_requires_a_change(intel) -> None: async def test_a_test_only_the_parser_saw_credits_the_collapsed_definition(intel) -> None: """A definition both tiers hold arrives as its scip row carrying both ids (`tier_ids`); a test that calls it only through the parser-tier id still covers it.""" - from server.code.api.models_testing import CodeTestGateInput - repo = _Repo() repo.symbols = [{**_sym("sA", "DB::A::f", "src/A.cpp", 10, 20), "tier_ids": ["sA", "pA"]}] repo.callers = {"pA": [_edge("tT", "pA", "TEST_F(Parts, f)", "src/tests/gtest_parts.cpp")]} @@ -326,9 +405,125 @@ async def no_tests(org, ns, paths, *, limit=30): return [] repo.test_map_for = no_tests # type: ignore[method-assign] - with patch.object(intel, "CodeRepo", return_value=repo): - out = await intel.handle_code_test_gate( - CodeTestGateInput(org="o", namespace="n", diff=_DIFF, depth=1) - ) + out = await _gate(intel, repo, diff=_DIFF, depth=1) assert [t["test_path"] for t in out.tests] == ["src/tests/gtest_parts.cpp"] + assert out.unlinked == [] + + +def _py_repo() -> _Repo: + repo = _Repo() + repo.symbols = [ + _sym("cW", "pkg.w::Widget", "pkg/w.py", 10, 40, kind="class"), + _sym("mI", "pkg.w::Widget::__init__", "pkg/w.py", 14, 20), + _sym("mR", "pkg.w::Widget::render", "pkg/w.py", 22, 40), + _sym("fH", "pkg.w::helper", "pkg/w.py", 44, 50), + ] + repo.callers = { + "cW": [_edge("t1", "cW", "tests.test_w::test_builds", "tests/test_w.py")], + "fH": [_edge("t2", "fH", "tests.test_w::test_helper", "tests/test_w.py")], + } + + async def no_tests(org, ns, paths, *, limit=30): + return [] + + repo.test_map_for = no_tests # type: ignore[method-assign] + return repo + + +def _one_line(path: str, line: int) -> str: + return f"--- a/{path}\n+++ b/{path}\n@@ -{line} +{line} @@\n-old\n+new\n" + + +async def test_a_test_that_builds_the_object_links_to_its_constructor(intel) -> None: + out = await _gate(intel, _py_repo(), diff=_one_line("pkg/w.py", 16)) + assert [t["qualified_name"] for t in out.touched_symbols] == ["pkg.w::Widget::__init__"] + assert out.unlinked == [] + row = out.tests[0] + assert (row["why"], row["via"], row["hop"]) == ("static_call", "constructor", 1) + assert row["links_to"] == ["pkg.w::Widget::__init__"] + assert row["evidence"] == "tests.test_w::test_builds reaches the change in 1 hop(s)" + + +async def test_a_nested_function_is_reached_through_the_function_it_is_defined_in(intel) -> None: + """A closure has no caller of its own in a call graph: the tests that call the function + it is defined in are its tests, and that function is not touched.""" + repo = _py_repo() + repo.symbols.append(_sym("fN", "pkg.w::helper::inner", "pkg/w.py", 46, 48)) + out = await _gate(intel, repo, diff=_one_line("pkg/w.py", 47)) + assert [t["qualified_name"] for t in out.touched_symbols] == ["pkg.w::helper::inner"] + row = out.tests[0] + assert (row["why"], row["via"], row["hop"]) == ("static_call", "enclosing", 1) + assert row["links_to"] == ["pkg.w::helper::inner"] and out.unlinked == [] + + +async def test_a_line_of_a_class_body_touches_the_class_and_not_its_methods(intel) -> None: + out = await _gate(intel, _py_repo(), diff=_one_line("pkg/w.py", 12)) + assert [t["qualified_name"] for t in out.touched_symbols] == ["pkg.w::Widget"] + assert out.tests[0]["links_to"] == ["pkg.w::Widget"] and "via" not in out.tests[0] + assert out.unlinked == [] + + +async def test_a_method_edit_touches_the_method_only_and_a_neighbour_does_not_link_it( + intel, +) -> None: + repo = _py_repo() + repo.neighbors = [{"path": "tests/test_w.py", "callees": 2}] + out = await _gate(intel, repo, diff=_one_line("pkg/w.py", 30)) + assert [t["qualified_name"] for t in out.touched_symbols] == ["pkg.w::Widget::render"] + assert [(t["test_path"], t["why"]) for t in out.tests] == [("tests/test_w.py", "file_neighbor")] + # the file's test is named, and the method is still one the index links no test to + assert [u["qualified_name"] for u in out.unlinked] == ["pkg.w::Widget::render"] + assert out.obligations is True and out.untested == [] + + +async def test_a_module_level_line_touches_nothing_and_says_so(intel) -> None: + repo = _py_repo() + repo.neighbors = [{"path": "tests/test_w.py", "callees": 3}] + out = await _gate(intel, repo, diff=_one_line("pkg/w.py", 42)) + assert out.touched_symbols == [] and out.unlinked == [] + assert "unmapped_changes" in out.causes and out.epistemic == "lower_bound" + # the file's tests are still the nearest lead + assert [t["why"] for t in out.tests] == ["file_neighbor"] + assert sorted(repo.neighbor_ids) == ["cW", "fH", "mI", "mR"] + + +async def test_a_coverage_run_decides_untested_and_makes_the_answer_measured(intel) -> None: + repo = _py_repo() + repo.coverage_files = { + "pkg/w.py": {"commit_sha": "c" * 40, "lines": "[[14, 20], [44, 50]]", "tests": 2} + } + repo.coverage_rows = [ + { + "src_path": "pkg/w.py", + "test_path": "tests/test_w.py", + "confidence": 0.9, + "evidence": '{"commit": "%s", "lines": [[44, 50]]}' % ("c" * 40), + } + ] + diff = _one_line("pkg/w.py", 30) + "@@ -46 +46 @@\n-old\n+new\n" + out = await _gate(intel, repo, diff=diff) + assert [t["qualified_name"] for t in out.touched_symbols] == [ + "pkg.w::Widget::render", + "pkg.w::helper", + ] + # render (22-40) was measured and no test executed it; helper was executed + assert out.untested == [ + { + "qualified_name": "pkg.w::Widget::render", + "path": "pkg/w.py", + "start_line": 22, + "commit": "c" * 40, + } + ] + assert out.unlinked == [] and out.obligations is True + assert (out.epistemic, out.causes) == ("measured", []) + assert out.tests[0]["why"] == "coverage" and out.tests[0]["links_to"] == ["pkg.w::helper"] + + +async def test_a_coverage_run_of_another_revision_measures_nothing(intel) -> None: + repo = _py_repo() + repo.coverage_files = {"pkg/w.py": {"commit_sha": "d" * 40, "lines": "[]", "tests": 2}} + out = await _gate(intel, repo, diff=_one_line("pkg/w.py", 30)) assert out.untested == [] + assert [u["qualified_name"] for u in out.unlinked] == ["pkg.w::Widget::render"] + assert out.epistemic == "lower_bound" and "no_coverage" in out.causes diff --git a/tests/unit/test_code_trace_and_diff_impact.py b/tests/unit/test_code_trace_and_diff_impact.py index 0ef16c48ba5..7d0b40ea42e 100644 --- a/tests/unit/test_code_trace_and_diff_impact.py +++ b/tests/unit/test_code_trace_and_diff_impact.py @@ -8,7 +8,7 @@ from __future__ import annotations -from server.code.app.symbol.diff import _parse_unified_diff_full +from server.code.app.symbol.diff import Hunk, _parse_unified_diff_full, _touched_rows_for_diff from server.code.app.symbol.trace import _parse_trace_frames _GDB_TRACE = """ @@ -60,10 +60,119 @@ def test_diff_parse_new_side_ranges() -> None: +++ /dev/null @@ -1,3 +0,0 @@ """ - ranges, _ = _parse_unified_diff_full(diff) + ranges, _, _ = _parse_unified_diff_full(diff) assert ranges["src/A.cpp"] == [(12, 17), (58, 58)] assert "Gone.cpp" not in str(set(ranges) - {"src/A.cpp"}) def test_diff_parse_tolerates_garbage() -> None: assert _parse_unified_diff_full("not a diff\n@@ nonsense @@\n")[0] == {} + + +_CONTEXT_DIFF = """\ +diff --git a/pkg/m.py b/pkg/m.py +--- a/pkg/m.py ++++ b/pkg/m.py +@@ -8,9 +8,10 @@ def before(x): + return x + + + def edited(y): +- a = 1 +- b = 2 ++ a = 2 + return a ++ ++NEW = 1 + + +@@ -40,3 +41,3 @@ def other(z): + def decorated(): +--- a removed line that reads like a file header ++++ and its replacement + pass +""" + + +def test_diff_parse_old_side_changes_skip_context_lines() -> None: + """The index holds the revision a diff starts from, so the changed lines are counted + on the old side: a replaced run is its removed lines, an added run with nothing + removed is an insertion after the old line above it, context lines are neither.""" + _, names, changes = _parse_unified_diff_full(_CONTEXT_DIFF) + first, second = changes["pkg/m.py"] + assert names["pkg/m.py"] == {"before", "other"} + assert first == Hunk("before", ((12, 13),), (14,)) + assert second == Hunk("other", ((41, 41),), ()) + + +def test_a_hunk_sent_without_its_lines_changes_what_its_header_says() -> None: + """The hooks send headers only, from a zero-context diff: `-12,3` replaces lines 12 to + 14 and `-20,0` inserts after line 20, which is what the same hunks say with lines.""" + headers = ( + "+++ b/a.py\n@@ -12,3 +12 @@ f(\n@@ -20,0 +19,2 @@\n--- a/b.py\n+++ b/b.py\n@@ -7 +7 @@\n" + ) + whole = ( + "+++ b/a.py\n@@ -12,3 +12 @@ f(\n-a\n-b\n-c\n+d\n@@ -20,0 +19,2 @@\n+e\n+f\n" + "--- a/b.py\n+++ b/b.py\n@@ -7 +7 @@\n-g\n+h\n" + ) + _, _, sent = _parse_unified_diff_full(headers) + assert sent == { + "a.py": [Hunk("f", ((12, 14),), ()), Hunk("", (), (20,))], + "b.py": [Hunk("", ((7, 7),), ())], + } + assert _parse_unified_diff_full(whole)[2] == sent + + +def _row(sid: str, name: str, start: int, end: int, kind: str = "function") -> dict: + return { + "symbol_id": sid, + "qualified_name": name, + "path": "pkg/m.py", + "start_line": start, + "end_line": end, + "tier": "treesitter", + "kind": kind, + } + + +_ROWS = [ + _row("c", "m::C", 10, 60, "class"), + _row("a", "m::C::as_sql", 12, 20), + _row("b", "m::C::other", 22, 30), + _row("n", "m::C::other::inner", 24, 26), + _row("d", "m::D", 70, 90, "class"), + _row("e", "m::D::as_sql", 72, 80), +] + + +def _touched(*hunks: Hunk) -> tuple[list[str], int]: + rows, _, unmapped = _touched_rows_for_diff(_ROWS, {"pkg/m.py": list(hunks)}) + return [r["qualified_name"] for r in rows], unmapped + + +def test_a_changed_line_touches_the_innermost_definition_only() -> None: + # a header naming `as_sql` selects neither same-named method: the line decides + assert _touched(Hunk("as_sql", ((25, 25),), ())) == (["m::C::other::inner"], 0) + assert _touched(Hunk("as_sql", ((23, 23),), ())) == (["m::C::other"], 0) + # a class attribute between two methods is the class's own line + assert _touched(Hunk("as_sql", ((21, 21),), ())) == (["m::C"], 0) + # a removed range is each of its lines: the method's tail, the class line, the next method + assert _touched(Hunk("", ((19, 22),), ())) == (["m::C", "m::C::as_sql", "m::C::other"], 0) + + +def test_an_insertion_sits_between_two_lines_or_directly_above_a_definition() -> None: + assert _touched(Hunk("", (), (15,))) == (["m::C::as_sql"], 0) + # after a method's last line: between that method and the next, so the class + assert _touched(Hunk("", (), (20,))) == (["m::C"], 0) + # directly above a definition's first line and inside no other: a decorator + assert _touched(Hunk("", (), (69,))) == (["m::D"], 0) + # above a method, the line is the class's: a method added there is not the one below + assert _touched(Hunk("", (), (11,))) == (["m::C"], 0) + + +def test_lines_in_no_definition_are_counted_and_a_header_does_not_claim_them() -> None: + # module level, after C: the header names the function above, whose body ended + assert _touched(Hunk("as_sql", ((64, 65),), (66,))) == ([], 3) + # a header may claim any range: only the lines inside the file's definitions are walked + names, unmapped = _touched(Hunk("", ((1, 10**9),), ())) + assert names == [r["qualified_name"] for r in _ROWS] and unmapped == 10**9 - 72 diff --git a/tests/unit/test_hook_diff_headers.py b/tests/unit/test_hook_diff_headers.py index 7155c4f266a..46e33a7f415 100644 --- a/tests/unit/test_hook_diff_headers.py +++ b/tests/unit/test_hook_diff_headers.py @@ -1,6 +1,7 @@ """The code-plane hooks send `diffHeaders(diff)` in place of the whole diff; the -server must read the same ranges and function names from it as from the whole -diff (`_parse_unified_diff_full`), with no changed line in what is sent.""" +server must read the same ranges, function names and old-side changed lines from it +as from the whole zero-context diff (`_parse_unified_diff_full`), with no changed +line in what is sent.""" from __future__ import annotations @@ -81,7 +82,9 @@ def test_the_server_reads_the_same_ranges_and_names(tmp_path: Path) -> None: diff = _diff() sent = _headers(diff, tmp_path) assert _parse_unified_diff_full(sent) == _parse_unified_diff_full(diff) - ranges, names = _parse_unified_diff_full(sent) + ranges, names, changes = _parse_unified_diff_full(sent) + # the first hunk replaces old line 10, the new file's hunk inserts at its top + assert (changes["src/a.cpp"][0].removed, changes["n.py"][0].inserted) == (((10, 10),), (0,)) assert { "PrivateKey::verify", "Foo::bar", From 7470e07ca69ff60f3d7f9e652a2994379b0d80c9 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Sat, 28 Nov 2026 17:52:48 +0530 Subject: [PATCH 2/6] A hunk shorter than its header counts ends at the next file header A diff whose hunk carries fewer lines than its counts, followed by another file's `---`/`+++` header, read that header as a removed and an added line and lost the file. The header is now recognised when a hunk header follows it, or when the hunk has no line yet. The operations guide lists the evidence kinds instead of adding a table, so the cell positions of the page's other tables stay where its translations expect them. Signed-off-by: Lareb Zafar Co-Authored-By: Claude Fable 5.2 --- docs/features/code-index/operations.md | 18 +++++++++++------- server/code/app/symbol/diff.py | 18 +++++++++++++++--- tests/unit/test_code_impact_dispatch.py | 2 +- tests/unit/test_code_liveness_reads.py | 8 ++++---- tests/unit/test_code_trace_and_diff_impact.py | 9 +++++++++ tests/unit/test_pre_merge_inputs.py | 2 +- 6 files changed, 41 insertions(+), 16 deletions(-) diff --git a/docs/features/code-index/operations.md b/docs/features/code-index/operations.md index e0e8b782f99..1b7f7b4c34d 100644 --- a/docs/features/code-index/operations.md +++ b/docs/features/code-index/operations.md @@ -469,13 +469,17 @@ and adds `unmapped_changes` to `causes`. Each row of `tests` is one test file with the kind of evidence in `why`, strongest first: -| `why` | The test file | Says about a touched definition | -| --------------- | ----------------------------------------------------------------------------- | ------------------------------------------- | -| `changed_test` | is in the diff | nothing; a changed test runs | -| `coverage` | executed it in an imported coverage run the index verified | it ran (`links_to`) | -| `static_call` | holds a test a call chain links to it (`hop`, `callers`, `confidence`, `via`) | a test reaches it (`links_to`) | -| `file_neighbor` | calls `callees` other definitions of the edited files | nothing; it is the nearest test of the file | -| `test_map` | is tied to the file by mined history | nothing | +- `changed_test`: the file is in the diff. It says nothing about a touched definition; a + changed test runs. +- `coverage`: an imported coverage run the index verified measured the file executing a + touched definition, named in `links_to`. +- `static_call`: a call chain links one of the file's tests to a touched definition + (`links_to`), with the nearest `hop`, how many of its tests do (`callers`) and a + `confidence`. +- `file_neighbor`: the file calls `callees` other definitions of the edited files. It is + the nearest test of the file and says nothing about a touched definition. +- `test_map`: mined history ties the file to an edited file, and says nothing about a + touched definition. A `static_call` row carries `via` when the chain does not start at the definition itself: `constructor` (the test calls the class of a touched `__init__` or `__new__`), `enclosing` diff --git a/server/code/app/symbol/diff.py b/server/code/app/symbol/diff.py index 546aaa45efe..2918e7bb38d 100644 --- a/server/code/app/symbol/diff.py +++ b/server/code/app/symbol/diff.py @@ -104,6 +104,20 @@ def _parse_unified_diff_full( return ranges, names, changes +def _file_header_at(lines: list[str], i: int, *, body_seen: bool) -> bool: + """Whether `lines[i]` opens the next file's header where a hunk's counts still expect + lines: the hunk came without its lines, or with fewer than its header counts. A + `--- ` and `+++ ` pair inside a body is a removed and an added line unless a hunk + header (or the end of the diff) follows it.""" + line = lines[i] + after = lines[i + 1 : i + 3] + ["@@", "@@"] # the end of the diff reads as a header + if line.startswith("+++ "): + return not body_seen or after[0].startswith("@@") + if line.startswith("--- ") and after[0].startswith("+++ "): + return not body_seen or after[1].startswith("@@") + return False + + def _hunk_body( lines: list[str], i: int, old_start: int, old_left: int, new_left: int ) -> tuple[list[tuple[int, int]], list[int], int]: @@ -121,9 +135,7 @@ def _hunk_body( if line.startswith("\\"): # "\ No newline at end of file" i += 1 continue - # The next file's header, when the hunk came without its lines. - nxt = lines[i + 1] if i + 1 < len(lines) else "" - if not seen and line.startswith("--- ") and nxt.startswith("+++ "): + if _file_header_at(lines, i, body_seen=seen): break if line.startswith("-") and old_left > 0: if in_run and removed and removed[-1][1] == old - 1: diff --git a/tests/unit/test_code_impact_dispatch.py b/tests/unit/test_code_impact_dispatch.py index 88ffcbeb293..080d830f3d9 100644 --- a/tests/unit/test_code_impact_dispatch.py +++ b/tests/unit/test_code_impact_dispatch.py @@ -54,7 +54,7 @@ def test_hunk_context_name_extraction() -> None: def test_parse_unified_diff_full_ranges_and_names() -> None: - ranges, names = diff._parse_unified_diff_full(DIFF) + ranges, names, _ = diff._parse_unified_diff_full(DIFF) assert ranges["src/Core/BaseSettings.h"] == [(707, 713), (313, 320)] assert names["src/Core/BaseSettings.h"] == {"BaseSettings::write"} assert names["src/Common/maskURIPassword.h"] == {"maskPresignedURLParameters"} diff --git a/tests/unit/test_code_liveness_reads.py b/tests/unit/test_code_liveness_reads.py index dc7b5305337..6b049e8371c 100644 --- a/tests/unit/test_code_liveness_reads.py +++ b/tests/unit/test_code_liveness_reads.py @@ -38,8 +38,8 @@ def test_code_repo_liveness_reads_use_the_null_safe_idiom() -> None: # `live_call_guards_for_paths`, `has_live_scip_override_edges`, `exact_rerank_by_ids` (the shortlist's live # keys, read beside the vectors without FINAL) and `symbol_names_for_paths` # (the idiom in a keyed subquery, `WHERE is_live = 1` outside), - # `live_callers_of_symbols`, `member_edges_at_locations` and `symbols_named` - # (the live keys its per-name bound counts). + # `live_callers_of_symbols`, `member_edges_at_locations`, `symbols_named` + # (the live keys its per-name bound counts) and `test_files_calling`. src = "".join(p.read_text(encoding="utf-8") for p in _CODE_REPO) - assert src.count("argMax(tombstoned_at IS NULL, version) AS is_live") == 22 - assert src.count("HAVING is_live = 1") == 21 + assert src.count("argMax(tombstoned_at IS NULL, version) AS is_live") == 23 + assert src.count("HAVING is_live = 1") == 22 diff --git a/tests/unit/test_code_trace_and_diff_impact.py b/tests/unit/test_code_trace_and_diff_impact.py index 7d0b40ea42e..6d53c591b46 100644 --- a/tests/unit/test_code_trace_and_diff_impact.py +++ b/tests/unit/test_code_trace_and_diff_impact.py @@ -65,6 +65,15 @@ def test_diff_parse_new_side_ranges() -> None: assert "Gone.cpp" not in str(set(ranges) - {"src/A.cpp"}) +def test_a_hunk_shorter_than_its_counts_does_not_swallow_the_next_file() -> None: + """A hunk with fewer lines than its header counts ends at the next file's header.""" + one = "--- a/{p}\n+++ b/{p}\n@@ -{n},2 +{n},3 @@ f()\n+x\n" + diff = one.format(p="src/A.cpp", n=12) + one.format(p="tests/t.sql", n=1) + "+++ b/src/B.cpp\n" + ranges, _, changes = _parse_unified_diff_full(diff) + assert list(ranges) == ["src/A.cpp", "tests/t.sql", "src/B.cpp"] + assert changes["src/A.cpp"] == [Hunk("f", (), (11,))] and changes["src/B.cpp"] == [] + + def test_diff_parse_tolerates_garbage() -> None: assert _parse_unified_diff_full("not a diff\n@@ nonsense @@\n")[0] == {} diff --git a/tests/unit/test_pre_merge_inputs.py b/tests/unit/test_pre_merge_inputs.py index 44ba04c78f0..a476582cf0b 100644 --- a/tests/unit/test_pre_merge_inputs.py +++ b/tests/unit/test_pre_merge_inputs.py @@ -370,7 +370,7 @@ async def test_impact_with_pr_number_seeds_added_functions_and_counts_pr_call_si data = out.model_dump(mode="json") # the PR's range is the diff: old() is touched by hunk, fresh() is an added seed touched = {t["qualified_name"]: t for t in data["touched_symbols"]} - assert touched["DB::A::old"]["via"] == "header" # git's hunk header names it + assert touched["DB::A::old"]["via"] == "hunk" # the added lines sit inside it assert touched["DB::A::fresh"] == { "qualified_name": "DB::A::fresh", "path": "src/A.cpp", From 22c66b4cfbd77af9251b81752bbb5b47ee3a1c22 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Sat, 28 Nov 2026 21:00:13 +0530 Subject: [PATCH 3/6] File neighbours fill a short test-gate list, and a coverage run is read against a definition's body The gate listed up to `limit` file neighbours ahead of the test map, so thirty neighbour files pushed every map row off a default page, and a plugin of the previous release took each of them for a test to run. Neighbours say nothing about a touched definition: the server lists them only while the other kinds leave fewer than four rows. `stem_partner` is a kind again, and a test file a call chain links keeps that row ahead of a file-level map row, because a test file is listed once and the call-chain row names the test and the definition. On an index with an imported coverage run, rows in a covering test's file are 97% for `coverage`, 91% for `static_call`, 53% for `stem_partner` and 31% for `test_map`. A coverage run is read against every tier row's extent of a definition that is wider than one line. A compiler row may be the declaration line only; testing that line marked a function whose body ran as unexecuted under `epistemic: measured`. A definition with no wider extent is not measured. Text added directly above a definition touches it only when the added lines are all decorators, which needs the diff's lines; a new function added there is a change no definition answers for. In Python, lines appended as deep as the line above continue the definition that line ends. A file's removed ranges are merged before one walk, so the cost of a headers-only diff follows the file's extent and not what its hunk headers claim. `measured` also needs every changed source file to touch a definition, and `causes` keeps the call graph's causes under either answer. The hop-only `confidence` of a `static_call` row is gone: it came from two repositories and ignored the edge's own tier. A neighbour's `callees` counts a definition both tiers hold once. Co-Authored-By: Claude Fable 5.2 Signed-off-by: Lareb Zafar --- docs/features/code-index/operations.md | 42 +++- docs/reference/operations/code.md | 6 +- integrations/claude-code-plugin/README.md | 6 +- .../claude-code-plugin/hooks/HOOKS.md | 12 +- .../claude-code-plugin/lib/test-gate.mjs | 32 +-- .../skills/loom-code/reference.md | 2 +- .../tests/test-gate.test.mjs | 34 --- integrations/codex-plugin/lib/test-gate.mjs | 32 +-- .../skills/loom-code/reference.md | 2 +- server/code/api/models_testing.py | 56 +++-- server/code/app/coverage_freshness.py | 40 ++- server/code/app/symbol/diff.py | 234 +++++++++++++----- server/code/app/symbol/gate.py | 22 +- server/code/app/symbol/test_links.py | 29 ++- server/code/domain/index/epistemic.py | 5 +- server/code/domain/index/test_gate.py | 112 ++++++--- server/code/store/index/edges.py | 18 +- server/transport/mcp_descriptions.py | 25 +- tests/analyzer/cases/code.py | 2 +- tests/analyzer/shapes.txt | 2 +- tests/unit/test_code_epistemic_envelope.py | 2 +- tests/unit/test_code_test_gate.py | 149 ++++++++++- tests/unit/test_code_trace_and_diff_impact.py | 88 ++++++- tests/unit/test_hook_diff_headers.py | 3 +- 24 files changed, 653 insertions(+), 302 deletions(-) diff --git a/docs/features/code-index/operations.md b/docs/features/code-index/operations.md index 1b7f7b4c34d..3173f42910f 100644 --- a/docs/features/code-index/operations.md +++ b/docs/features/code-index/operations.md @@ -464,8 +464,14 @@ where to investigate; it does not establish that an API remains compatible. `code.test_gate` takes `files` and/or a `diff` against the revision the index holds: the working tree against `HEAD`, a pull request against its merge base. Each changed line touches the innermost function or class it sits in, so a diff with three lines of context -touches only the definitions it edits. A line outside every definition touches nothing -and adds `unmapped_changes` to `causes`. +touches only the definitions it edits. Added lines that replace nothing touch the +definition that holds the lines on both sides of them. When the diff carries its lines +and not only its hunk headers, the added text decides two more cases: lines that are all +decorators touch the definition below them, and in Python a run indented as deep as the +line above it touches the definition that line ends. Text added directly above a +definition is otherwise a new definition, which the index does not hold. A changed line +outside every definition touches nothing and adds `unmapped_changes` to `causes`; so does +a changed source file that touches no definition. Each row of `tests` is one test file with the kind of evidence in `why`, strongest first: @@ -474,31 +480,41 @@ Each row of `tests` is one test file with the kind of evidence in `why`, stronge - `coverage`: an imported coverage run the index verified measured the file executing a touched definition, named in `links_to`. - `static_call`: a call chain links one of the file's tests to a touched definition - (`links_to`), with the nearest `hop`, how many of its tests do (`callers`) and a - `confidence`. -- `file_neighbor`: the file calls `callees` other definitions of the edited files. It is - the nearest test of the file and says nothing about a touched definition. + (`links_to`), with the nearest `hop` and how many of its tests do (`callers`). +- `stem_partner`: the file's name holds the stem of an edited file (`test_foo.py` for + `foo.py`), among the test map's rows. It says nothing about a touched definition. - `test_map`: mined history ties the file to an edited file, and says nothing about a touched definition. +- `file_neighbor`: the file calls `callees` other definitions of the edited files and says + nothing about a touched definition. Neighbours are a lead when little else is known: + they are listed only while the other kinds leave fewer than four rows, and never more + than fill the list to four. A `static_call` row carries `via` when the chain does not start at the definition itself: `constructor` (the test calls the class of a touched `__init__` or `__new__`), `enclosing` (it calls the function a touched nested function is defined in) or `fixture` (it reaches through a fixture). Within a kind the nearest hop is first, then the file linked to more -of the touched definitions, then the one with more tests doing so. +of the touched definitions, then the one with more tests doing so. A test file is listed +once, under its strongest kind. The touched definitions land in two lists with different meanings: - `untested` holds the definitions an imported coverage run measured unexecuted, with the - run's `commit`. It is empty unless such a run exists at a revision the index verified. + run's `commit`. It is empty unless such a run exists at a revision the index verified. A + definition the index holds only a one-line extent for is never measured: whether its + declaration line ran says nothing about its body. - `unlinked` holds the definitions no coverage run measured and no call chain links a test to. It does not say that no test runs them: tests reach code through fixtures, string-dispatched entry points and public APIs the call graph holds no edge for. A - `file_neighbor` or `test_map` row never takes a definition off this list. - -`obligations` is true while `tests` or `untested` is non-empty. `epistemic` is `measured` -when a verified coverage run settled every touched definition and every changed line sat -in one, and `lower_bound` otherwise; the op never answers `exact`. + `stem_partner`, `test_map` or `file_neighbor` row never takes a definition off this list. + +`obligations` is true while `tests` or `untested` is non-empty. A green test says as much +as its row's `why`: a `coverage` or `static_call` test ran against a touched definition, a +`stem_partner`, `test_map` or `file_neighbor` test is about the file and may not run the +changed code. `epistemic` is `measured` when a verified coverage run settled every touched +definition, every changed line sat in one and every changed source file touched one, and +`lower_bound` otherwise; the op never answers `exact`. `causes` lists what limits the +answer under either value: the call graph's own causes limit `tests`. ## History, PRs and releases diff --git a/docs/reference/operations/code.md b/docs/reference/operations/code.md index b31dcd6ca77..eb4dc5665d1 100644 --- a/docs/reference/operations/code.md +++ b/docs/reference/operations/code.md @@ -1743,7 +1743,7 @@ The pre-PR question in one call: for THIS change, which tests must run, and whic | `unlinked` | `list[dict[str, Any]]` | Touched source definitions no coverage run measured and no call chain links a test to: {qualified_name, path, start_line}. | | `changed_files` | `list[str]` | The change as the gate saw it. | | `touched_symbols` | `list[dict[str, Any]]` | The source definitions the change touches, {qualified_name, path, start_line, tier}, by path and line (first 200). | -| `obligations` | `bool` | True while `tests` or `untested` is non-empty: run the tests, then rely on green; write a test for (or explain) the untested rows. | +| `obligations` | `bool` | True while `tests` or `untested` is non-empty: run the tests, whose green says as much as each row's `why` (a `coverage` or `static_call` test ran against a touched definition; a `stem_partner`, `test_map` or `file_neighbor` test is about… | | `tests_total` | `int` | Rows of `tests` before `limit`. | | `untested_total` | `int` | Rows of `untested` before `limit`. | | `unlinked_total` | `int` | Rows of `unlinked` before `limit`. | @@ -1751,8 +1751,8 @@ The pre-PR question in one call: for THIS change, which tests must run, and whic | `untested_capped` | `bool` | True when `limit` cut `untested` short of `untested_total`. | | `unlinked_capped` | `bool` | True when `limit` cut `unlinked` short of `unlinked_total`. | | `counts_floor` | `bool` | Same epistemic contract as code.callers: the graph is a floor, so a test missing from `tests` is one the index cannot see. | -| `epistemic` | `str` | `measured` when a verified coverage run settled every touched definition and every changed line sat in one; otherwise `lower_bound` with `causes`. | -| `causes` | `list[str]` | Why `epistemic` is lower_bound, from code.callers' causes (unresolved_calls, ambiguous_calls, treesitter_only_files, external_calls, truncated: a hop read hit its row limit) and two of its own: `unmapped_changes` (a changed line of an… | +| `epistemic` | `str` | `measured` when a verified coverage run settled every touched definition, every changed line sat in one and every changed source file touched one; otherwise `lower_bound`. | +| `causes` | `list[str]` | What limits the answer, from code.callers' causes (unresolved_calls, ambiguous_calls, treesitter_only_files, external_calls, truncated: a hop read hit its row limit), which limit `tests` under either `epistemic`, and two of its own that… | | `by_hop_counts` | `dict[int, int]` | Distinct symbols reached per hop BEFORE any slicing: {1: n, 2: m}. | | `trace_run_id` | `str` | Id of this call's row in `loom.code_search_trace`. | diff --git a/integrations/claude-code-plugin/README.md b/integrations/claude-code-plugin/README.md index 7c865cf0d4f..d37464bf297 100644 --- a/integrations/claude-code-plugin/README.md +++ b/integrations/claude-code-plugin/README.md @@ -214,15 +214,13 @@ the duplicate, run `claude mcp remove -s user`. **Team file rules.** The file-context hook reads two places in one `memory.for_file` request: your own namespace, and the repository's **primary code namespace** (its trunk branch's — `code-clickhouse` for every ClickHouse branch), named by the checkout's cached `code.repos` entry. A namespace you cannot read is skipped silently, so access follows repository access. Rules from the code namespace render as `Team rule (by alice, 3 days ago) [constraint]: … [id: ]` and design decisions (typed or tagged `decision`) as `Decision (by alice, 3 days ago) (pinned): … — source: [id: ]` (`(pinned)` only when someone pinned it, else no mark; `(source changed)` once its source document no longer says it), a newer rule the conflict check linked to an older one sits above it (`supersedes rule by …`, or `supersedes decision by …`), and one footer line says how to remove a wrong one. Every member of the repository may add a rule there (`memory.set` with `files` and the tag `constraint`) and revise or delete the rules they wrote; a maintainer may delete any — from an agent (`memory.delete` on the `[id:]` key) or from the dashboard (pick the code namespace under _show system_, open the memory, Delete). A refused delete answers a `hint` naming the author and what to do instead. `memory.set` fills `files` from the value when you do not pass it. Auto-extracted session facts never go to the code namespace. -**Tests at edit time.** The test gate names a file's tests on the tool call that changes it, where the agent is still working on the file. For a source file they are the asked tests (**Asked tests**, below), each of them present in the checkout, with the tests that have no known runner listed by path; for a test file, the file's own command. A file with no test to name in the checkout gets the changed definitions the index links no test to instead (`the index links no test to Router::match`), worded as the index's view, because its call graph is a floor. A file is asked about once per session, at its first change, so a function changed later in the same file is not named; a file the server gave no answer for is asked about once more, at the next call that names it; at most four files are asked about per tool call. A test is named once per session, so the test you edit after its source file adds no second line. A test the tool call's own command runs is not named on the result of that run: its command stands there whole, in this checkout, so `pytest tests/test_a.py::test_one`, `docker exec app pytest tests/test_a.py` and `echo "pytest tests/test_a.py"` still get the line. +**Tests at edit time.** The test gate names a file's tests on the tool call that changes it, where the agent is still working on the file. For a source file they are the tests the index links to it through a coverage run, its name, the test map or the call graph, or failing those up to four tests that call other definitions of the file, each of them present in the checkout, with the tests that have no known runner listed by path; for a test file, the file's own command. A file with no test to name in the checkout gets the changed definitions the index links no test to instead (`the index links no test to Router::match`), worded as the index's view, because its call graph is a floor. A file is asked about once per session, at its first change, so a function changed later in the same file is not named; a file the server gave no answer for is asked about once more, at the next call that names it; at most four files are asked about per tool call. A test is named once per session, so the test you edit after its source file adds no second line. A test the tool call's own command runs is not named on the result of that run: its command stands there whole, in this checkout, so `pytest tests/test_a.py::test_one`, `docker exec app pytest tests/test_a.py` and `echo "pytest tests/test_a.py"` still get the line. **Stops that pass.** By default the test gate holds the end of a session only when the session ran no test since its last code change. Whether a session ran the right tests, and how they went, cannot be read reliably from its shell commands: a session that runs the whole suite, compares against a stashed tree in one command or pipes pytest through `grep` has run the tests in a way no fixed rule reads, and a gate that holds the stop on that reading holds sessions that did the work. So the stop passes, before anything is asked of the server, when the transcript holds a shell command that starts a test runner and finished no earlier than the newest write among the code files the session changed. A changed file that is documentation or prose by its name is left out of that comparison, so a note written after the run holds nothing; so is a deleted file. Such a name ends in `.md`, `.mdx`, `.markdown`, `.rst`, `.adoc` or `.asciidoc`, or is `CHANGELOG`, `CHANGES`, `HISTORY` or `NEWS`. A `.txt` file is one when it has one of those four names or is `README.txt`, `LICENSE.txt`, `NOTICE.txt` or `AUTHORS.txt`, or lies under a `docs` or `doc` directory with no `requirements` or `constraints` in its path below it (`docs/releases/5.2.txt`); any other `.txt` file is code, as a requirements file or a test fixture is. A `git stash pop` in a later command than the run rewrites the changed files, so that stop is held. A runner is `pytest`, `unittest`, `tox`, `nox`, `jest`, `vitest`, `mocha`, `nextest`, `rspec`, `phpunit`, `ctest` or `clickhouse-test`, or `go`, `cargo`, `npm`, `pnpm`, `yarn`, `bun`, `deno`, `make`, `mvn`, `gradle`, `gradlew`, `dotnet`, `swift`, `bazel`, `mix`, `rake` or `node` with an argument in which `test` or `tests` follows no letter and no lower-case letter follows it (`make test-unit`, `node --test`, `gradle :app:test`, `gradlew testDebugUnitTest`, but not `make latest`, `go vet ./internal/testutil/...` or `cargo build -p testcontainers`); or `make`, `npm`, `pnpm`, `yarn`, `bun` or `rake` with a target or a script whose name starts with `test` (`make testall`, `npm run testci`); or `gradle` or `gradlew` with a task that ends in `Test` after a lower-case letter (`gradlew integrationTest`, but not `gradlew compileTestJava`). A name after `install`, `uninstall`, `add`, `i`, `ci`, `get`, `remove`, `rm`, `update`, `upgrade`, `download` or `require` in the same simple command is a package, not a run (`pip install -U pytest`, `npm i -D @types/jest`, `yarn remove jest`), and neither the word after `-x` (`gradle build -x test`) nor `test.skip` (`mvn package -Dmaven.test.skip=true`) is one. A backslash at a line's end joins the next line to the command. Two shapes are misread: a build tool's target that has a verb's name hides the run after it, so `make install test` and `mvn clean install test` are taken for no run and that stop is held once; and a target that only builds counts when its name reads as a run (`gradlew assembleAndroidTest`, `make testdata`). The command's output is not read: a run that failed, ran other tests or ran in a container passes, and so does a command that only names a runner, such as `grep -rn pytest .`. A session that wrote a changed code file after its last such command, or that ran none, is held once per distinct change with the tests to run and the functions the index links no test to; a harness the list does not name is not seen, and that stop is held once too. A latest prompt that ends with "Do not run the tests" passes when the gate names tests the checkout has. With no transcript the stop is not held. In a Codex rollout the session's changes are read from `apply_patch` and from the shell tool under each of its names (`exec`, `exec_command`, `shell`, `shell_command`, `container.exec`), so a rollout that changed a file through any of them is held, with `LOOM_TEST_GATE=block` too. A team that wants the stop held until the named tests ran on the final tree sets `LOOM_TEST_GATE=block` in the environment Claude Code starts in; the two paragraphs below describe that mode, which names nothing at edit time. **Unlinked and untested definitions.** The index's call graph is a floor: a test may reach a definition the graph holds no edge to, through a fixture, a string-dispatched entry point or a public API. The reason of a held stop therefore lists a touched definition with no linked test as the index's view, `the index links no test to: … (the tests named here may still reach it)`, and such a definition alone holds no stop and asks for no test. Only a definition an imported coverage run measured unexecuted reads `measured unexecuted at : …` and asks for a test. -**Asked tests.** The gate asks for every test `code.test_gate` lists on evidence about the change (a test the session edited, a test a coverage run measured executing a touched definition, a test a call chain links to one, the test map), then for the tests that call other definitions of the edited files, up to four tests in all. - -**Answered stops.** With `LOOM_TEST_GATE=block`, the test gate does not block, and so names no unexecuted definition, when it asks for tests, each of them is in the checkout and the transcript already answers the ask to run them, in one of two ways. Your latest prompt ends with the sentence "Do not run the tests" (also `don't` or `never`, and `tests`, `any tests` or `the test suite`). Or the transcript shows a Bash command that ran pytest on each named test, by its file or a directory above it that is below the checkout root, and whose output holds a whole summary line for each pytest in it: one that counts tests failed or passed and none deselected. A run that failed answers, since the session has read its failures; a collection that stopped at an error (`1 error in 0.12s`) does not, and neither does a line that counts a failure or an error when a pytest in the command has `--exitfirst`, `--maxfail` or a short flag holding `x` (`-x`, `-qx`, also `-rx`), since that run stopped before the files after it. No output answers that holds the line pytest prints above the summary of a run it ended early (`stopping after 1 failures`, `Interrupted: …`), which also shows a limit or `--sw` set in a configuration file or in `PYTEST_ADDOPTS`; `| tail -1` cuts that line, and such a run then answers. The command has no `--ignore`, `--deselect`, `--lf`, `--sw` or `--continue-on-collection-errors` and no quote in pytest's arguments; its runs count from the first pytest after which it runs only pytest, `tail`, `head`, `grep` and `echo` and holds no backquote and no redirect to a file other than `/dev/null`, so the second run of `git stash; pytest tests; git stash pop; pytest tests` answers and no run of `pytest tests; git stash; pytest tests; git stash pop` or of `pytest tests; git diff --stat` does; the transcript shows no edit-tool call and no other Bash or PowerShell call after that; no tracked file is deleted; and no uncommitted or untracked file was modified later. A run of the whole checkout names no path below the root, so a bare `pytest` and `pytest .` do not answer. Before pytest in its simple command only variable assignments, `env`, `timeout`, `uv run` or `poetry run`, an interpreter's `-m` and a path may stand: `python -u -m pytest tests` and `docker exec app pytest tests` do not answer. Runs in several commands add up only while each later command holds nothing before the first of its runs that count but what launches it: one that does anything else first, a `cd` included, answers for its own runs alone. The word after a pytest flag written without `=` is read as that flag's value, not as a path that ran, unless the flag is a cluster of `-q`, `-v`, `-x`, `-s` and `-l`: `pytest --no-header tests` does not answer. Quotes in the rest of the command are not read, so a `|`, `;` or `>` inside one counts as if unquoted: a run piped into `grep -E "passed|failed"` does not answer. +**Answered stops.** With `LOOM_TEST_GATE=block`, the test gate does not block, and so names no unexecuted definition, when it names tests, each of them is in the checkout and the transcript already answers the ask to run them, in one of two ways. Your latest prompt ends with the sentence "Do not run the tests" (also `don't` or `never`, and `tests`, `any tests` or `the test suite`). Or the transcript shows a Bash command that ran pytest on each named test, by its file or a directory above it that is below the checkout root, and whose output holds a whole summary line for each pytest in it: one that counts tests failed or passed and none deselected. A run that failed answers, since the session has read its failures; a collection that stopped at an error (`1 error in 0.12s`) does not, and neither does a line that counts a failure or an error when a pytest in the command has `--exitfirst`, `--maxfail` or a short flag holding `x` (`-x`, `-qx`, also `-rx`), since that run stopped before the files after it. No output answers that holds the line pytest prints above the summary of a run it ended early (`stopping after 1 failures`, `Interrupted: …`), which also shows a limit or `--sw` set in a configuration file or in `PYTEST_ADDOPTS`; `| tail -1` cuts that line, and such a run then answers. The command has no `--ignore`, `--deselect`, `--lf`, `--sw` or `--continue-on-collection-errors` and no quote in pytest's arguments; its runs count from the first pytest after which it runs only pytest, `tail`, `head`, `grep` and `echo` and holds no backquote and no redirect to a file other than `/dev/null`, so the second run of `git stash; pytest tests; git stash pop; pytest tests` answers and no run of `pytest tests; git stash; pytest tests; git stash pop` or of `pytest tests; git diff --stat` does; the transcript shows no edit-tool call and no other Bash or PowerShell call after that; no tracked file is deleted; and no uncommitted or untracked file was modified later. A run of the whole checkout names no path below the root, so a bare `pytest` and `pytest .` do not answer. Before pytest in its simple command only variable assignments, `env`, `timeout`, `uv run` or `poetry run`, an interpreter's `-m` and a path may stand: `python -u -m pytest tests` and `docker exec app pytest tests` do not answer. Runs in several commands add up only while each later command holds nothing before the first of its runs that count but what launches it: one that does anything else first, a `cd` included, answers for its own runs alone. The word after a pytest flag written without `=` is read as that flag's value, not as a path that ran, unless the flag is a cluster of `-q`, `-v`, `-x`, `-s` and `-l`: `pytest --no-header tests` does not answer. Quotes in the rest of the command are not read, so a `|`, `;` or `>` inside one counts as if unquoted: a run piped into `grep -E "passed|failed"` does not answer. The scripts are standalone Node ESM (`.mjs`) with **zero dependencies** — no Loom SDK, no `node_modules`. They run on any Node ≥ 18 (global `fetch` + diff --git a/integrations/claude-code-plugin/hooks/HOOKS.md b/integrations/claude-code-plugin/hooks/HOOKS.md index e7745729669..9f3dac5304e 100644 --- a/integrations/claude-code-plugin/hooks/HOOKS.md +++ b/integrations/claude-code-plugin/hooks/HOOKS.md @@ -427,11 +427,11 @@ record: the run and its usage counters. asked about yet this session (`adviceFiles`, `adviceLines` in lib/test-gate.mjs; at most four per call; a comment-only change is not asked about) and prints one line per file as additionalContext on that - tool result: the commands of the asked tests (`askedTests`: every test - code.test_gate lists on evidence about the change, then tests that call - other definitions of the file, up to four in all) that the checkout - has, or the file's own command when it is a test. A file with no such - test gets the changed definitions the index links no test to. A file is asked about at its first change only, so a function + tool result: the commands of the tests the index links to the file + (failing those, up to four tests that call other definitions of the + file) that the checkout has, or the file's own command when it is a + test. A file with no such test gets the changed definitions the index + links no test to. A file is asked about at its first change only, so a function changed later in it is not named; one the server gave no answer for is asked about once more. A test is named once per session, and not when the call's own command runs it in this checkout as a whole command @@ -446,7 +446,7 @@ record: the run and its usage counters. in either mode), it sends the change's paths, hunk ranges and function names only (`diffHeaders`) to code.test_gate for its obligations and blocks the stop once per distinct change with a reason - naming them: the asked tests and the definitions a coverage run measured + naming them: the tests and the definitions a coverage run measured unexecuted. A definition the index links no test to is named beside the tests ("the index links no test to") and holds no stop by itself. By default a stop passes, and asks the server nothing, when the transcript holds a shell command that starts a test runner and diff --git a/integrations/claude-code-plugin/lib/test-gate.mjs b/integrations/claude-code-plugin/lib/test-gate.mjs index 6e4ebf2a4c2..5aa7f21cd5f 100644 --- a/integrations/claude-code-plugin/lib/test-gate.mjs +++ b/integrations/claude-code-plugin/lib/test-gate.mjs @@ -98,20 +98,6 @@ function short(qname) { return parts.length > 2 ? parts.slice(-2).join("::") : String(qname || ""); } -/** - * The tests the gate asks to run: every test it lists on evidence about the - * change (a changed test, a coverage run, a call chain, the test map), then - * the tests that call other definitions of the edited files, up to `maxRuns` - * tests in all. A file neighbour says nothing about the touched definitions, - * so thirty of them are not thirty obligations. - */ -export function askedTests(gate, maxRuns = 4) { - const tests = gate && Array.isArray(gate.tests) ? gate.tests : []; - const linked = tests.filter((t) => t && t.why !== "file_neighbor"); - const neighbors = tests.filter((t) => t && t.why === "file_neighbor"); - return [...linked, ...neighbors.slice(0, Math.max(0, maxRuns - linked.length))]; -} - /** `names` as a bounded list: the first `max`, then how many more of `total`. */ function listed(names, max, total = names.length) { const shown = names.slice(0, max); @@ -126,7 +112,7 @@ function listed(names, max, total = names.length) { */ export function renderGate(gate, { maxRuns = 4, maxNames = 4, python, testExists } = {}) { if (!gate || !gate.obligations) return ""; - const indexed = askedTests(gate, maxRuns); + const indexed = Array.isArray(gate.tests) ? gate.tests : []; // A test map may retain a deleted path, or the checkout may differ from // the indexed revision. Never prescribe a command whose target is absent. // Keep that evidence visible: an unavailable test is not a green test. @@ -201,14 +187,14 @@ function runList(tests, { maxRuns, python }) { /** * The tests of a `code.test_gate` answer about `rel` alone that the - * edit-time line names: the asked ones (`askedTests`) the checkout has. For - * a source file they are the tests the index links to it, then tests that - * call other definitions of the file; for a test file, the file itself. + * edit-time line names: the ones the checkout has. For a source file they + * are the tests the index links to it, or failing those up to four tests + * that call other definitions of the file; for a test file, the file itself. * A file under a tests directory that no runner takes (a fixture, a * conftest) is not a test to run for its own change. */ export function adviceTests(rel, gate, testExists) { - return askedTests(gate).filter( + return (gate && Array.isArray(gate.tests) ? gate.tests : []).filter( (t) => t && t.test_path && (t.run || String(t.test_path) !== rel) && (!testExists || testExists(String(t.test_path))), ); @@ -922,16 +908,16 @@ function wholeRuns(objs, { root, cwd, since } = {}) { /** * True when the gate's ask is to run tests this checkout has and the * transcript already answers it: the person's latest prompt ends by saying - * not to run tests, or `wholeRuns` holds every asked test (`askedTests`: its - * file, or a directory above it); `lastModified()` is the tree's newest file - * time in epoch ms. The stop then names no unexecuted definition either. A + * not to run tests, or `wholeRuns` holds every named test (its file, or a + * directory above it); `lastModified()` is the tree's newest file time in + * epoch ms. The stop then names no unexecuted definition either. A * gate that names a test missing from the checkout, or only unexecuted * definitions, still asks; so does one whose tests another runner runs, * unless the person ruled the run out. A Codex rollout answers nothing, so * its stop blocks. */ export function runAnswered(gate, objs, { root, cwd, testExists, lastModified } = {}) { - const tests = askedTests(gate); + const tests = gate && Array.isArray(gate.tests) ? gate.tests : []; const paths = [...new Set(tests.map((t) => String(t.test_path || "")))]; if (!paths.length || !paths.every((p) => p && testExists(p))) return false; if (declinesTests(objs)) return true; diff --git a/integrations/claude-code-plugin/skills/loom-code/reference.md b/integrations/claude-code-plugin/skills/loom-code/reference.md index 1b114bd42ed..501b922f97b 100644 --- a/integrations/claude-code-plugin/skills/loom-code/reference.md +++ b/integrations/claude-code-plugin/skills/loom-code/reference.md @@ -31,7 +31,7 @@ that needs no thought. Catch these: | Answer "**who calls X**" by grepping the name | `code.callers` | compiler-exact (scip tier); grep cannot tell a call from a comment, string, or same-named overload | | Judge "**is it safe to change X**" | `code.impact` | transitive radius + tests that reach it + files that usually co-change | | Review your **own uncommitted diff** before finishing | `code.impact` with `files=[...]` and/or `diff=` | the index can't see your working tree, but it computes what the diff touches against the base graph — blast radius, tests to run, and co-change partners your change did NOT touch | -| Say **"done"** on a change without naming its tests | `code.test_gate` with `files=[...]` and/or `diff=` | the tests to run in evidence order — a test you edited, a test a coverage run measured executing a touched definition, a test a call chain links to one, tests that call other definitions of the edited files, the mined test map — each with a `run` command when derivable (never guessed), plus `untested`: touched definitions a coverage run measured unexecuted, and `unlinked`: ones the index links no test to (not proof that none runs them). Run the tests and rely on green; write a test for the untested rows or say why not | +| Say **"done"** on a change without naming its tests | `code.test_gate` with `files=[...]` and/or `diff=` | the tests to run in evidence order — a test you edited, a test a coverage run measured executing a touched definition, a test a call chain links to one, the stem partner of a file you changed, the mined test map, and with fewer than four of those the tests that call other definitions of the edited files — each with a `run` command when derivable (never guessed), plus `untested`: touched definitions a coverage run measured unexecuted, and `unlinked`: ones the index links no test to (not proof that none runs them). Run the tests (only a `coverage` or `static_call` test is known to run the changed code); write a test for the untested rows or say why not | | Run **`gh pr create`** on a change | `code.pr_check` with the title, body, changed paths, symbols and the issues it closes | a verdict over loom's PR ledgers — `duplicate_of` when an open PR is already doing this or a merged one already did (check main before you push), `related` to read first, `none` to open it — each item with state and evidence lines (files shared, same issue closed, a backport of yours); a title alone never reads as a duplicate | | Paste-and-eyeball a **stack trace** | `code.trace` | every frame resolved to its definition in one call, trace order preserved | | Convince yourself a **claim about the code is true** ("nothing calls X", "A reaches B", "this file defines Y") before acting on it | `code.verify` | a three-valued verdict with evidence — and it will NOT say "refuted" from an absence (the graph is a floor); it says "not_established" and names what it couldn't see, so you don't act on a false negative | diff --git a/integrations/claude-code-plugin/tests/test-gate.test.mjs b/integrations/claude-code-plugin/tests/test-gate.test.mjs index 9a1d0b31f90..143e3f074ef 100644 --- a/integrations/claude-code-plugin/tests/test-gate.test.mjs +++ b/integrations/claude-code-plugin/tests/test-gate.test.mjs @@ -7,7 +7,6 @@ import path from "node:path"; import { advicePayload, adviceTests, - askedTests, checkoutPython, decideBlock, gateMode, @@ -188,23 +187,6 @@ test("a definition a coverage run measured unexecuted asks for a test", () => { assert.match(renderGate(mixed), /measured unexecuted: Parser::reset, pkg\.mod::f\. /); }); -test("a stop asks for the tests about the change, and for file neighbours only up to the cap", () => { - const t = (why, i) => ({ test_path: `tests/test_${why}_${i}.py`, why, run: `pytest tests/test_${why}_${i}.py` }); - const neighbors = Array.from({ length: 30 }, (_, i) => t("file_neighbor", i)); - const paths = (tests) => tests.map((x) => x.test_path); - // No test is linked to the change: the four neighbours that call the most of the file. - assert.deepEqual(paths(askedTests({ tests: neighbors })), paths(neighbors.slice(0, 4))); - // One linked test leaves room for three; five leave none, and all five are asked. - const one = [t("static_call", 0), ...neighbors]; - assert.deepEqual(paths(askedTests({ tests: one })), paths([one[0], ...neighbors.slice(0, 3)])); - const five = [t("changed_test", 0), ...[1, 2, 3].map((i) => t("static_call", i)), ...neighbors, t("test_map", 4)]; - assert.deepEqual(paths(askedTests({ tests: five })), paths(five.filter((x) => x.why !== "file_neighbor"))); - const text = renderGate({ obligations: true, tests: one }); - assert.match(text, /run: pytest tests\/test_static_call_0\.py tests\/test_file_neighbor_0\.py /); - assert.doesNotMatch(text, /test_file_neighbor_3|more\)/); - assert.deepEqual(askedTests(null), []); -}); - test("plain pytest runs fold into one command; a run with an option stays its own", () => { const gate = (runs) => ({ obligations: true, tests: runs.map((run) => ({ run })) }); assert.equal( @@ -875,22 +857,6 @@ test("a run of a subset or of another file answers nothing", () => { ); }); -test("file neighbours past the cap do not keep a run from answering the gate", () => { - const neighbors = Array.from({ length: 30 }, (_, i) => ({ - test_path: `tests/test_n${i}.py`, - why: "file_neighbor", - run: `pytest tests/test_n${i}.py`, - })); - const gate = { - obligations: true, - tests: [{ test_path: "tests/test_a.py", why: "static_call", run: "pytest tests/test_a.py" }, ...neighbors], - }; - const ran = (paths) => [edit(), bash(`pytest ${paths.join(" ")}`, "===== 9 passed in 0.12s =====")]; - const asked = ["tests/test_a.py", "tests/test_n0.py", "tests/test_n1.py", "tests/test_n2.py"]; - assert.equal(answered(ran(asked), gate), true); - assert.equal(answered(ran(asked.slice(0, 3)), gate), false); -}); - test("a gate that asks for more than a pytest run of present tests still asks", () => { const no = [said("Fix f. Do not run the test suite."), edit()]; const ran = [edit(), bash(SUITE, PASSED)]; diff --git a/integrations/codex-plugin/lib/test-gate.mjs b/integrations/codex-plugin/lib/test-gate.mjs index 6e4ebf2a4c2..5aa7f21cd5f 100644 --- a/integrations/codex-plugin/lib/test-gate.mjs +++ b/integrations/codex-plugin/lib/test-gate.mjs @@ -98,20 +98,6 @@ function short(qname) { return parts.length > 2 ? parts.slice(-2).join("::") : String(qname || ""); } -/** - * The tests the gate asks to run: every test it lists on evidence about the - * change (a changed test, a coverage run, a call chain, the test map), then - * the tests that call other definitions of the edited files, up to `maxRuns` - * tests in all. A file neighbour says nothing about the touched definitions, - * so thirty of them are not thirty obligations. - */ -export function askedTests(gate, maxRuns = 4) { - const tests = gate && Array.isArray(gate.tests) ? gate.tests : []; - const linked = tests.filter((t) => t && t.why !== "file_neighbor"); - const neighbors = tests.filter((t) => t && t.why === "file_neighbor"); - return [...linked, ...neighbors.slice(0, Math.max(0, maxRuns - linked.length))]; -} - /** `names` as a bounded list: the first `max`, then how many more of `total`. */ function listed(names, max, total = names.length) { const shown = names.slice(0, max); @@ -126,7 +112,7 @@ function listed(names, max, total = names.length) { */ export function renderGate(gate, { maxRuns = 4, maxNames = 4, python, testExists } = {}) { if (!gate || !gate.obligations) return ""; - const indexed = askedTests(gate, maxRuns); + const indexed = Array.isArray(gate.tests) ? gate.tests : []; // A test map may retain a deleted path, or the checkout may differ from // the indexed revision. Never prescribe a command whose target is absent. // Keep that evidence visible: an unavailable test is not a green test. @@ -201,14 +187,14 @@ function runList(tests, { maxRuns, python }) { /** * The tests of a `code.test_gate` answer about `rel` alone that the - * edit-time line names: the asked ones (`askedTests`) the checkout has. For - * a source file they are the tests the index links to it, then tests that - * call other definitions of the file; for a test file, the file itself. + * edit-time line names: the ones the checkout has. For a source file they + * are the tests the index links to it, or failing those up to four tests + * that call other definitions of the file; for a test file, the file itself. * A file under a tests directory that no runner takes (a fixture, a * conftest) is not a test to run for its own change. */ export function adviceTests(rel, gate, testExists) { - return askedTests(gate).filter( + return (gate && Array.isArray(gate.tests) ? gate.tests : []).filter( (t) => t && t.test_path && (t.run || String(t.test_path) !== rel) && (!testExists || testExists(String(t.test_path))), ); @@ -922,16 +908,16 @@ function wholeRuns(objs, { root, cwd, since } = {}) { /** * True when the gate's ask is to run tests this checkout has and the * transcript already answers it: the person's latest prompt ends by saying - * not to run tests, or `wholeRuns` holds every asked test (`askedTests`: its - * file, or a directory above it); `lastModified()` is the tree's newest file - * time in epoch ms. The stop then names no unexecuted definition either. A + * not to run tests, or `wholeRuns` holds every named test (its file, or a + * directory above it); `lastModified()` is the tree's newest file time in + * epoch ms. The stop then names no unexecuted definition either. A * gate that names a test missing from the checkout, or only unexecuted * definitions, still asks; so does one whose tests another runner runs, * unless the person ruled the run out. A Codex rollout answers nothing, so * its stop blocks. */ export function runAnswered(gate, objs, { root, cwd, testExists, lastModified } = {}) { - const tests = askedTests(gate); + const tests = gate && Array.isArray(gate.tests) ? gate.tests : []; const paths = [...new Set(tests.map((t) => String(t.test_path || "")))]; if (!paths.length || !paths.every((p) => p && testExists(p))) return false; if (declinesTests(objs)) return true; diff --git a/integrations/codex-plugin/skills/loom-code/reference.md b/integrations/codex-plugin/skills/loom-code/reference.md index 1b114bd42ed..501b922f97b 100644 --- a/integrations/codex-plugin/skills/loom-code/reference.md +++ b/integrations/codex-plugin/skills/loom-code/reference.md @@ -31,7 +31,7 @@ that needs no thought. Catch these: | Answer "**who calls X**" by grepping the name | `code.callers` | compiler-exact (scip tier); grep cannot tell a call from a comment, string, or same-named overload | | Judge "**is it safe to change X**" | `code.impact` | transitive radius + tests that reach it + files that usually co-change | | Review your **own uncommitted diff** before finishing | `code.impact` with `files=[...]` and/or `diff=` | the index can't see your working tree, but it computes what the diff touches against the base graph — blast radius, tests to run, and co-change partners your change did NOT touch | -| Say **"done"** on a change without naming its tests | `code.test_gate` with `files=[...]` and/or `diff=` | the tests to run in evidence order — a test you edited, a test a coverage run measured executing a touched definition, a test a call chain links to one, tests that call other definitions of the edited files, the mined test map — each with a `run` command when derivable (never guessed), plus `untested`: touched definitions a coverage run measured unexecuted, and `unlinked`: ones the index links no test to (not proof that none runs them). Run the tests and rely on green; write a test for the untested rows or say why not | +| Say **"done"** on a change without naming its tests | `code.test_gate` with `files=[...]` and/or `diff=` | the tests to run in evidence order — a test you edited, a test a coverage run measured executing a touched definition, a test a call chain links to one, the stem partner of a file you changed, the mined test map, and with fewer than four of those the tests that call other definitions of the edited files — each with a `run` command when derivable (never guessed), plus `untested`: touched definitions a coverage run measured unexecuted, and `unlinked`: ones the index links no test to (not proof that none runs them). Run the tests (only a `coverage` or `static_call` test is known to run the changed code); write a test for the untested rows or say why not | | Run **`gh pr create`** on a change | `code.pr_check` with the title, body, changed paths, symbols and the issues it closes | a verdict over loom's PR ledgers — `duplicate_of` when an open PR is already doing this or a merged one already did (check main before you push), `related` to read first, `none` to open it — each item with state and evidence lines (files shared, same issue closed, a backport of yours); a title alone never reads as a duplicate | | Paste-and-eyeball a **stack trace** | `code.trace` | every frame resolved to its definition in one call, trace order preserved | | Convince yourself a **claim about the code is true** ("nothing calls X", "A reaches B", "this file defines Y") before acting on it | `code.verify` | a three-valued verdict with evidence — and it will NOT say "refuted" from an absence (the graph is a floor); it says "not_established" and names what it couldn't see, so you don't act on a false negative | diff --git a/server/code/api/models_testing.py b/server/code/api/models_testing.py index ed3bc007c8c..b1ef9e348b3 100644 --- a/server/code/api/models_testing.py +++ b/server/code/api/models_testing.py @@ -22,7 +22,8 @@ class CodeTestGateInput(_CodeIdentity): definitions and one boolean, `obligations`, that a Stop hook or CI step can gate on. Tests come back in EVIDENCE order — a changed test file, then tests a coverage run measured executing a touched definition, then tests a call chain links to one, then - tests that call other definitions of the edited files, then the mined test map — + the stem partner of a changed source file, then the mined test map, then (while the + list is shorter than four) tests that call other definitions of the edited files — each row saying why it is there and how to run it (or `run_unknown` when the harness is not derivable from the path; never a guessed command).""" @@ -31,8 +32,12 @@ class CodeTestGateInput(_CodeIdentity): files: list[str] = Field(default_factory=list, max_length=50) # A unified diff against the revision the index holds (the working tree against HEAD, a # pull request against its merge base). Each changed line touches the innermost - # function or class it sits in; a line in neither touches nothing. A file with no - # hunks, as from `files` alone, touches every function in it. + # function or class it sits in; a line in neither touches nothing. Added lines that + # replace nothing touch the definition that holds the lines on both sides of them; + # decorators touch the definition below, and Python lines indented as deep as the line + # above touch the definition that line ends (both need the diff's lines, not only its + # hunk headers). A file with no hunks, as from `files` alone, touches every function + # in it. diff: str = Field(default="", max_length=200_000) # Reverse-edge hops to look for tests through. Two is code.impact's # ceiling; three reaches integration tests that sit behind a fixture. @@ -164,14 +169,15 @@ class CodeTestGateOutput(BaseModel): # (a coverage run measured it executing a touched definition; `links_to`), # `static_call` (a call chain links its tests to a touched definition: `hop` of the # nearest, `callers` how many of its tests do, `links_to` naming up to ten of the - # definitions, `confidence` 0.9 at one hop, 0.8 at two and 0.6 at three, - # `via` `constructor` when the test calls the class of a touched constructor, - # `enclosing` when it calls the function a touched nested function is defined in or - # `fixture` when it reaches through a fixture), `file_neighbor` (it calls `callees` - # other definitions of the edited files and says nothing about the touched ones), - # `test_map` (mined history about the file: `src_path`, `confidence`). Within a kind - # the nearest hop is first, then the file linked to more of the touched definitions, - # then the one with more tests or callees. + # definitions, `via` `constructor` when the test calls the class of a touched + # constructor, `enclosing` when it calls the function a touched nested function is + # defined in or `fixture` when it reaches through a fixture), `stem_partner` (its name + # holds the stem of a changed source file: `src_path`), `test_map` (mined history + # about the file: `src_path`, `confidence`), `file_neighbor` (it calls `callees` other + # definitions of the edited files and says nothing about the touched + # ones; listed only while the other kinds leave fewer than four rows, and never more + # than fill the list to four). Within a kind the nearest hop is first, then the file + # linked to more of the touched definitions, then the one with more tests or callees. tests: list[dict[str, Any]] = Field(default_factory=list) # Touched source definitions a coverage run measured unexecuted, at a commit the index # verified: {qualified_name, path, start_line, commit}. Empty without such a run. @@ -179,15 +185,19 @@ class CodeTestGateOutput(BaseModel): # Touched source definitions no coverage run measured and no call chain links a test # to: {qualified_name, path, start_line}. Not proof that no test runs them: tests reach # code through fixtures, string dispatch and entry points the graph has no edge for. A - # `file_neighbor` or `test_map` row never takes a definition off this list. + # `stem_partner`, `test_map` or `file_neighbor` row never takes a definition off this + # list. unlinked: list[dict[str, Any]] = Field(default_factory=list) # The change as the gate saw it. changed_files: list[str] = Field(default_factory=list) # The source definitions the change touches, {qualified_name, path, start_line, tier}, # by path and line (first 200). touched_symbols: list[dict[str, Any]] = Field(default_factory=list) - # True while `tests` or `untested` is non-empty: run the tests, then rely on green; - # write a test for (or explain) the untested rows. `unlinked` alone asks for nothing. + # True while `tests` or `untested` is non-empty: run the tests, whose green says as + # much as each row's `why` (a `coverage` or `static_call` test ran against a touched + # definition; a `stem_partner`, `test_map` or `file_neighbor` test is about the file + # and may not run the changed code), and write a test for (or explain) the untested + # rows. `unlinked` alone asks for nothing. obligations: bool = False # Rows of `tests` before `limit`. tests_total: int = 0 @@ -204,16 +214,18 @@ class CodeTestGateOutput(BaseModel): # Same epistemic contract as code.callers: the graph is a floor, so a test missing # from `tests` is one the index cannot see. counts_floor: bool = True - # `measured` when a verified coverage run settled every touched definition and every - # changed line sat in one; otherwise `lower_bound` with `causes`. The gate never - # answers `exact`: a static graph cannot show that no test runs a definition. + # `measured` when a verified coverage run settled every touched definition, every + # changed line sat in one and every changed source file touched one; otherwise + # `lower_bound`. The gate never answers `exact`: a static graph cannot show that no + # test runs a definition. epistemic: str = "lower_bound" - # Why `epistemic` is lower_bound, from code.callers' causes (unresolved_calls, + # What limits the answer, from code.callers' causes (unresolved_calls, # ambiguous_calls, treesitter_only_files, external_calls, truncated: a hop read hit its - # row limit) and two of its own: `unmapped_changes` (a changed line of an indexed file - # sits in no definition) and `no_coverage` (no verified coverage run measured a touched - # definition). Empty when `epistemic` is measured, or when the change touches no - # indexed source definition. + # row limit), which limit `tests` under either `epistemic`, and two of its own that + # make it `lower_bound`: `unmapped_changes` (a changed line sits in no definition the + # index holds: module-level code, text added above a definition, a file with no + # definition or one the index does not hold) and `no_coverage` (no verified coverage + # run measured a touched definition). causes: list[str] = Field(default_factory=list) # Distinct symbols reached per hop BEFORE any slicing: {1: n, 2: m}. # The true size of the radius when `truncated` says the rows are a page. diff --git a/server/code/app/coverage_freshness.py b/server/code/app/coverage_freshness.py index d487151028a..f7ad3a941fd 100644 --- a/server/code/app/coverage_freshness.py +++ b/server/code/app/coverage_freshness.py @@ -146,14 +146,26 @@ async def measured_for( return out +def body_extents(row: dict[str, Any]) -> list[tuple[str, int, int]]: + """(symbol_id, start, end) of every tier row of a definition that holds a body: the + row's `extents`, or its own span. A one-line extent is left out: a compiler row may be + the declaration line only, and whether that line ran says nothing about the body.""" + own = ( + str(row.get("symbol_id") or ""), + int(row.get("start_line") or 0), + int(row.get("end_line") or 0), + ) + return [e for e in row.get("extents") or [own] if 0 < e[1] < e[2]] + + async def measured_definitions( repo: CodeRepo, org: str, ns: str, rows: list[dict[str, Any]] ) -> dict[str, dict[str, Any]]: - """What a coverage run measured of each definition row (`symbol_id`, `path`, - `start_line`, `end_line`): symbol_id -> {executed, commit}. A definition is absent - unless the run measured its file at the commit the index parsed both the file and the - definition's span at; one measured unexecuted also needs the run at the index - watermark, as the coverage claim's `uncovered` does. No coverage rows, one read.""" + """What a coverage run measured of each definition row (`symbol_id`, `path` and its + spans, see `body_extents`): symbol_id -> {executed, commit}. A definition is absent + unless the run measured its file at the commit the index parsed both the file and one + of the definition's body extents at; one measured unexecuted also needs the run at the + index watermark, as the coverage claim's `uncovered` does. No coverage rows, one read.""" paths = list(dict.fromkeys(str(r.get("path") or "") for r in rows if r.get("path"))) files = await repo.coverage_files_for(org, ns, paths) if paths else {} if not files: @@ -172,14 +184,18 @@ async def measured_definitions( out: dict[str, dict[str, Any]] = {} for r in rows: path, sid = str(r.get("path") or ""), str(r.get("symbol_id") or "") - start, end = int(r.get("start_line") or 0), int(r.get("end_line") or 0) - if path not in files or start <= 0 or end < start: + if path not in files: continue commit = str(files[path].get("commit_sha") or "") - span_commit = parsed_at.get((sid, start, end), "") - if not verified_source(path, commit, head, indexed, {path: {span_commit}}): - continue - executed = cr.intersects(cr.json_ranges(str(files[path].get("lines") or "[]")), start, end) - if executed or commit == head: + ran = cr.json_ranges(str(files[path].get("lines") or "[]")) + verified = [ + (start, end) + for extent_id, start, end in body_extents(r) + if verified_source( + path, commit, head, indexed, {path: {parsed_at.get((extent_id, start, end), "")}} + ) + ] + executed = any(cr.intersects(ran, start, end) for start, end in verified) + if verified and (executed or commit == head): out[sid] = {"executed": executed, "commit": commit} return out diff --git a/server/code/app/symbol/diff.py b/server/code/app/symbol/diff.py index 2918e7bb38d..be6e4335453 100644 --- a/server/code/app/symbol/diff.py +++ b/server/code/app/symbol/diff.py @@ -9,12 +9,29 @@ from bisect import bisect_left, bisect_right from typing import Any, NamedTuple +from server.code.domain.extract.treesitter import lang_for_path +from server.code.domain.index import coverage_runs as cr + # What a diff's changed lines are matched against. A class is a definition a diff can edit # outside every method (an attribute, a decorator), and a line of its body is not the # method's below it. DEFINITION_KINDS = ("function", "method", "fixture", "class") +class Insertion(NamedTuple): + """A run of added lines that replaces nothing. The two flags are read from the added + text, so a hunk sent without its lines leaves both False.""" + + # The old line the run follows (0 at the top of the file). + after: int + # Every added line is a decorator or annotation (`@name`): the run decorates the + # definition that starts on the next line. A new function added there has other lines. + decorates: bool = False + # The first added line is indented at least as deep as the old line above it: where + # indentation is the block structure, the run continues the block that line closes. + continues: bool = False + + class Hunk(NamedTuple): """What one hunk changes on the old side, the revision the index holds: a diff of a working tree starts from HEAD, a pull request's from its merge base.""" @@ -23,9 +40,8 @@ class Hunk(NamedTuple): name: str # Old-side line ranges the hunk deletes or replaces, inclusive. removed: tuple[tuple[int, int], ...] - # For each run of added lines that replaces nothing, the old line it follows (0 at the - # top of the file). - inserted: tuple[int, ...] + # The runs of added lines that replace nothing. + inserted: tuple[Insertion, ...] def _hunk_context_name(ctx: str) -> str: @@ -99,7 +115,7 @@ def _parse_unified_diff_full( if old_count: removed = [(old_start, old_start + old_count - 1)] else: - inserted = [old_start] + inserted = [Insertion(old_start)] changes[path].append(Hunk(nm, tuple(removed), tuple(inserted))) return ranges, names, changes @@ -118,18 +134,41 @@ def _file_header_at(lines: list[str], i: int, *, body_seen: bool) -> bool: return False +_DECORATOR_RE = re.compile(r"\s*@\w") + + +def _indent(text: str) -> int: + text = text.expandtabs() + return len(text) - len(text.lstrip()) + + +def _insertion(after: int, added: list[str], above: str | None) -> Insertion: + """The insertion of `added` after old line `after`, whose text is `above` when the + hunk showed it.""" + lines = [a for a in added if a.strip()] + if not lines: + return Insertion(after) + return Insertion( + after, + decorates=all(_DECORATOR_RE.match(a) for a in lines), + continues=bool(above and above.strip()) and _indent(lines[0]) >= _indent(above or ""), + ) + + def _hunk_body( lines: list[str], i: int, old_start: int, old_left: int, new_left: int -) -> tuple[list[tuple[int, int]], list[int], int]: +) -> tuple[list[tuple[int, int]], list[Insertion], int]: """(removed, inserted, next index): the old-side changes of the hunk body starting at `lines[i]`, read for as long as the header's line counts last. A run of added lines that follows removed lines replaces them and is no insertion of its own.""" removed: list[tuple[int, int]] = [] - inserted: list[int] = [] + runs: list[tuple[int, list[str], str | None]] = [] # (after, added lines, the line above) # A zero-count old range names the line the hunk follows, any other its first line. old = old_start if old_left else old_start + 1 in_run = False # inside a run of changed lines that already removed or inserted seen = False + above: str | None = None # the old line before the next one, when the hunk showed it + adding: list[str] | None = None # the added lines of an insertion still being read while i < len(lines) and (old_left > 0 or new_left > 0): line = lines[i] if line.startswith("\\"): # "\ No newline at end of file" @@ -142,18 +181,23 @@ def _hunk_body( removed[-1] = (removed[-1][0], old) else: removed.append((old, old)) + above, adding = line[1:], None old, old_left, in_run = old + 1, old_left - 1, True elif line.startswith("+") and new_left > 0: if not in_run: - inserted.append(old - 1) + adding = [] + runs.append((old - 1, adding, above)) + if adding is not None: + adding.append(line[1:]) new_left, in_run = new_left - 1, True elif (line.startswith(" ") or not line) and old_left > 0 and new_left > 0: + above, adding = line[1:], None old, old_left, new_left, in_run = old + 1, old_left - 1, new_left - 1, False else: break seen = True i += 1 - return removed, inserted, i + return removed, [_insertion(*r) for r in runs], i def _name_matches(qualified: str, header_name: str) -> bool: @@ -172,56 +216,104 @@ def _span(r: dict[str, Any]) -> tuple[int, int]: return start, max(start, int(r["end_line"] or 0)) -def _hunk_rows(rows: list[dict[str, Any]], hunk: Hunk) -> tuple[list[dict[str, Any]], int]: - """(the rows of one file the hunk edits, its changed lines that sit in none of them). - The edited definition is the innermost one whose span holds a changed line. An - insertion sits between two old lines and is inside a definition that holds both, or - directly above one (a decorator). `rows` is ordered widest span first.""" - out: dict[str, dict[str, Any]] = {} - unmapped = 0 - lo = min((_span(r)[0] for r in rows), default=1) - hi = max((_span(r)[1] for r in rows), default=0) - lines: list[int] = [] - for a, b in hunk.removed: - # Lines outside every definition of the file need no walk: a header may claim any range. - inside = range(max(a, lo), min(b, hi) + 1) - lines.extend(inside) - unmapped += (b - a + 1) - len(inside) - lines = sorted(set(lines)) +def _clip(ranges: list[cr.Range], within: list[cr.Range]) -> list[cr.Range]: + """The parts of `ranges` inside `within`; both sorted and disjoint.""" + out: list[cr.Range] = [] + j = 0 + for a, b in ranges: + while j < len(within) and within[j][1] < a: + j += 1 + k = j + while k < len(within) and within[k][0] <= b: + out.append((max(a, within[k][0]), min(b, within[k][1]))) + k += 1 + return out + + +def _innermost( + rows: list[dict[str, Any]], points: list[int], *, gap: bool = False +) -> dict[int, dict[str, Any]]: + """The innermost row whose span holds each of `points` (sorted); with `gap`, the + innermost that holds the point and the line after it. `rows` is ordered widest span + first, so the innermost is written last.""" owner: dict[int, dict[str, Any]] = {} - for r in rows: # widest first, so the innermost definition is written last + for r in rows: start, end = _span(r) - for n in lines[bisect_left(lines, start) : bisect_right(lines, end)]: + for n in points[bisect_left(points, start) : bisect_right(points, end - gap)]: owner[n] = r - for n in lines: - if n in owner: - out[str(owner[n]["symbol_id"])] = owner[n] - else: - unmapped += 1 - for after in hunk.inserted: - holders = [r for r in rows if _span(r)[0] <= after and after + 1 <= _span(r)[1]] - row = (holders or [r for r in rows if _span(r)[0] == after + 1])[-1:] - if row: - out[str(row[0]["symbol_id"])] = row[0] - else: - unmapped += 1 - return list(out.values()), unmapped - - -def _header_row(rows: list[dict[str, Any]], hunk: Hunk) -> dict[str, Any] | None: - """The definition a hunk's header names, for a hunk whose lines sit in none: the - nearest same-named row above the hunk, and only one the index holds no body extent - for (a compiler row of one line), where line numbers cannot tell.""" - first = min([a for a, _ in hunk.removed] + list(hunk.inserted), default=0) - above = [ - r - for r in rows - if _name_matches(str(r["qualified_name"]), hunk.name) and _span(r)[0] <= first - ] - if not above: - return None - row = max(above, key=lambda r: _span(r)[0]) - return row if _span(row)[0] == _span(row)[1] else None + return owner + + +class _FileSpans: + """The definition rows of one file, read for where a changed line sits.""" + + def __init__(self, rows: list[dict[str, Any]], hunks: list[Hunk], *, indented: bool) -> None: + # Widest span first: the innermost definition is the last one written. + self.rows = sorted(rows, key=lambda r: _span(r)[0] - _span(r)[1]) + self.covered = cr.merge_ranges(_span(r) for r in self.rows) + self.indented = indented + self.starts = {_span(r)[0]: r for r in self.rows} + self.ends = {_span(r)[1]: r for r in self.rows} + gaps = sorted({ins.after for h in hunks for ins in h.inserted}) + self.holders = _innermost(self.rows, gaps, gap=True) + # Rows the index holds no body extent for (a compiler row of one line), by bare name. + self.stubs: dict[str, list[dict[str, Any]]] = {} + for r in self.rows: + if _span(r)[0] == _span(r)[1]: + bare = str(r["qualified_name"]).rsplit("::", 1)[-1] + self.stubs.setdefault(bare, []).append(r) + + def inserted_in(self, ins: Insertion) -> dict[str, Any] | None: + """The definition an insertion edits. It sits between two old lines and is inside + the innermost definition that holds both. The added text can say more: decorators + edit the definition that starts below them, and in an indented language a run as + deep as the line above continues the definition that line ends. Text added + directly above a definition is otherwise a new one, which the index does not hold.""" + if ins.decorates and ins.after + 1 in self.starts: + return self.starts[ins.after + 1] + if self.indented and ins.continues and ins.after in self.ends: + return self.ends[ins.after] + return self.holders.get(ins.after) + + def holds(self, hunk: Hunk) -> bool: + """Whether a changed line of the hunk sits in a definition.""" + for a, b in hunk.removed: + i = bisect_left(self.covered, (a, 0)) + if (i < len(self.covered) and self.covered[i][0] <= b) or ( + i and self.covered[i - 1][1] >= a + ): + return True + return any(self.inserted_in(ins) is not None for ins in hunk.inserted) + + def header_row(self, hunk: Hunk) -> dict[str, Any] | None: + """The definition a hunk's header names, for a hunk whose lines sit in none: the + nearest same-named row above the hunk, and only one the index holds no body extent + for, where line numbers cannot tell.""" + first = min([a for a, _ in hunk.removed] + [ins.after for ins in hunk.inserted], default=0) + above = [ + r + for r in self.stubs.get(hunk.name.rsplit("::", 1)[-1], []) + if _name_matches(str(r["qualified_name"]), hunk.name) and _span(r)[0] <= first + ] + return max(above, key=lambda r: _span(r)[0]) if above else None + + def edited(self, hunks: list[Hunk]) -> tuple[list[dict[str, Any]], int]: + """(the rows the hunks edit, their changed lines that sit in none). The edited + definition is the innermost one whose span holds a changed line. The removed + ranges are merged before the walk, so its cost follows the file's extent and not + what the hunk headers claim.""" + removed = cr.merge_ranges(r for h in hunks for r in h.removed) + inside = _clip(removed, self.covered) + lines = [n for a, b in inside for n in range(a, b + 1)] + out = {str(r["symbol_id"]): r for r in _innermost(self.rows, lines).values()} + unmapped = cr.lines_in(removed) - len(lines) + for ins in dict.fromkeys(ins for h in hunks for ins in h.inserted): + row = self.inserted_in(ins) + if row is None: + unmapped += 1 + else: + out[str(row["symbol_id"])] = row + return list(out.values()), unmapped def _touched_rows_for_diff( @@ -229,9 +321,10 @@ def _touched_rows_for_diff( changes: dict[str, list[Hunk]], ) -> tuple[list[dict[str, Any]], list[str], int]: """(the touched definition rows in seed order, the ids the walk seeds, the changed - lines of indexed files that sit in no definition). A file with hunks touches the - definitions its changed lines sit in; a file without hunks (files-only shape) touches - every function in it. Pure, so the diff shape's seed rule is testable without a repo.""" + lines that sit in no definition, counted in the files `symbol_rows` has a row of). A + file with hunks touches the definitions its changed lines sit in; a file without hunks + (files-only shape) touches every function in it. Pure, so the diff shape's seed rule + is testable without a repo.""" by_path: dict[str, list[dict[str, Any]]] = {} for r in symbol_rows: by_path.setdefault(str(r["path"]), []).append(r) @@ -242,32 +335,37 @@ def _touched_rows_for_diff( if not hunks: touched_rows += [{**r, "via": "file"} for r in rows if str(r.get("kind")) != "class"] continue - rows = sorted(rows, key=lambda r: _span(r)[0] - _span(r)[1]) - edited: set[str] = set() + spans = _FileSpans(rows, hunks, indented=lang_for_path(p) == "python") + by_lines: list[Hunk] = [] for hunk in hunks: - found, missed = _hunk_rows(rows, hunk) - named = _header_row(rows, hunk) if not found and hunk.name else None - edited |= {str(r["qualified_name"]) for r in found} + named = spans.header_row(hunk) if hunk.name and not spans.holds(hunk) else None if named is not None: touched_rows.append({**named, "via": "header"}) else: - unmapped += missed + by_lines.append(hunk) + found, missed = spans.edited(by_lines) + unmapped += missed + edited = {str(r["qualified_name"]) for r in found} # A definition the two tiers hold as two rows is edited in both, whichever row's # span held the line (the compiler's may be its declaration line only). touched_rows += [{**r, "via": "hunk"} for r in rows if str(r["qualified_name"]) in edited] # Both tiers index the same definition under different symbol_ids: one row per (path, - # qualified_name), scip first, carrying every id of the rows it stands for (`tier_ids`). - # The walk seeds all of them: parser-tier edges point at the parser-tier id, and a - # definition seeded by its compiler id alone would lose the callers only the parser saw. + # qualified_name), scip first, carrying every id of the rows it stands for (`tier_ids`) + # and the span of each (`extents`). The walk seeds all the ids: parser-tier edges point + # at the parser-tier id, and a definition seeded by its compiler id alone would lose the + # callers only the parser saw. A coverage run is read against all the extents: the + # compiler's may be the declaration line only. kept: dict[tuple[str, str], dict[str, Any]] = {} for r in sorted(touched_rows, key=lambda r: 0 if str(r["tier"]) == "scip" else 1): key = (str(r["path"]), str(r["qualified_name"])) ids = r.get("tier_ids") or [r["symbol_id"]] + extent = (str(r["symbol_id"]), *_span(r)) if key in kept: first = kept[key] first["tier_ids"] = list(dict.fromkeys([*first["tier_ids"], *map(str, ids)])) + first["extents"].append(extent) else: - kept[key] = {**r, "tier_ids": list(dict.fromkeys(map(str, ids)))} + kept[key] = {**r, "tier_ids": list(dict.fromkeys(map(str, ids))), "extents": [extent]} # Deterministic, explainable order: the definitions a changed line sits in, then the # ones only a hunk header names, then whole-file seeds. rank = {"hunk": 0, "header": 1, "file": 2} diff --git a/server/code/app/symbol/gate.py b/server/code/app/symbol/gate.py index 742457839c6..47d07c04333 100644 --- a/server/code/app/symbol/gate.py +++ b/server/code/app/symbol/gate.py @@ -41,7 +41,12 @@ async def handle_code_test_gate(input: CodeTestGateInput) -> CodeTestGateOutput: """Pre-PR obligations for a diff: tests to run (evidence-ordered, with a run command when derivable), the touched definitions a coverage run measured unexecuted and the ones the index links no test to. See code/domain/index/test_gate.py for the rules.""" - from server.code.domain.index.test_gate import GateInputs, build_gate, is_test_path + from server.code.domain.index.test_gate import ( + NEIGHBOR_FILL, + GateInputs, + build_gate, + is_test_path, + ) require_code_intel() if not (input.files or input.diff): @@ -77,6 +82,9 @@ async def handle_code_test_gate(input: CodeTestGateInput) -> CodeTestGateOutput: ), key=lambda r: (r["path"], r["start_line"]), ) + # A changed source file that touches no definition (unindexed, a script module, a + # document) is a change no definition answers for. + unseen = set(src_paths) - {t["path"] for t in touched} with code_span("test_gate.hop_walk", seeds=len(seed_ids), depth=input.depth) as sp: known_paths, bare_paths = _graph_paths(src_paths, symbol_rows) @@ -94,7 +102,9 @@ async def handle_code_test_gate(input: CodeTestGateInput) -> CodeTestGateOutput: symbol_rows, depth=input.depth, read_limit=_GATE_READ_LIMIT, - neighbors=input.limit, + # Enough to fill the list: a neighbour that is already a row leaves the + # list one row longer, so one fewer is needed. + neighbors=NEIGHBOR_FILL, ), _declined_safe(repo, org, ns, touched), _scip_coverage(repo, org, ns, known_paths, symbol_rows), @@ -131,13 +141,13 @@ async def handle_code_test_gate(input: CodeTestGateInput) -> CodeTestGateOutput: ) # The graph is never proof that no test runs a definition: the answer is `measured` # only when a coverage run settled every touched definition and every changed line sat - # in one. + # in one. The graph's own causes stay beside it: they limit `tests` either way. causes = [ *env.causes, - *([CAUSE_UNMAPPED] if unmapped else []), + *([CAUSE_UNMAPPED] if unmapped or unseen else []), *([CAUSE_NO_COVERAGE] if gate.unmeasured else []), ] - measured = bool(touched) and not unmapped and not gate.unmeasured + measured = bool(touched) and not unmapped and not unseen and not gate.unmeasured trace_run_id = new_trace_run_id() schedule_code_trace( org=org, @@ -182,6 +192,6 @@ async def handle_code_test_gate(input: CodeTestGateInput) -> CodeTestGateOutput: unlinked_capped=gate.unlinked_total > len(gate.unlinked), by_hop_counts=by_hop_counts, epistemic="measured" if measured else "lower_bound", - causes=[] if measured else causes, + causes=causes, trace_run_id=trace_run_id, ) diff --git a/server/code/app/symbol/test_links.py b/server/code/app/symbol/test_links.py index 4a64801e4d3..16511e34225 100644 --- a/server/code/app/symbol/test_links.py +++ b/server/code/app/symbol/test_links.py @@ -9,7 +9,11 @@ from dataclasses import dataclass, field from typing import Any -from server.code.app.coverage_freshness import measured_definitions, partition_coverage_rows +from server.code.app.coverage_freshness import ( + body_extents, + measured_definitions, + partition_coverage_rows, +) from server.code.app.symbol.edges import _GRAPH_EDGE_KINDS from server.code.domain.index import coverage_runs as cr from server.code.store.index import CodeRepo @@ -143,13 +147,29 @@ async def _coverage( for row in current: ranges = cr.evidence_ranges(str(row.get("evidence") or "")) for r in executed: - if str(r["path"]) == str(row.get("src_path")) and cr.intersects( - ranges, int(r["start_line"] or 0), int(r["end_line"] or 0) + if str(r["path"]) == str(row.get("src_path")) and any( + cr.intersects(ranges, start, end) for _, start, end in body_extents(r) ): tests.setdefault(str(row.get("test_path") or ""), set()).add(str(r["symbol_id"])) return measured, [{"test_path": tp, "roots": sorted(ids)} for tp, ids in tests.items() if tp] +def _other_definitions( + symbol_rows: list[dict[str, Any]], roots: dict[str, set[str]] +) -> dict[str, str]: + """Edge target id -> the definition it is an id of, for the definitions of the edited + files the walk does not seed. A definition both tiers hold has two ids and is one + definition. Ordered by path and line: the neighbour read takes the first ids.""" + names: dict[tuple[str, str], str] = {} + out: dict[str, str] = {} + for r in sorted(symbol_rows, key=lambda r: (str(r["path"]), int(r["start_line"] or 0))): + name = names.setdefault((str(r["path"]), str(r["qualified_name"])), str(r["symbol_id"])) + for sid in r.get("tier_ids") or [r["symbol_id"]]: + if str(sid) not in roots: + out.setdefault(str(sid), name) + return out + + async def link_tests( repo: CodeRepo, org: str, @@ -168,10 +188,9 @@ async def link_tests( if not symbol_rows: return Links() roots, stands = _seed_roots(touched, symbol_rows) - others = [str(r["symbol_id"]) for r in symbol_rows if str(r["symbol_id"]) not in roots] (impacted, capped), near, (measured, coverage) = await asyncio.gather( _walk(repo, org, ns, roots, stands, depth=depth, read_limit=read_limit), - repo.test_files_calling(org, ns, others, limit=neighbors), + repo.test_files_calling(org, ns, _other_definitions(symbol_rows, roots), limit=neighbors), _coverage(repo, org, ns, touched), ) return Links( diff --git a/server/code/domain/index/epistemic.py b/server/code/domain/index/epistemic.py index fd2ccef8235..b11bb7d198b 100644 --- a/server/code/domain/index/epistemic.py +++ b/server/code/domain/index/epistemic.py @@ -55,8 +55,9 @@ CAUSE_STALE = "scip_stale_files" # The walk stopped before the graph did: whatever else holds, the rows are part of it. CAUSE_TRUNCATED = "truncated" -# code.test_gate only. A changed line of an indexed file sits in no definition the index -# holds (module-level code), so no definition answers for it. +# code.test_gate only. A changed line sits in no definition the index holds (module-level +# code, text added above a definition, a file with no definition or one the index does not +# hold), so no definition answers for it. CAUSE_UNMAPPED = "unmapped_changes" # code.test_gate only. No verified coverage run measured a touched definition: its status # comes from the static graph, which cannot show that no test runs it. diff --git a/server/code/domain/index/test_gate.py b/server/code/domain/index/test_gate.py index 5f77ce866c7..84bf978edb5 100644 --- a/server/code/domain/index/test_gate.py +++ b/server/code/domain/index/test_gate.py @@ -9,9 +9,13 @@ Why evidence order: a test file that is itself in the diff is an obligation on its own evidence (you edited it, run it); a coverage run measured its tests executing the -definition; a static call chain names a test that reaches the definition; a file -neighbour is a test that calls other definitions of the edited file and says nothing -about this one; a test-map row is mined history about the file. +definition; a static call chain names a test that reaches the definition; a stem partner +(`foo.py` → `test_foo.py`) is the repository's own naming convention about the file; a +test-map row is mined history about the file; a file neighbour is a test that calls other +definitions of the edited file and says nothing about this one, so neighbours only fill a +short list. A test file is listed once, under its strongest kind, so a kind about the +definition comes before a kind about the file: the row then names the test and the +definition it links to. A static graph cannot prove that no test runs a definition: tests reach code through fixtures, string dispatch and public entry points the graph holds no edge for. So only a @@ -34,12 +38,21 @@ CHANGED_TEST = "changed_test" COVERAGE = "coverage" STATIC_CALL = "static_call" -FILE_NEIGHBOR = "file_neighbor" +STEM_PARTNER = "stem_partner" TEST_MAP = "test_map" -_ORDER = {CHANGED_TEST: 0, COVERAGE: 1, STATIC_CALL: 2, FILE_NEIGHBOR: 3, TEST_MAP: 4} -# How often the test a `static_call` row names executes the definition it links to, by hop: -# the share measured against per-test coverage of two repositories, to one decimal. -_HOP_CONFIDENCE = {1: 0.9, 2: 0.8, 3: 0.6} +FILE_NEIGHBOR = "file_neighbor" +_ORDER = { + CHANGED_TEST: 0, + COVERAGE: 1, + STATIC_CALL: 2, + STEM_PARTNER: 3, + TEST_MAP: 4, + FILE_NEIGHBOR: 5, +} +# File neighbours are added only while the list is shorter than this: they say nothing +# about the touched definitions, so they are a lead when little else is known and never +# take a row's place. +NEIGHBOR_FILL = 4 # Definitions a row names in `links_to`. _LINKS_SHOWN = 10 @@ -62,6 +75,29 @@ def is_test_path(path: str) -> bool: return bool(_TEST_DIR_RE.search(p) or _TEST_FILE_RE.search(p)) +def _stem(path: str) -> str: + name = PurePosixPath(path).stem.lower() + # 02345_foo_bar.sql -> foo_bar; test_foo -> foo; foo_test -> foo + name = re.sub(r"^\d+_", "", name) + name = re.sub(r"^test_?", "", name) + name = re.sub(r"_?tests?$", "", name) + name = re.sub(r"\.(test|spec)$", "", name) + return name + + +def stem_partners(test_path: str, src_paths: list[str]) -> list[str]: + """Source files among `src_paths` whose stem the test's stem contains, + the same rule the test-map worker uses (`src/**/tests/` name-stem match). + Stems under 3 characters never match: 'io' is inside everything.""" + t = _stem(test_path) + out = [] + for s in src_paths: + ss = _stem(s) + if len(ss) >= 3 and ss in t: + out.append(s) + return out + + # ---- run recipes ----------------------------------------------------------- # (regex over the repo-relative path, template). Templates may use {path}, # {dir}, {stem}, {name} (file name without extension), {parent} (name of the @@ -136,7 +172,8 @@ class GateInputs: impacted: dict[str, dict[str, Any]] # code_test_map rows for the change's source paths test_map: list[dict[str, Any]] - # {path, callees}: test files calling other definitions of the edited files, most first + # {path, callees}: test files calling other definitions of the edited files, most + # first; `NEIGHBOR_FILL` of them are enough neighbors: list[dict[str, Any]] = field(default_factory=list) # touched symbol_id -> {executed, commit}: what a verified coverage run measured measured: dict[str, dict[str, Any]] = field(default_factory=dict) @@ -193,9 +230,9 @@ def _test_rows(inp: GateInputs, names: dict[str, str]) -> tuple[list[dict[str, A rows: dict[str, dict[str, Any]] = {} rank: dict[str, tuple[int, int]] = {} # test_path -> (touched definitions linked, tests) - def add(test_path: str, why: str, **extra: Any) -> None: + def add(test_path: str, why: str, **extra: Any) -> bool: if not test_path or test_path in rows: - return + return False run, unknown = run_command_for(test_path, inp.run_overrides_json) rows[test_path] = { "test_path": test_path, @@ -204,6 +241,7 @@ def add(test_path: str, why: str, **extra: Any) -> None: "run_unknown": unknown, **extra, } + return True # 1. a changed test file is an obligation on its own evidence for p in inp.changed_paths: @@ -211,42 +249,35 @@ def add(test_path: str, why: str, **extra: Any) -> None: add(p, CHANGED_TEST, evidence="in the diff") # 2. tests a coverage run measured executing a touched definition for c in inp.coverage: - roots = set(c.get("roots") or ()) + tp, roots = str(c.get("test_path") or ""), set(c.get("roots") or ()) links = _links_to(roots, names) - rank.setdefault(str(c.get("test_path") or ""), (len(roots), 0)) - add( - str(c.get("test_path") or ""), - COVERAGE, - evidence=f"a coverage run measured it executing {', '.join(links[:3])}", - links_to=links, - ) + evidence = f"a coverage run measured it executing {', '.join(links[:3])}" + if add(tp, COVERAGE, evidence=evidence, links_to=links): + rank[tp] = (len(roots), 0) # 3. tests a call chain reaches a touched definition from static, linked = _static_files(inp) for f in static: v, hop = f["node"], int(f["node"].get("hop") or 0) - rank.setdefault(f["path"], (len(f["roots"]), int(f["callers"]))) - add( + added = add( f["path"], STATIC_CALL, evidence=f"{v.get('qualified_name', '')} reaches the change in {hop} hop(s)", hop=hop, callers=int(f["callers"]), - confidence=_HOP_CONFIDENCE.get(hop, min(_HOP_CONFIDENCE.values())), links_to=_links_to(f["roots"], names), **({"via": str(v["via"])} if v.get("via") else {}), ) - # 4. tests that call other definitions of the edited files: about the file, not about - # any touched definition - for n in inp.neighbors: - callees = int(n.get("callees") or 0) - add( - str(n.get("path") or ""), - FILE_NEIGHBOR, - evidence=f"calls {callees} other definition(s) of the edited files", - callees=callees, - ) - # 5. the mined test map + if added: + rank[f["path"]] = (len(f["roots"]), int(f["callers"])) + # 4. stem partners of changed source files, by the repository's own naming + src_changed = [p for p in inp.changed_paths if not is_test_path(p)] for t in inp.test_map: + tp = str(t.get("test_path") or "") + partners = stem_partners(tp, src_changed) + if partners: + add(tp, STEM_PARTNER, evidence=f"stem of {partners[0]}", src_path=partners[0]) + # 5. the mined test map, most confident first + for t in sorted(inp.test_map, key=lambda r: -float(r.get("confidence") or 0.0)): add( str(t.get("test_path") or ""), TEST_MAP, @@ -254,6 +285,18 @@ def add(test_path: str, why: str, **extra: Any) -> None: src_path=str(t.get("src_path") or ""), confidence=round(float(t.get("confidence") or 0.0), 3), ) + # 6. tests that call other definitions of the edited files, while the list is short: + # about the file, not about any touched definition + for n in inp.neighbors: + if len(rows) >= NEIGHBOR_FILL: + break + callees = int(n.get("callees") or 0) + add( + str(n.get("path") or ""), + FILE_NEIGHBOR, + evidence=f"calls {callees} other definition(s) of the edited files", + callees=callees, + ) # Within a kind: the nearest hop, then the file that links to more of the touched # definitions, then the one with more tests doing so: a module's own test file calls it # from many tests, a bystander from one. @@ -278,7 +321,8 @@ def build_gate(inp: GateInputs) -> Gate: # A touched source definition is `untested` only when a coverage run measured it # unexecuted, and `unlinked` when no run measured it and no call chain links a test to - # it. File-level rows (a neighbour, the test map) say nothing about one definition. + # it. File-level rows (a stem partner, the test map, a neighbour) say nothing about one + # definition. untested: list[dict[str, Any]] = [] unlinked: list[dict[str, Any]] = [] unmeasured = 0 diff --git a/server/code/store/index/edges.py b/server/code/store/index/edges.py index de03b2848dd..ad7c8a7e937 100644 --- a/server/code/store/index/edges.py +++ b/server/code/store/index/edges.py @@ -623,18 +623,21 @@ async def caller_counts( } async def test_files_calling( - self, org: str, ns: str, symbol_ids: list[str], *, limit: int = 30 + self, org: str, ns: str, definitions: dict[str, str], *, limit: int ) -> list[dict[str, Any]]: - """Test files with a live `calls` edge into `symbol_ids` (the first 1,000), each - with how many of them it calls (`callees`), most first, then by path. One grouped - read on the edge table's (org, namespace, tier, to_symbol_id) prefix; the test-path - filter runs before the cap, so production callers take none of it.""" - ids = [s for s in dict.fromkeys(symbol_ids) if s][:1000] + """Test files with a live `calls` edge into `definitions` (edge target id -> the + definition it is an id of; the first 1,000 ids in the caller's order), each with + how many of the definitions it calls (`callees`), most first, then by path. One + grouped read on the edge table's (org, namespace, tier, to_symbol_id) prefix; the + test-path filter runs before the cap, so production callers take none of it.""" + ids = [s for s in definitions if s][:1000] if not ids: return [] rows: list[dict[str, Any]] = await self._ch.query_all( """ - SELECT path, uniqExact(to_symbol_id) AS callees + SELECT path, + uniqExact(transform(to_symbol_id, {ids:Array(String)}, + {names:Array(String)}, to_symbol_id)) AS callees FROM ( SELECT tier, to_symbol_id, from_symbol_id, path, line, argMax(tombstoned_at IS NULL, version) AS is_live @@ -653,6 +656,7 @@ async def test_files_calling( "org": org, "ns": ns, "ids": ids, + "names": [definitions[s] for s in ids], "test_path_pattern": TEST_PATH_PATTERN, "limit": int(limit), }, diff --git a/server/transport/mcp_descriptions.py b/server/transport/mcp_descriptions.py index 1d4481852d2..3e902de2e99 100644 --- a/server/transport/mcp_descriptions.py +++ b/server/transport/mcp_descriptions.py @@ -1343,17 +1343,20 @@ def revision_policy(update: str) -> str: "is listed (`changed_test`: a test you edited; `coverage`: a " "coverage run measured it executing a touched definition; " "`static_call`: a call chain links it to one, named in `links_to`; " - "`file_neighbor`: it calls other definitions of the edited files; " - "`test_map`: mined history about the file) and a `run` command when " - "the harness is derivable from the path (never guessed: run_unknown " - "says so) — `untested`: the touched definitions a coverage run " - "measured unexecuted, and `unlinked`: the ones no coverage run " - "measured and no call chain links a test to. `obligations` is true " - "while `tests` or `untested` is non-empty: run the tests, then rely " - "on green; write a test for the untested rows or say why not. " - "`unlinked` is not proof that no test runs a definition (tests reach " - "code through fixtures and entry points the graph has no edge for): " - "read it as 'the index cannot say'." + "`stem_partner`: named after a file you changed; `test_map`: mined " + "history about the file; `file_neighbor`: it calls other definitions " + "of the edited files, listed only to fill a list shorter than four) " + "and a `run` command when the harness is " + "derivable from the path (never guessed: run_unknown says so) — " + "`untested`: the touched definitions a coverage run measured " + "unexecuted, and `unlinked`: the ones no coverage run measured and " + "no call chain links a test to. `obligations` is true while `tests` " + "or `untested` is non-empty: run the tests; write a test for the " + "untested rows or say why not. A green `stem_partner`, `test_map` or " + "`file_neighbor` test is about the file and may not run the changed " + "code. `unlinked` is not proof that no test runs a definition (tests " + "reach code through fixtures and entry points the graph has no edge " + "for): read it as 'the index cannot say'." ), "code.trace": ( "Paste a stack trace / fatal-log backtrace / sanitizer report and " diff --git a/tests/analyzer/cases/code.py b/tests/analyzer/cases/code.py index 71ad7df865b..63587bc66d0 100644 --- a/tests/analyzer/cases/code.py +++ b/tests/analyzer/cases/code.py @@ -388,7 +388,7 @@ async def _point_readers(ch: RecordingCH, c: dict[str, Any]) -> None: ) await repo.caller_counts(ORG, NS, ["s1", "s2"]) # code.test_gate's file neighbours: the test files calling a file's other definitions - await repo.test_files_calling(ORG, NS, ["s1", "s2"], limit=30) + await repo.test_files_calling(ORG, NS, {"s1": "s1", "s2": "s1"}, limit=4) await repo.coverage_gaps(ORG, NS) await repo.coverage(ORG, NS) await repo.index_errors(ORG, NS, limit=10) diff --git a/tests/analyzer/shapes.txt b/tests/analyzer/shapes.txt index 8ed32c818bf..be69b8fd4d0 100644 --- a/tests/analyzer/shapes.txt +++ b/tests/analyzer/shapes.txt @@ -340,6 +340,7 @@ 27e07e7e4595 ALTER TABLE loom.task_events DELETE WHERE (org = {org:String} AND namespace IN {ns:Array(String)}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? 27eb9abf58ee SELECT count() AS n FROM loom.search_misses WHERE org = {org:String} AND (has({spellings:Array(String)}, asker) OR has({spellings:Array(String)}, lowerUTF8(user_id))) AND ? 280ae87ab0d8 INSERT INTO loom.oauth_signin_state (claim_key, value, expires_at) SETTINGS keeper_map_strict_mode = ?, max_execution_time = ? VALUES ({k:String}, {v:String}, {e:UInt32}) +28100d01f424 SELECT path, uniqExact(transform(to_symbol_id, {ids:Array(String)}, {names:Array(String)}, to_symbol_id)) AS callees FROM ( SELECT tier, to_symbol_id, from_symbol_id, path, line, argMax(tombstoned_at 2847ee772f55 SELECT count() AS n FROM loom.memory_code_links WHERE org = {org:String} AND namespace = {ns:String} AND agent = {a:String} AND user_id = {u:String} AND session_id = {s:String} AND memory_key = {k:Str 28541ece7d0e ALTER TABLE loom.memory_embeddings UPDATE tombstoned_at = {now:DateTime} WHERE (org = {org:String} AND tombstoned_at IS NULL AND has(tags, ?) AND hasAny(tags, {src:Array(String)}) AND hasAny(arrayMap( 2869ad9e327d SELECT e.memory_key AS memory_key, e.memory_type AS memory_type, e.content_excerpt AS content_excerpt, e.status AS status, e.version AS version, cosineDistance(e.embedding, {q:Array(Float32)}) AS dist @@ -1064,7 +1065,6 @@ 7ba38135d909 WITH (SELECT toFloat64(count()) FROM loom.memory_embeddings FINAL WHERE org = {org:String} AND namespace = {ns:String} AND tombstoned_at IS NULL) AS n_keys, (SELECT mapFromArrays(groupArray(s), groupA 7baded054596 SELECT count() AS n FROM loom.knowledge_ingestions WHERE org = {org:String} AND namespace = {ns:String} AND ? 7bb1d4059098 SELECT (SELECT count() FROM ( SELECT e.org AS org, e.namespace AS namespace, e.memory_key AS memory_key FROM ( SELECT org, namespace, agent, user_id, memory_key FROM loom.entity_vectors FINAL WHERE to -7bb3901d8e50 SELECT path, uniqExact(to_symbol_id) AS callees FROM ( SELECT tier, to_symbol_id, from_symbol_id, path, line, argMax(tombstoned_at IS NULL, version) AS is_live FROM loom.code_edges WHERE org = {org:St 7bb9d891b190 SELECT thread_id, msg_id, role, content_excerpt AS embedded_text, ts, cosineDistance(embedding, {q:Array(Float32)}) AS distance FROM loom.conversation_embeddings FINAL WHERE org = {org:String} AND nam 7bcba9ce8741 SELECT state_value FROM loom.code_index_state FINAL WHERE org = {org:String} AND namespace = {ns:String} AND state_key = ? LIMIT ? 7c06e9fdda88 ALTER TABLE loom.knowledge_uploads DELETE WHERE (org = {org:String} AND namespace = {ns:String}) AND ({erasure_mutation_tag:String} = {erasure_mutation_tag:String}) SETTINGS mutations_sync = ? diff --git a/tests/unit/test_code_epistemic_envelope.py b/tests/unit/test_code_epistemic_envelope.py index 288c6235966..c9606e1b819 100644 --- a/tests/unit/test_code_epistemic_envelope.py +++ b/tests/unit/test_code_epistemic_envelope.py @@ -179,7 +179,7 @@ async def functions_for_paths(self, org, ns, paths, *, limit=400, **_kw): async def test_map_for(self, org, ns, paths, *, limit=30): return [] - async def test_files_calling(self, org, ns, ids, *, limit=30): + async def test_files_calling(self, org, ns, definitions, *, limit): return [] async def coverage_files_for(self, org, ns, paths): diff --git a/tests/unit/test_code_test_gate.py b/tests/unit/test_code_test_gate.py index ecdeb2595cb..9679f49fe3e 100644 --- a/tests/unit/test_code_test_gate.py +++ b/tests/unit/test_code_test_gate.py @@ -76,6 +76,15 @@ def test_run_overrides_win_and_bad_json_is_ignored() -> None: ) +def test_stem_partners_follow_the_worker_rule() -> None: + srcs = ["src/Storages/MergeTree/MergeTreeData.cpp", "src/IO/io.cpp", "server/foo.py"] + assert tg.stem_partners("src/Storages/MergeTree/tests/gtest_merge_tree_data.cpp", srcs) == [] + assert tg.stem_partners("src/Storages/tests/gtest_mergetreedata.cpp", srcs) == [srcs[0]] + assert tg.stem_partners("tests/unit/test_foo.py", srcs) == ["server/foo.py"] + # short stems never match: "io" is inside everything + assert tg.stem_partners("tests/unit/test_io.py", srcs) == [] + + def _touched(sid: str, path: str, name: str = "f") -> dict[str, Any]: return {"symbol_id": sid, "qualified_name": name, "path": path, "start_line": 1} @@ -90,10 +99,11 @@ def test_build_gate_orders_by_evidence_and_dedupes() -> None: touched=[_touched("s1", "src/alpha.py", "alpha"), _touched("s2", "src/b.py", "b")], impacted={ "t1": _node("test_b_hop", "tests/unit/test_hop.py", 2, ["s2"]), + "t2": _node("test_m", "tests/unit/test_mapped.py", 1, ["s1"]), "c1": _node("caller", "src/c.py", 1, ["s1"]), }, test_map=[ - {"test_path": "tests/unit/test_hop.py", "src_path": "src/b.py", "confidence": 0.4}, + {"test_path": "tests/unit/test_mapped.py", "src_path": "src/b.py", "confidence": 0.4}, { "test_path": "tests/unit/test_alpha.py", "src_path": "src/alpha.py", @@ -109,26 +119,95 @@ def test_build_gate_orders_by_evidence_and_dedupes() -> None: coverage=[{"test_path": "tests/unit/test_ran.py", "roots": ["s1"]}], ) g = tg.build_gate(inp) + # Five rows are about the change, so no file neighbour is listed. assert [(r["test_path"], r["why"]) for r in g.tests] == [ ("tests/unit/test_zeta.py", "changed_test"), ("tests/unit/test_ran.py", "coverage"), + ("tests/unit/test_mapped.py", "static_call"), ("tests/unit/test_hop.py", "static_call"), - ("tests/unit/test_near.py", "file_neighbor"), - ("tests/unit/test_alpha.py", "test_map"), + ("tests/unit/test_alpha.py", "stem_partner"), ] # A test file keeps its first (strongest) evidence: the changed test is also in the - # map, and the call chain's test is also a neighbour and in the map. + # map, and a test a call chain links names its definition, whatever the map says of it. assert g.tests[0]["evidence"] == "in the diff" assert g.tests[1]["links_to"] == ["alpha"] - hop = g.tests[2] + assert g.tests[2]["links_to"] == ["alpha"] and "src_path" not in g.tests[2] + hop = g.tests[3] assert hop["hop"] == 2 and hop["evidence"] == "test_b_hop reaches the change in 2 hop(s)" - assert hop["links_to"] == ["b"] and hop["callers"] == 1 and hop["confidence"] == 0.8 + assert hop["links_to"] == ["b"] and hop["callers"] == 1 and "confidence" not in hop assert hop["run"] == "pytest tests/unit/test_hop.py" and hop["run_unknown"] is False - assert g.tests[3]["callees"] == 3 and g.tests[4]["src_path"] == "src/alpha.py" + assert g.tests[4]["src_path"] == "src/alpha.py" and "confidence" not in g.tests[4] assert g.tests_total == 5 and g.untested == [] and g.unlinked == [] assert g.obligations is True +def test_a_map_row_follows_the_call_chain_rows_and_its_stem_partner() -> None: + g = tg.build_gate( + tg.GateInputs( + changed_paths=["src/alpha.py"], + touched=[_touched("s1", "src/alpha.py", "alpha")], + impacted={"t": _node("test_x", "tests/unit/test_chain.py", 1, ["s1"])}, + test_map=[ + { + "test_path": "tests/unit/test_low.py", + "src_path": "src/alpha.py", + "confidence": 0.2, + }, + { + "test_path": "tests/unit/test_high.py", + "src_path": "src/alpha.py", + "confidence": 0.9, + }, + { + "test_path": "tests/unit/test_alpha.py", + "src_path": "src/alpha.py", + "confidence": 0.1, + }, + ], + ) + ) + assert [(r["test_path"], r["why"]) for r in g.tests] == [ + ("tests/unit/test_chain.py", "static_call"), + ("tests/unit/test_alpha.py", "stem_partner"), + ("tests/unit/test_high.py", "test_map"), + ("tests/unit/test_low.py", "test_map"), + ] + assert g.tests[2]["confidence"] == 0.9 + + +def test_file_neighbours_fill_a_short_list_and_take_no_rows_place() -> None: + """Thirty neighbour files beside one test-map row: the map row is listed, and the + neighbours fill the list to four, whatever the page limit.""" + neighbors = [{"path": f"tests/test_n{i:02}.py", "callees": 30 - i} for i in range(30)] + mapped = {"test_path": "tests/test_history.py", "src_path": "src/a.py", "confidence": 0.3} + + def gate(**kw: Any) -> tg.Gate: + return tg.build_gate( + tg.GateInputs( + changed_paths=["src/a.py"], + touched=[_touched("s1", "src/a.py", "a")], + impacted=kw.get("impacted", {}), + test_map=kw.get("test_map", []), + neighbors=neighbors, + limit=30, + ) + ) + + g = gate(test_map=[mapped]) + assert [(r["test_path"], r["why"]) for r in g.tests] == [ + ("tests/test_history.py", "test_map"), + ("tests/test_n00.py", "file_neighbor"), + ("tests/test_n01.py", "file_neighbor"), + ("tests/test_n02.py", "file_neighbor"), + ] + assert g.tests_total == 4 and g.tests[1]["callees"] == 30 + # With nothing else known the four neighbours that call the most of the file are the lead. + assert [r["test_path"] for r in gate().tests] == [f"tests/test_n0{i}.py" for i in range(4)] + # Four tests a call chain links leave room for none. + linked = {f"t{i}": _node(f"test_{i}", f"tests/test_linked_{i}.py", 1, ["s1"]) for i in range(4)} + assert {r["why"] for r in gate(impacted=linked).tests} == {"static_call"} + + def test_static_rows_put_the_file_with_more_links_and_more_tests_first() -> None: """Within a hop, the file whose tests link to more of the touched definitions is first, then the one with more tests doing so: a module's own test file before a bystander.""" @@ -155,7 +234,6 @@ def test_static_rows_put_the_file_with_more_links_and_more_tests_first() -> None assert by_path["tests/test_b.py"]["links_to"] == ["m::A::__init__", "m::f"] assert by_path["tests/test_a.py"]["callers"] == 2 assert by_path["tests/test_a.py"]["via"] == "constructor" - assert by_path["tests/test_a.py"]["confidence"] == 0.9 assert "via" not in by_path["tests/test_b.py"] @@ -279,6 +357,7 @@ def __init__(self) -> None: } self.neighbors: list[dict[str, Any]] = [] self.neighbor_ids: list[str] = [] + self.neighbor_definitions: dict[str, str] = {} self.coverage_files: dict[str, dict[str, Any]] = {} self.coverage_rows: list[dict[str, Any]] = [] self.kinds: tuple[str, ...] = () @@ -294,8 +373,9 @@ async def edges_for_symbols( assert direction == "callers" return [e for sid in ids for e in self.callers.get(sid, [])] - async def test_files_calling(self, org, ns, ids, *, limit=30): - self.neighbor_ids = list(ids) + async def test_files_calling(self, org, ns, definitions, *, limit): + self.neighbor_ids = list(definitions) + self.neighbor_definitions = dict(definitions) return self.neighbors[:limit] async def test_map_for(self, org, ns, paths, *, limit=30): @@ -357,11 +437,11 @@ async def test_handler_diff_shape_walks_roots_to_tests(intel) -> None: assert repo.kinds == ("function", "method", "fixture", "class") # the neighbours are asked for the file's other definitions only assert repo.neighbor_ids == ["sB"] - assert [t["why"] for t in out.tests] == ["static_call", "file_neighbor", "test_map"] + assert [t["why"] for t in out.tests] == ["static_call", "test_map", "file_neighbor"] assert out.tests[0]["test_path"] == "src/tests/gtest_parts.cpp" assert out.tests[0]["hop"] == 2 and out.tests[0]["run_unknown"] is True assert out.tests[0]["links_to"] == ["DB::A::f"] - assert out.tests[2]["run"] == "tests/clickhouse-test 01234_a" + assert out.tests[1]["run"] == "tests/clickhouse-test 01234_a" # a call chain links a test to f; nothing was measured assert out.untested == [] and out.unlinked == [] and out.obligations is True assert out.tests_total == 3 and out.counts_floor is True @@ -520,6 +600,51 @@ async def test_a_coverage_run_decides_untested_and_makes_the_answer_measured(int assert out.tests[0]["why"] == "coverage" and out.tests[0]["links_to"] == ["pkg.w::helper"] +async def test_a_one_line_compiler_row_is_measured_on_the_parser_rows_body(intel) -> None: + """The compiler tier may hold a definition as its declaration line only. Whether that + line ran says nothing about the body: the run is read against the parser row's extent, + and a definition with no extent wider than a line is not measured.""" + repo = _py_repo() + repo.symbols = [ + _sym("fH", "pkg.w::helper", "pkg/w.py", 44, 44), + {**_sym("pH", "pkg.w::helper", "pkg/w.py", 44, 50), "tier": "treesitter"}, + _sym("fS", "pkg.w::stub", "pkg/w.py", 60, 60), + ] + # the body of helper ran (46-48), its declaration line did not; line 60 ran + repo.coverage_files = { + "pkg/w.py": {"commit_sha": "c" * 40, "lines": "[[46, 48], [60, 60]]", "tests": 1} + } + out = await _gate(intel, repo, diff=_one_line("pkg/w.py", 47)) + assert [t["qualified_name"] for t in out.touched_symbols] == ["pkg.w::helper"] + assert out.untested == [] and out.epistemic == "measured" + + out = await _gate(intel, repo, diff=_one_line("pkg/w.py", 60)) + assert [t["qualified_name"] for t in out.touched_symbols] == ["pkg.w::stub"] + assert out.untested == [] and out.epistemic == "lower_bound" + assert "no_coverage" in out.causes + + +async def test_measured_needs_every_changed_source_file_to_touch_a_definition(intel) -> None: + """A coverage run settled every definition of one file; the other changed file holds + no definition the index knows, so the change was not measured as a whole.""" + repo = _py_repo() + repo.coverage_files = {"pkg/w.py": {"commit_sha": "c" * 40, "lines": "[[1, 99]]", "tests": 2}} + out = await _gate(intel, repo, files=["pkg/w.py"]) + assert out.epistemic == "measured" and out.untested == [] + out = await _gate(intel, repo, files=["pkg/w.py", "pkg/script.py"]) + # the index holds nothing of the second file, which is the graph's own cause too + assert out.epistemic == "lower_bound" + assert out.causes == ["external_calls", "unmapped_changes"] + + +async def test_a_neighbour_counts_a_definition_both_tiers_hold_once(intel) -> None: + repo = _py_repo() + repo.symbols[3] = {**repo.symbols[3], "tier_ids": ["fH", "pH"]} + await _gate(intel, repo, diff=_one_line("pkg/w.py", 30)) + # every id of a definition stands for that definition, in path and line order + assert repo.neighbor_definitions == {"cW": "cW", "mI": "mI", "fH": "fH", "pH": "fH"} + + async def test_a_coverage_run_of_another_revision_measures_nothing(intel) -> None: repo = _py_repo() repo.coverage_files = {"pkg/w.py": {"commit_sha": "d" * 40, "lines": "[]", "tests": 2}} diff --git a/tests/unit/test_code_trace_and_diff_impact.py b/tests/unit/test_code_trace_and_diff_impact.py index 6d53c591b46..55142aa12d4 100644 --- a/tests/unit/test_code_trace_and_diff_impact.py +++ b/tests/unit/test_code_trace_and_diff_impact.py @@ -8,7 +8,12 @@ from __future__ import annotations -from server.code.app.symbol.diff import Hunk, _parse_unified_diff_full, _touched_rows_for_diff +from server.code.app.symbol.diff import ( + Hunk, + Insertion, + _parse_unified_diff_full, + _touched_rows_for_diff, +) from server.code.app.symbol.trace import _parse_trace_frames _GDB_TRACE = """ @@ -71,7 +76,8 @@ def test_a_hunk_shorter_than_its_counts_does_not_swallow_the_next_file() -> None diff = one.format(p="src/A.cpp", n=12) + one.format(p="tests/t.sql", n=1) + "+++ b/src/B.cpp\n" ranges, _, changes = _parse_unified_diff_full(diff) assert list(ranges) == ["src/A.cpp", "tests/t.sql", "src/B.cpp"] - assert changes["src/A.cpp"] == [Hunk("f", (), (11,))] and changes["src/B.cpp"] == [] + assert changes["src/A.cpp"] == [Hunk("f", (), (Insertion(11),))] + assert changes["src/B.cpp"] == [] def test_diff_parse_tolerates_garbage() -> None: @@ -110,7 +116,7 @@ def test_diff_parse_old_side_changes_skip_context_lines() -> None: _, names, changes = _parse_unified_diff_full(_CONTEXT_DIFF) first, second = changes["pkg/m.py"] assert names["pkg/m.py"] == {"before", "other"} - assert first == Hunk("before", ((12, 13),), (14,)) + assert first == Hunk("before", ((12, 13),), (Insertion(14),)) assert second == Hunk("other", ((41, 41),), ()) @@ -126,12 +132,42 @@ def test_a_hunk_sent_without_its_lines_changes_what_its_header_says() -> None: ) _, _, sent = _parse_unified_diff_full(headers) assert sent == { - "a.py": [Hunk("f", ((12, 14),), ()), Hunk("", (), (20,))], + "a.py": [Hunk("f", ((12, 14),), ()), Hunk("", (), (Insertion(20),))], "b.py": [Hunk("", ((7, 7),), ())], } assert _parse_unified_diff_full(whole)[2] == sent +def test_added_text_says_whether_it_decorates_or_continues_the_line_above() -> None: + """With its lines, a hunk says what an insertion is: decorators only, or text indented + as deep as the old line above it. A hunk sent without its lines says neither.""" + diff = """\ ++++ b/pkg/m.py +@@ -9,2 +9,3 @@ + ++@cached + def f(): +@@ -20,2 +21,4 @@ def f(): + return 1 ++ # appended to f ++ x = 2 + +@@ -29,2 +32,5 @@ + ++@cached ++def new(): ++ pass + def g(): +""" + _, _, changes = _parse_unified_diff_full(diff) + assert [h.inserted for h in changes["pkg/m.py"]] == [ + (Insertion(9, decorates=True),), + (Insertion(20, continues=True),), + # a decorated function added above g is not a decorator of g + (Insertion(29),), + ] + + def _row(sid: str, name: str, start: int, end: int, kind: str = "function") -> dict: return { "symbol_id": sid, @@ -169,19 +205,49 @@ def test_a_changed_line_touches_the_innermost_definition_only() -> None: assert _touched(Hunk("", ((19, 22),), ())) == (["m::C", "m::C::as_sql", "m::C::other"], 0) -def test_an_insertion_sits_between_two_lines_or_directly_above_a_definition() -> None: - assert _touched(Hunk("", (), (15,))) == (["m::C::as_sql"], 0) +def test_an_insertion_sits_in_the_definition_that_holds_both_lines_around_it() -> None: + assert _touched(Hunk("", (), (Insertion(15),))) == (["m::C::as_sql"], 0) # after a method's last line: between that method and the next, so the class - assert _touched(Hunk("", (), (20,))) == (["m::C"], 0) - # directly above a definition's first line and inside no other: a decorator - assert _touched(Hunk("", (), (69,))) == (["m::D"], 0) + assert _touched(Hunk("", (), (Insertion(20),))) == (["m::C"], 0) # above a method, the line is the class's: a method added there is not the one below - assert _touched(Hunk("", (), (11,))) == (["m::C"], 0) + assert _touched(Hunk("", (), (Insertion(11),))) == (["m::C"], 0) + # directly above a top-level definition and inside no other: a new definition the + # index does not hold, so the one below is not touched + assert _touched(Hunk("", (), (Insertion(69),))) == ([], 1) + + +def test_added_text_places_an_insertion_the_line_numbers_cannot() -> None: + # decorators edit the definition that starts on the next line + assert _touched(Hunk("", (), (Insertion(69, decorates=True),))) == (["m::D"], 0) + assert _touched(Hunk("", (), (Insertion(11, decorates=True),))) == (["m::C::as_sql"], 0) + # Python text as deep as the line above continues the definition that line ends: the + # method, and for two definitions ending on one line the inner one + assert _touched(Hunk("", (), (Insertion(20, continues=True),))) == (["m::C::as_sql"], 0) + assert _touched(Hunk("", (), (Insertion(26, continues=True),))) == (["m::C::other::inner"], 0) + # where indentation is not the block structure it says nothing + rows = [{**r, "path": "src/m.cpp"} for r in _ROWS] + touched, _, _ = _touched_rows_for_diff( + rows, {"src/m.cpp": [Hunk("", (), (Insertion(20, continues=True),))]} + ) + assert [r["qualified_name"] for r in touched] == ["m::C"] def test_lines_in_no_definition_are_counted_and_a_header_does_not_claim_them() -> None: # module level, after C: the header names the function above, whose body ended - assert _touched(Hunk("as_sql", ((64, 65),), (66,))) == ([], 3) + assert _touched(Hunk("as_sql", ((64, 65),), (Insertion(66),))) == ([], 3) # a header may claim any range: only the lines inside the file's definitions are walked names, unmapped = _touched(Hunk("", ((1, 10**9),), ())) assert names == [r["qualified_name"] for r in _ROWS] and unmapped == 10**9 - 72 + + +def test_overlapping_hunks_cost_one_walk_of_the_file() -> None: + """A headers-only diff may hold thousands of hunks that each claim most of a large + file. Their ranges are merged before the walk: the touched set is what one hunk over + the same lines gives, and each line is counted once.""" + rows = [_row(f"f{i}", f"m::f{i}", 1 + 50 * i, 40 + 50 * i) for i in range(2_000)] + hunks = [Hunk("", ((1 + i, 100_000),), ()) for i in range(10_000)] + touched, _, unmapped = _touched_rows_for_diff(rows, {"pkg/m.py": hunks}) + assert len(touched) == 2_000 and unmapped == 100_000 - 2_000 * 40 + # a hunk whose lines sit in no definition does not hide behind the others + gap = Hunk("", ((41, 50),), (Insertion(45),)) + assert _touched_rows_for_diff(rows, {"pkg/m.py": [gap] * 3})[2] == 11 diff --git a/tests/unit/test_hook_diff_headers.py b/tests/unit/test_hook_diff_headers.py index 46e33a7f415..c32b9af5f8d 100644 --- a/tests/unit/test_hook_diff_headers.py +++ b/tests/unit/test_hook_diff_headers.py @@ -84,7 +84,8 @@ def test_the_server_reads_the_same_ranges_and_names(tmp_path: Path) -> None: assert _parse_unified_diff_full(sent) == _parse_unified_diff_full(diff) ranges, names, changes = _parse_unified_diff_full(sent) # the first hunk replaces old line 10, the new file's hunk inserts at its top - assert (changes["src/a.cpp"][0].removed, changes["n.py"][0].inserted) == (((10, 10),), (0,)) + assert changes["src/a.cpp"][0].removed == ((10, 10),) + assert [ins.after for ins in changes["n.py"][0].inserted] == [0] assert { "PrivateKey::verify", "Foo::bar", From 50e06cccd5cc8361b276f1847f42887b1a59faf7 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Sat, 28 Nov 2026 21:02:39 +0530 Subject: [PATCH 4/6] A hunk header names the nearest same-named definition above it, found by bisection The fallback for a hunk whose lines sit in no definition walked every row of the file for each hunk. Rows are grouped by bare name in line order, so a headers-only diff of thousands of hunks costs a bisection each. Co-Authored-By: Claude Fable 5.2 Signed-off-by: Lareb Zafar --- server/code/app/symbol/diff.py | 28 +++++++++++-------- tests/unit/test_code_trace_and_diff_impact.py | 15 ++++++++++ 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/server/code/app/symbol/diff.py b/server/code/app/symbol/diff.py index be6e4335453..6d0c87908f8 100644 --- a/server/code/app/symbol/diff.py +++ b/server/code/app/symbol/diff.py @@ -211,6 +211,10 @@ def _name_matches(qualified: str, header_name: str) -> bool: return False +def _bare(name: str) -> str: + return name.rsplit("::", 1)[-1] + + def _span(r: dict[str, Any]) -> tuple[int, int]: start = int(r["start_line"] or 0) return start, max(start, int(r["end_line"] or 0)) @@ -256,12 +260,13 @@ def __init__(self, rows: list[dict[str, Any]], hunks: list[Hunk], *, indented: b self.ends = {_span(r)[1]: r for r in self.rows} gaps = sorted({ins.after for h in hunks for ins in h.inserted}) self.holders = _innermost(self.rows, gaps, gap=True) - # Rows the index holds no body extent for (a compiler row of one line), by bare name. - self.stubs: dict[str, list[dict[str, Any]]] = {} - for r in self.rows: - if _span(r)[0] == _span(r)[1]: - bare = str(r["qualified_name"]).rsplit("::", 1)[-1] - self.stubs.setdefault(bare, []).append(r) + # Rows by bare name in line order, with their start lines: a hunk header names a + # definition, and the nearest one above the hunk is found by bisection. + self.named: dict[str, tuple[list[int], list[dict[str, Any]]]] = {} + for r in sorted(self.rows, key=lambda r: _span(r)[0]): + starts, same = self.named.setdefault(_bare(str(r["qualified_name"])), ([], [])) + starts.append(_span(r)[0]) + same.append(r) def inserted_in(self, ins: Insertion) -> dict[str, Any] | None: """The definition an insertion edits. It sits between two old lines and is inside @@ -290,12 +295,11 @@ def header_row(self, hunk: Hunk) -> dict[str, Any] | None: nearest same-named row above the hunk, and only one the index holds no body extent for, where line numbers cannot tell.""" first = min([a for a, _ in hunk.removed] + [ins.after for ins in hunk.inserted], default=0) - above = [ - r - for r in self.stubs.get(hunk.name.rsplit("::", 1)[-1], []) - if _name_matches(str(r["qualified_name"]), hunk.name) and _span(r)[0] <= first - ] - return max(above, key=lambda r: _span(r)[0]) if above else None + starts, same = self.named.get(_bare(hunk.name), ([], [])) + for r in reversed(same[: bisect_right(starts, first)]): + if _name_matches(str(r["qualified_name"]), hunk.name): + return r if _span(r)[0] == _span(r)[1] else None + return None def edited(self, hunks: list[Hunk]) -> tuple[list[dict[str, Any]], int]: """(the rows the hunks edit, their changed lines that sit in none). The edited diff --git a/tests/unit/test_code_trace_and_diff_impact.py b/tests/unit/test_code_trace_and_diff_impact.py index 55142aa12d4..32314b8290f 100644 --- a/tests/unit/test_code_trace_and_diff_impact.py +++ b/tests/unit/test_code_trace_and_diff_impact.py @@ -240,6 +240,21 @@ def test_lines_in_no_definition_are_counted_and_a_header_does_not_claim_them() - assert names == [r["qualified_name"] for r in _ROWS] and unmapped == 10**9 - 72 +def test_a_header_names_only_the_nearest_definition_above_and_only_one_without_a_body() -> None: + rows = [_row("d", "m::f", 5, 5), _row("b", "m::f", 30, 40)] + + def via(first: int) -> list[tuple[str, str]]: + touched, _, _ = _touched_rows_for_diff( + rows, {"pkg/m.py": [Hunk("f", ((first, first),), ())]} + ) + return [(r["symbol_id"], r["via"]) for r in touched] + + # below a one-line row the index holds no body of: the header is all there is + assert via(10) == [("d", "header")] + # below the definition with a body, the name is that one's, and its body ended + assert via(50) == [] + + def test_overlapping_hunks_cost_one_walk_of_the_file() -> None: """A headers-only diff may hold thousands of hunks that each claim most of a large file. Their ranges are merged before the walk: the touched set is what one hunk over From a6c2c82999c15bb621954daf0b6441670d23f07e Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Sat, 28 Nov 2026 22:28:41 +0530 Subject: [PATCH 5/6] The test gate reads a coverage run against a definition's body lines, keeps same-named definitions apart and orders coverage rows by call chain and specificity - A coverage run is read against the lines after the first of every extent a tier holds of a definition at the run's commit. The first line is the declaration, which runs when the module is imported, under whichever test imports it first. The extents are matched by id in the read that carries their parsing commit, so tiers parsed at different commits are measured on the extent the run's commit holds. - Touched rows are no longer folded by qualified name. The store already folds the two tiers' rows of one definition where their spans coincide; rows that share a name and sit apart (a property's getter and setter) are different definitions, touched and measured apart. - A `coverage` row carries the specificity of its test-map row as `confidence`, and the test name, `hop`, `callers` and `via` of a call chain that links the file too. Within a kind a chain-linked file is first, then the more specific row. - `truncated` is also a cause when the read of the coverage rows was cut. - The wire comment, the feature page and the skill reference say that a `static_call` test is linked by a call chain and usually, not always, runs the definition, and that a change of test files only is `lower_bound` with no cause. Co-Authored-By: Claude Fable 5.2 Signed-off-by: Lareb Zafar --- docs/features/code-index/operations.md | 31 ++- docs/reference/operations/code.md | 4 +- .../skills/loom-code/reference.md | 2 +- .../skills/loom-code/reference.md | 2 +- server/code/api/models_testing.py | 43 +++-- server/code/app/coverage_freshness.py | 62 +++--- server/code/app/symbol/diff.py | 36 ++-- server/code/app/symbol/gate.py | 4 +- server/code/app/symbol/test_links.py | 91 +++++---- server/code/domain/index/test_gate.py | 53 ++++-- server/code/store/index/coverage.py | 7 +- tests/unit/test_code_impact_dispatch.py | 28 +-- tests/unit/test_code_test_gate.py | 180 ++++++++++++++++-- 13 files changed, 377 insertions(+), 166 deletions(-) diff --git a/docs/features/code-index/operations.md b/docs/features/code-index/operations.md index 3173f42910f..18e90c55a8b 100644 --- a/docs/features/code-index/operations.md +++ b/docs/features/code-index/operations.md @@ -478,7 +478,10 @@ Each row of `tests` is one test file with the kind of evidence in `why`, stronge - `changed_test`: the file is in the diff. It says nothing about a touched definition; a changed test runs. - `coverage`: an imported coverage run the index verified measured the file executing a - touched definition, named in `links_to`. + touched definition, named in `links_to`. `confidence` is the specificity of the test-map + row that says so: how few tests share the most specific line the file's tests run. When + a call chain links the file too, `evidence` names the chain's test and the row carries + its `hop`, `callers` and `via`. - `static_call`: a call chain links one of the file's tests to a touched definition (`links_to`), with the nearest `hop` and how many of its tests do (`callers`). - `stem_partner`: the file's name holds the stem of an edited file (`test_foo.py` for @@ -493,28 +496,38 @@ Each row of `tests` is one test file with the kind of evidence in `why`, stronge A `static_call` row carries `via` when the chain does not start at the definition itself: `constructor` (the test calls the class of a touched `__init__` or `__new__`), `enclosing` (it calls the function a touched nested function is defined in) or `fixture` (it reaches -through a fixture). Within a kind the nearest hop is first, then the file linked to more -of the touched definitions, then the one with more tests doing so. A test file is listed -once, under its strongest kind. +through a fixture). Within a kind a file a call chain names a test in is first, the +nearest hop before the others, then the file linked to more of the touched definitions, +then the one with more tests doing so, then the more specific `coverage` row. A test file +is listed once, under its strongest kind. The touched definitions land in two lists with different meanings: - `untested` holds the definitions an imported coverage run measured unexecuted, with the - run's `commit`. It is empty unless such a run exists at a revision the index verified. A - definition the index holds only a one-line extent for is never measured: whether its - declaration line ran says nothing about its body. + run's `commit`. It is empty unless such a run exists at a revision the index verified. + The run is read against a definition's body: the lines after the first of every extent + a tier holds of it at the run's commit. The first line is the declaration, which runs + when the module is imported, under whichever test imports it first; whether it ran says + nothing about the body, so a definition the index holds only a one-line extent for is + never measured. The statements of a class body also run at import: a class reads + executed when a test is the first to import its module. Definitions that share a name in + one file, such as a property's getter and setter, are touched and measured apart. - `unlinked` holds the definitions no coverage run measured and no call chain links a test to. It does not say that no test runs them: tests reach code through fixtures, string-dispatched entry points and public APIs the call graph holds no edge for. A `stem_partner`, `test_map` or `file_neighbor` row never takes a definition off this list. `obligations` is true while `tests` or `untested` is non-empty. A green test says as much -as its row's `why`: a `coverage` or `static_call` test ran against a touched definition, a +as its row's `why`: a `coverage` test was measured executing a touched definition; a +`static_call` test is linked to one by a call chain and usually, not always, runs it; a `stem_partner`, `test_map` or `file_neighbor` test is about the file and may not run the changed code. `epistemic` is `measured` when a verified coverage run settled every touched definition, every changed line sat in one and every changed source file touched one, and `lower_bound` otherwise; the op never answers `exact`. `causes` lists what limits the -answer under either value: the call graph's own causes limit `tests`. +answer under either value: the call graph's own causes limit `tests`, and `truncated` also +says that the read of the coverage rows was cut. A change of test files only touches no +source definition: it is `lower_bound` with no cause, because the gate lists the changed +tests and does not look for the tests that use a changed test helper. ## History, PRs and releases diff --git a/docs/reference/operations/code.md b/docs/reference/operations/code.md index eb4dc5665d1..716e3bb5d5b 100644 --- a/docs/reference/operations/code.md +++ b/docs/reference/operations/code.md @@ -1743,7 +1743,7 @@ The pre-PR question in one call: for THIS change, which tests must run, and whic | `unlinked` | `list[dict[str, Any]]` | Touched source definitions no coverage run measured and no call chain links a test to: {qualified_name, path, start_line}. | | `changed_files` | `list[str]` | The change as the gate saw it. | | `touched_symbols` | `list[dict[str, Any]]` | The source definitions the change touches, {qualified_name, path, start_line, tier}, by path and line (first 200). | -| `obligations` | `bool` | True while `tests` or `untested` is non-empty: run the tests, whose green says as much as each row's `why` (a `coverage` or `static_call` test ran against a touched definition; a `stem_partner`, `test_map` or `file_neighbor` test is about… | +| `obligations` | `bool` | True while `tests` or `untested` is non-empty: run the tests, whose green says as much as each row's `why` (a `coverage` test was measured executing a touched definition; a `static_call` test is linked to one by a call chain and usually… | | `tests_total` | `int` | Rows of `tests` before `limit`. | | `untested_total` | `int` | Rows of `untested` before `limit`. | | `unlinked_total` | `int` | Rows of `unlinked` before `limit`. | @@ -1752,7 +1752,7 @@ The pre-PR question in one call: for THIS change, which tests must run, and whic | `unlinked_capped` | `bool` | True when `limit` cut `unlinked` short of `unlinked_total`. | | `counts_floor` | `bool` | Same epistemic contract as code.callers: the graph is a floor, so a test missing from `tests` is one the index cannot see. | | `epistemic` | `str` | `measured` when a verified coverage run settled every touched definition, every changed line sat in one and every changed source file touched one; otherwise `lower_bound`. | -| `causes` | `list[str]` | What limits the answer, from code.callers' causes (unresolved_calls, ambiguous_calls, treesitter_only_files, external_calls, truncated: a hop read hit its row limit), which limit `tests` under either `epistemic`, and two of its own that… | +| `causes` | `list[str]` | What limits the answer, from code.callers' causes (unresolved_calls, ambiguous_calls, treesitter_only_files, external_calls, truncated: a hop read or the read of the coverage rows hit its limit), which limit `tests` under either… | | `by_hop_counts` | `dict[int, int]` | Distinct symbols reached per hop BEFORE any slicing: {1: n, 2: m}. | | `trace_run_id` | `str` | Id of this call's row in `loom.code_search_trace`. | diff --git a/integrations/claude-code-plugin/skills/loom-code/reference.md b/integrations/claude-code-plugin/skills/loom-code/reference.md index 501b922f97b..f5c0486159d 100644 --- a/integrations/claude-code-plugin/skills/loom-code/reference.md +++ b/integrations/claude-code-plugin/skills/loom-code/reference.md @@ -31,7 +31,7 @@ that needs no thought. Catch these: | Answer "**who calls X**" by grepping the name | `code.callers` | compiler-exact (scip tier); grep cannot tell a call from a comment, string, or same-named overload | | Judge "**is it safe to change X**" | `code.impact` | transitive radius + tests that reach it + files that usually co-change | | Review your **own uncommitted diff** before finishing | `code.impact` with `files=[...]` and/or `diff=` | the index can't see your working tree, but it computes what the diff touches against the base graph — blast radius, tests to run, and co-change partners your change did NOT touch | -| Say **"done"** on a change without naming its tests | `code.test_gate` with `files=[...]` and/or `diff=` | the tests to run in evidence order — a test you edited, a test a coverage run measured executing a touched definition, a test a call chain links to one, the stem partner of a file you changed, the mined test map, and with fewer than four of those the tests that call other definitions of the edited files — each with a `run` command when derivable (never guessed), plus `untested`: touched definitions a coverage run measured unexecuted, and `unlinked`: ones the index links no test to (not proof that none runs them). Run the tests (only a `coverage` or `static_call` test is known to run the changed code); write a test for the untested rows or say why not | +| Say **"done"** on a change without naming its tests | `code.test_gate` with `files=[...]` and/or `diff=` | the tests to run in evidence order — a test you edited, a test a coverage run measured executing a touched definition, a test a call chain links to one, the stem partner of a file you changed, the mined test map, and with fewer than four of those the tests that call other definitions of the edited files — each with a `run` command when derivable (never guessed), plus `untested`: touched definitions a coverage run measured unexecuted, and `unlinked`: ones the index links no test to (not proof that none runs them). Run the tests (a `coverage` test was measured executing the changed code, a `static_call` test is linked to it by a call chain and usually, not always, runs it, the other kinds are about the file); write a test for the untested rows or say why not | | Run **`gh pr create`** on a change | `code.pr_check` with the title, body, changed paths, symbols and the issues it closes | a verdict over loom's PR ledgers — `duplicate_of` when an open PR is already doing this or a merged one already did (check main before you push), `related` to read first, `none` to open it — each item with state and evidence lines (files shared, same issue closed, a backport of yours); a title alone never reads as a duplicate | | Paste-and-eyeball a **stack trace** | `code.trace` | every frame resolved to its definition in one call, trace order preserved | | Convince yourself a **claim about the code is true** ("nothing calls X", "A reaches B", "this file defines Y") before acting on it | `code.verify` | a three-valued verdict with evidence — and it will NOT say "refuted" from an absence (the graph is a floor); it says "not_established" and names what it couldn't see, so you don't act on a false negative | diff --git a/integrations/codex-plugin/skills/loom-code/reference.md b/integrations/codex-plugin/skills/loom-code/reference.md index 501b922f97b..f5c0486159d 100644 --- a/integrations/codex-plugin/skills/loom-code/reference.md +++ b/integrations/codex-plugin/skills/loom-code/reference.md @@ -31,7 +31,7 @@ that needs no thought. Catch these: | Answer "**who calls X**" by grepping the name | `code.callers` | compiler-exact (scip tier); grep cannot tell a call from a comment, string, or same-named overload | | Judge "**is it safe to change X**" | `code.impact` | transitive radius + tests that reach it + files that usually co-change | | Review your **own uncommitted diff** before finishing | `code.impact` with `files=[...]` and/or `diff=` | the index can't see your working tree, but it computes what the diff touches against the base graph — blast radius, tests to run, and co-change partners your change did NOT touch | -| Say **"done"** on a change without naming its tests | `code.test_gate` with `files=[...]` and/or `diff=` | the tests to run in evidence order — a test you edited, a test a coverage run measured executing a touched definition, a test a call chain links to one, the stem partner of a file you changed, the mined test map, and with fewer than four of those the tests that call other definitions of the edited files — each with a `run` command when derivable (never guessed), plus `untested`: touched definitions a coverage run measured unexecuted, and `unlinked`: ones the index links no test to (not proof that none runs them). Run the tests (only a `coverage` or `static_call` test is known to run the changed code); write a test for the untested rows or say why not | +| Say **"done"** on a change without naming its tests | `code.test_gate` with `files=[...]` and/or `diff=` | the tests to run in evidence order — a test you edited, a test a coverage run measured executing a touched definition, a test a call chain links to one, the stem partner of a file you changed, the mined test map, and with fewer than four of those the tests that call other definitions of the edited files — each with a `run` command when derivable (never guessed), plus `untested`: touched definitions a coverage run measured unexecuted, and `unlinked`: ones the index links no test to (not proof that none runs them). Run the tests (a `coverage` test was measured executing the changed code, a `static_call` test is linked to it by a call chain and usually, not always, runs it, the other kinds are about the file); write a test for the untested rows or say why not | | Run **`gh pr create`** on a change | `code.pr_check` with the title, body, changed paths, symbols and the issues it closes | a verdict over loom's PR ledgers — `duplicate_of` when an open PR is already doing this or a merged one already did (check main before you push), `related` to read first, `none` to open it — each item with state and evidence lines (files shared, same issue closed, a backport of yours); a title alone never reads as a duplicate | | Paste-and-eyeball a **stack trace** | `code.trace` | every frame resolved to its definition in one call, trace order preserved | | Convince yourself a **claim about the code is true** ("nothing calls X", "A reaches B", "this file defines Y") before acting on it | `code.verify` | a three-valued verdict with evidence — and it will NOT say "refuted" from an absence (the graph is a floor); it says "not_established" and names what it couldn't see, so you don't act on a false negative | diff --git a/server/code/api/models_testing.py b/server/code/api/models_testing.py index b1ef9e348b3..85333b3f5e2 100644 --- a/server/code/api/models_testing.py +++ b/server/code/api/models_testing.py @@ -166,9 +166,11 @@ def _drop_unset(self, handler: SerializerFunctionWrapHandler) -> dict[str, Any]: class CodeTestGateOutput(BaseModel): # {test_path, why, evidence, run, run_unknown} per test file, strongest evidence first. # `why` is the kind of evidence: `changed_test` (the file is in the diff), `coverage` - # (a coverage run measured it executing a touched definition; `links_to`), - # `static_call` (a call chain links its tests to a touched definition: `hop` of the - # nearest, `callers` how many of its tests do, `links_to` naming up to ten of the + # (a coverage run measured it executing a touched definition: `links_to`, `confidence` + # the specificity of the test-map row that says so; when a call chain links the file + # too, `evidence` names the chain's test and the row carries its `hop`, `callers` and + # `via`), `static_call` (a call chain links its tests to a touched definition: `hop` of + # the nearest, `callers` how many of its tests do, `links_to` naming up to ten of the # definitions, `via` `constructor` when the test calls the class of a touched # constructor, `enclosing` when it calls the function a touched nested function is # defined in or `fixture` when it reaches through a fixture), `stem_partner` (its name @@ -176,11 +178,14 @@ class CodeTestGateOutput(BaseModel): # about the file: `src_path`, `confidence`), `file_neighbor` (it calls `callees` other # definitions of the edited files and says nothing about the touched # ones; listed only while the other kinds leave fewer than four rows, and never more - # than fill the list to four). Within a kind the nearest hop is first, then the file - # linked to more of the touched definitions, then the one with more tests or callees. + # than fill the list to four). Within a kind a file a call chain names a test in is + # first, the nearest hop before the others, then the file linked to more of the touched + # definitions, then the one with more tests or callees, then the higher `confidence`. tests: list[dict[str, Any]] = Field(default_factory=list) # Touched source definitions a coverage run measured unexecuted, at a commit the index - # verified: {qualified_name, path, start_line, commit}. Empty without such a run. + # verified: {qualified_name, path, start_line, commit}. Empty without such a run. The + # run is read against the lines after a definition's first: the declaration line runs + # when the module is imported, under whichever test imports it first. untested: list[dict[str, Any]] = Field(default_factory=list) # Touched source definitions no coverage run measured and no call chain links a test # to: {qualified_name, path, start_line}. Not proof that no test runs them: tests reach @@ -194,10 +199,11 @@ class CodeTestGateOutput(BaseModel): # by path and line (first 200). touched_symbols: list[dict[str, Any]] = Field(default_factory=list) # True while `tests` or `untested` is non-empty: run the tests, whose green says as - # much as each row's `why` (a `coverage` or `static_call` test ran against a touched - # definition; a `stem_partner`, `test_map` or `file_neighbor` test is about the file - # and may not run the changed code), and write a test for (or explain) the untested - # rows. `unlinked` alone asks for nothing. + # much as each row's `why` (a `coverage` test was measured executing a touched + # definition; a `static_call` test is linked to one by a call chain and usually, not + # always, runs it; a `stem_partner`, `test_map` or `file_neighbor` test is about the + # file and may not run the changed code), and write a test for (or explain) the + # untested rows. `unlinked` alone asks for nothing. obligations: bool = False # Rows of `tests` before `limit`. tests_total: int = 0 @@ -217,15 +223,18 @@ class CodeTestGateOutput(BaseModel): # `measured` when a verified coverage run settled every touched definition, every # changed line sat in one and every changed source file touched one; otherwise # `lower_bound`. The gate never answers `exact`: a static graph cannot show that no - # test runs a definition. + # test runs a definition. A change that touches no source definition is never + # `measured`. epistemic: str = "lower_bound" # What limits the answer, from code.callers' causes (unresolved_calls, - # ambiguous_calls, treesitter_only_files, external_calls, truncated: a hop read hit its - # row limit), which limit `tests` under either `epistemic`, and two of its own that - # make it `lower_bound`: `unmapped_changes` (a changed line sits in no definition the - # index holds: module-level code, text added above a definition, a file with no - # definition or one the index does not hold) and `no_coverage` (no verified coverage - # run measured a touched definition). + # ambiguous_calls, treesitter_only_files, external_calls, truncated: a hop read or the + # read of the coverage rows hit its limit), which limit `tests` under either + # `epistemic`, and two of its own that make it `lower_bound`: `unmapped_changes` (a + # changed line sits in no definition the index holds: module-level code, text added + # above a definition, a file with no definition or one the index does not hold) and + # `no_coverage` (no verified coverage run measured a touched definition). Empty under + # `lower_bound` for a change of test files only: the gate lists the changed tests and + # does not look for the tests that use a changed test helper. causes: list[str] = Field(default_factory=list) # Distinct symbols reached per hop BEFORE any slicing: {1: n, 2: m}. # The true size of the radius when `truncated` says the rows are a page. diff --git a/server/code/app/coverage_freshness.py b/server/code/app/coverage_freshness.py index f7ad3a941fd..1cfef9d7ac6 100644 --- a/server/code/app/coverage_freshness.py +++ b/server/code/app/coverage_freshness.py @@ -146,26 +146,20 @@ async def measured_for( return out -def body_extents(row: dict[str, Any]) -> list[tuple[str, int, int]]: - """(symbol_id, start, end) of every tier row of a definition that holds a body: the - row's `extents`, or its own span. A one-line extent is left out: a compiler row may be - the declaration line only, and whether that line ran says nothing about the body.""" - own = ( - str(row.get("symbol_id") or ""), - int(row.get("start_line") or 0), - int(row.get("end_line") or 0), - ) - return [e for e in row.get("extents") or [own] if 0 < e[1] < e[2]] - - async def measured_definitions( repo: CodeRepo, org: str, ns: str, rows: list[dict[str, Any]] ) -> dict[str, dict[str, Any]]: - """What a coverage run measured of each definition row (`symbol_id`, `path` and its - spans, see `body_extents`): symbol_id -> {executed, commit}. A definition is absent - unless the run measured its file at the commit the index parsed both the file and one - of the definition's body extents at; one measured unexecuted also needs the run at the - index watermark, as the coverage claim's `uncovered` does. No coverage rows, one read.""" + """What a coverage run measured of each definition row (`symbol_id`, `path`, `kind` and + `tier_ids`, every tier's id of it): symbol_id -> {executed, commit, body}. `body` is + the line ranges the run is read against: of every extent a tier holds of the + definition that is wider than one line, the lines after the first. The first line is + the declaration, which runs when the module is imported, under whichever test imports + it first; a one-line extent is that line alone. A definition is absent unless the run + measured its file at the commit the index parsed both the file and one of those + extents at; one measured unexecuted also needs the run at the index watermark, as the + coverage claim's `uncovered` does. The extents are read with their parsing commit and + matched by id, so a definition whose tiers were parsed at different commits is + measured on the extent the run's commit holds. No coverage rows, one read.""" paths = list(dict.fromkeys(str(r.get("path") or "") for r in rows if r.get("path"))) files = await repo.coverage_files_for(org, ns, paths) if paths else {} if not files: @@ -175,27 +169,25 @@ async def measured_definitions( source_identities(repo, org, ns, list(files)), repo.functions_for_paths(org, ns, list(files), limit=2000, kinds=kinds, with_revision=True), ) - parsed_at = { - (str(e["symbol_id"]), int(e["start_line"] or 0), int(e["end_line"] or 0)): str( - e.get("extent_commit") or "" - ).rstrip("\0") - for e in extents - } + bodies: dict[tuple[str, str], set[cr.Range]] = {} + for e in extents: + path, start, end = str(e["path"]), int(e["start_line"] or 0), int(e["end_line"] or 0) + parsed_at = str(e.get("extent_commit") or "").rstrip("\0") + commit = str(files.get(path, {}).get("commit_sha") or "") + if 0 < start < end and verified_source(path, commit, head, indexed, {path: {parsed_at}}): + for sid in e.get("tier_ids") or [e["symbol_id"]]: + bodies.setdefault((path, str(sid)), set()).add((start + 1, end)) + ran = {p: cr.json_ranges(str(f.get("lines") or "[]")) for p, f in files.items()} out: dict[str, dict[str, Any]] = {} for r in rows: path, sid = str(r.get("path") or ""), str(r.get("symbol_id") or "") - if path not in files: + body = sorted( + {b for i in r.get("tier_ids") or [sid] for b in bodies.get((path, str(i)), ())} + ) + if not body: continue commit = str(files[path].get("commit_sha") or "") - ran = cr.json_ranges(str(files[path].get("lines") or "[]")) - verified = [ - (start, end) - for extent_id, start, end in body_extents(r) - if verified_source( - path, commit, head, indexed, {path: {parsed_at.get((extent_id, start, end), "")}} - ) - ] - executed = any(cr.intersects(ran, start, end) for start, end in verified) - if verified and (executed or commit == head): - out[sid] = {"executed": executed, "commit": commit} + executed = any(cr.intersects(ran[path], start, end) for start, end in body) + if executed or commit == head: + out[sid] = {"executed": executed, "commit": commit, "body": body} return out diff --git a/server/code/app/symbol/diff.py b/server/code/app/symbol/diff.py index 6d0c87908f8..9595abf4a78 100644 --- a/server/code/app/symbol/diff.py +++ b/server/code/app/symbol/diff.py @@ -327,8 +327,13 @@ def _touched_rows_for_diff( """(the touched definition rows in seed order, the ids the walk seeds, the changed lines that sit in no definition, counted in the files `symbol_rows` has a row of). A file with hunks touches the definitions its changed lines sit in; a file without hunks - (files-only shape) touches every function in it. Pure, so the diff shape's seed rule - is testable without a repo.""" + (files-only shape) touches every function in it. `symbol_rows` is one row per + definition, as `functions_for_paths` returns them: it folds the two tiers' rows of a + definition into one where their spans coincide, and that row carries every tier's id + (`tier_ids`). Rows that share a name and sit apart are different definitions (a + property's getter and setter, the arms of a conditional definition), and a changed line + touches the one it sits in. Pure, so the diff shape's seed rule is testable without a + repo.""" by_path: dict[str, list[dict[str, Any]]] = {} for r in symbol_rows: by_path.setdefault(str(r["path"]), []).append(r) @@ -349,27 +354,14 @@ def _touched_rows_for_diff( by_lines.append(hunk) found, missed = spans.edited(by_lines) unmapped += missed - edited = {str(r["qualified_name"]) for r in found} - # A definition the two tiers hold as two rows is edited in both, whichever row's - # span held the line (the compiler's may be its declaration line only). - touched_rows += [{**r, "via": "hunk"} for r in rows if str(r["qualified_name"]) in edited] - # Both tiers index the same definition under different symbol_ids: one row per (path, - # qualified_name), scip first, carrying every id of the rows it stands for (`tier_ids`) - # and the span of each (`extents`). The walk seeds all the ids: parser-tier edges point - # at the parser-tier id, and a definition seeded by its compiler id alone would lose the - # callers only the parser saw. A coverage run is read against all the extents: the - # compiler's may be the declaration line only. + touched_rows += [{**r, "via": "hunk"} for r in found] + # One row per definition, named by a header or a line. The walk seeds every id it + # carries: parser-tier edges point at the parser-tier id, and a definition seeded by + # its compiler id alone would lose the callers only the parser saw. kept: dict[tuple[str, str], dict[str, Any]] = {} - for r in sorted(touched_rows, key=lambda r: 0 if str(r["tier"]) == "scip" else 1): - key = (str(r["path"]), str(r["qualified_name"])) - ids = r.get("tier_ids") or [r["symbol_id"]] - extent = (str(r["symbol_id"]), *_span(r)) - if key in kept: - first = kept[key] - first["tier_ids"] = list(dict.fromkeys([*first["tier_ids"], *map(str, ids)])) - first["extents"].append(extent) - else: - kept[key] = {**r, "tier_ids": list(dict.fromkeys(map(str, ids))), "extents": [extent]} + for r in touched_rows: + ids = dict.fromkeys(map(str, r.get("tier_ids") or [r["symbol_id"]])) + kept.setdefault((str(r["path"]), str(r["symbol_id"])), {**r, "tier_ids": list(ids)}) # Deterministic, explainable order: the definitions a changed line sits in, then the # ones only a hunk header names, then whole-file seeds. rank = {"hunk": 0, "header": 1, "file": 2} diff --git a/server/code/app/symbol/gate.py b/server/code/app/symbol/gate.py index 47d07c04333..e8445322a45 100644 --- a/server/code/app/symbol/gate.py +++ b/server/code/app/symbol/gate.py @@ -141,7 +141,9 @@ async def handle_code_test_gate(input: CodeTestGateInput) -> CodeTestGateOutput: ) # The graph is never proof that no test runs a definition: the answer is `measured` # only when a coverage run settled every touched definition and every changed line sat - # in one. The graph's own causes stay beside it: they limit `tests` either way. + # in one. The graph's own causes stay beside it: they limit `tests` either way. A + # change of test files only touches no source definition and is `lower_bound` with no + # cause: the changed tests are listed, the tests that use a changed helper are not. causes = [ *env.causes, *([CAUSE_UNMAPPED] if unmapped or unseen else []), diff --git a/server/code/app/symbol/test_links.py b/server/code/app/symbol/test_links.py index 16511e34225..4b722b950df 100644 --- a/server/code/app/symbol/test_links.py +++ b/server/code/app/symbol/test_links.py @@ -9,18 +9,17 @@ from dataclasses import dataclass, field from typing import Any -from server.code.app.coverage_freshness import ( - body_extents, - measured_definitions, - partition_coverage_rows, -) +from server.code.app.coverage_freshness import measured_definitions, partition_coverage_rows from server.code.app.symbol.edges import _GRAPH_EDGE_KINDS from server.code.domain.index import coverage_runs as cr from server.code.store.index import CodeRepo from server.code.store.index import prefer_scip_edges as _prefer_scip_edges +from server.code.store.index.coverage import COVERAGE_ROW_PATHS # A Python class call ends at the class symbol: a test that builds the object runs these. _CONSTRUCTORS = ("__init__", "__new__") +# Coverage rows read for the executed definitions' files. +_COVERAGE_ROWS = 2000 @dataclass @@ -29,13 +28,15 @@ class Links: # roots is the touched symbol ids the node reaches and via is `constructor`, `enclosing` # or `fixture` impacted: dict[str, dict[str, Any]] = field(default_factory=dict) - # True when a hop's read hit its row limit + # True when a hop's read hit its row limit, or the coverage rows read were cut capped: bool = False # {path, callees}: test files calling other definitions of the edited files neighbors: list[dict[str, Any]] = field(default_factory=list) - # touched symbol_id -> {executed, commit}, for the definitions a verified run measured + # touched symbol_id -> {executed, commit, body}, for the definitions a verified run + # measured measured: dict[str, dict[str, Any]] = field(default_factory=dict) - # {test_path, roots}: tests a verified run measured executing touched definitions + # {test_path, roots, confidence}: test files a verified run measured executing touched + # definitions, with the highest specificity among the map rows that say so coverage: list[dict[str, Any]] = field(default_factory=list) @@ -52,9 +53,20 @@ def _seed_roots( for sid in r.get("tier_ids") or [r["symbol_id"]]: roots.setdefault(str(sid), set()).add(str(r["symbol_id"])) own = set(roots) - by_name = {(str(r["path"]), str(r["qualified_name"])): r for r in symbol_rows} + by_name: dict[tuple[str, str], list[dict[str, Any]]] = {} + for row in symbol_rows: + by_name.setdefault((str(row["path"]), str(row["qualified_name"])), []).append(row) stands: dict[str, str] = {} + def holder(r: dict[str, Any], owner: str) -> dict[str, Any] | None: + """The row named `owner` that `r` is defined in: of rows that share the name (the + arms of a conditional definition) the one whose span holds it, else the first.""" + named = by_name.get((str(r["path"]), owner), []) + line = int(r["start_line"] or 0) + inside = [n for n in named if int(n["start_line"] or 0) <= line <= int(n["end_line"] or 0)] + found = inside or named + return found[0] if found else None + def alias(row: dict[str, Any], root: str, how: str) -> None: for sid in row.get("tier_ids") or [row["symbol_id"]]: roots.setdefault(str(sid), set()).add(root) @@ -63,7 +75,7 @@ def alias(row: dict[str, Any], root: str, how: str) -> None: for r in touched: owner, _, name = str(r["qualified_name"]).rpartition("::") - parent = by_name.get((str(r["path"]), owner)) + parent = holder(r, owner) if parent is not None and str(parent.get("kind")) == "class": if name in _CONSTRUCTORS: alias(parent, str(r["symbol_id"]), "constructor") @@ -71,7 +83,7 @@ def alias(row: dict[str, Any], root: str, how: str) -> None: while parent is not None and str(parent.get("kind")) != "class": alias(parent, str(r["symbol_id"]), "enclosing") owner = owner.rpartition("::")[0] - parent = by_name.get((str(r["path"]), owner)) + parent = holder(r, owner) return roots, stands @@ -131,42 +143,51 @@ async def _walk( async def _coverage( repo: CodeRepo, org: str, ns: str, touched: list[dict[str, Any]] -) -> tuple[dict[str, dict[str, Any]], list[dict[str, Any]]]: - """(what a verified coverage run measured of each touched definition, the tests it - measured executing them). The definitions' identity is settled by - `measured_definitions`; a test row also needs its own file at the run's commit.""" +) -> tuple[dict[str, dict[str, Any]], list[dict[str, Any]], bool]: + """(what a verified coverage run measured of each touched definition, the test files it + measured executing them, whether the rows read were cut). The definitions' identity + and the lines the run is read against are settled by `measured_definitions`; a test + row also needs its own file at the run's commit.""" measured = await measured_definitions(repo, org, ns, touched) - executed = [r for r in touched if measured.get(str(r["symbol_id"]), {}).get("executed")] + executed: dict[str, list[tuple[str, list[cr.Range]]]] = {} # path -> (symbol_id, body) + for r in touched: + run = measured.get(str(r["symbol_id"])) + if run and run["executed"]: + executed.setdefault(str(r["path"]), []).append((str(r["symbol_id"]), run["body"])) if not executed: - return measured, [] - paths = list(dict.fromkeys(str(r["path"]) for r in executed)) - current, _ = await partition_coverage_rows( - repo, org, ns, await repo.coverage_rows_for(org, ns, paths) - ) - tests: dict[str, set[str]] = {} + return measured, [], False + rows = await repo.coverage_rows_for(org, ns, list(executed), limit=_COVERAGE_ROWS) + capped = len(executed) > COVERAGE_ROW_PATHS or len(rows) >= _COVERAGE_ROWS + current, _ = await partition_coverage_rows(repo, org, ns, rows) + tests: dict[str, dict[str, Any]] = {} for row in current: ranges = cr.evidence_ranges(str(row.get("evidence") or "")) - for r in executed: - if str(r["path"]) == str(row.get("src_path")) and any( - cr.intersects(ranges, start, end) for _, start, end in body_extents(r) - ): - tests.setdefault(str(row.get("test_path") or ""), set()).add(str(r["symbol_id"])) - return measured, [{"test_path": tp, "roots": sorted(ids)} for tp, ids in tests.items() if tp] + for sid, body in executed.get(str(row.get("src_path") or ""), ()): + if any(cr.intersects(ranges, start, end) for start, end in body): + test = tests.setdefault( + str(row.get("test_path") or ""), {"roots": set(), "confidence": 0.0} + ) + test["roots"].add(sid) + test["confidence"] = max(test["confidence"], float(row.get("confidence") or 0.0)) + found = [ + {"test_path": tp, "roots": sorted(t["roots"]), "confidence": t["confidence"]} + for tp, t in tests.items() + if tp + ] + return measured, found, capped def _other_definitions( symbol_rows: list[dict[str, Any]], roots: dict[str, set[str]] ) -> dict[str, str]: """Edge target id -> the definition it is an id of, for the definitions of the edited - files the walk does not seed. A definition both tiers hold has two ids and is one - definition. Ordered by path and line: the neighbour read takes the first ids.""" - names: dict[tuple[str, str], str] = {} + files the walk does not seed. A row is one definition, and one both tiers hold carries + two ids. Ordered by path and line: the neighbour read takes the first ids.""" out: dict[str, str] = {} for r in sorted(symbol_rows, key=lambda r: (str(r["path"]), int(r["start_line"] or 0))): - name = names.setdefault((str(r["path"]), str(r["qualified_name"])), str(r["symbol_id"])) for sid in r.get("tier_ids") or [r["symbol_id"]]: if str(sid) not in roots: - out.setdefault(str(sid), name) + out.setdefault(str(sid), str(r["symbol_id"])) return out @@ -188,14 +209,14 @@ async def link_tests( if not symbol_rows: return Links() roots, stands = _seed_roots(touched, symbol_rows) - (impacted, capped), near, (measured, coverage) = await asyncio.gather( + (impacted, capped), near, (measured, coverage, cut) = await asyncio.gather( _walk(repo, org, ns, roots, stands, depth=depth, read_limit=read_limit), repo.test_files_calling(org, ns, _other_definitions(symbol_rows, roots), limit=neighbors), _coverage(repo, org, ns, touched), ) return Links( impacted=impacted, - capped=capped, + capped=capped or cut, neighbors=[{"path": str(r["path"]), "callees": int(r["callees"])} for r in near], measured=measured, coverage=coverage, diff --git a/server/code/domain/index/test_gate.py b/server/code/domain/index/test_gate.py index 84bf978edb5..43a44847507 100644 --- a/server/code/domain/index/test_gate.py +++ b/server/code/domain/index/test_gate.py @@ -177,7 +177,8 @@ class GateInputs: neighbors: list[dict[str, Any]] = field(default_factory=list) # touched symbol_id -> {executed, commit}: what a verified coverage run measured measured: dict[str, dict[str, Any]] = field(default_factory=dict) - # {test_path, roots}: tests a verified coverage run measured executing touched symbols + # {test_path, roots, confidence}: test files a verified coverage run measured executing + # touched symbols, with the specificity of the map row that says so coverage: list[dict[str, Any]] = field(default_factory=list) run_overrides_json: str = "" limit: int = 30 @@ -247,27 +248,41 @@ def add(test_path: str, why: str, **extra: Any) -> bool: for p in inp.changed_paths: if is_test_path(p): add(p, CHANGED_TEST, evidence="in the diff") - # 2. tests a coverage run measured executing a touched definition + static, linked = _static_files(inp) + chains = {f["path"]: f for f in static} + + def chain(f: dict[str, Any]) -> tuple[str, dict[str, Any]]: + """(the test a call chain names in the file and how far it is, the row's fields).""" + v, hop = f["node"], int(f["node"].get("hop") or 0) + via = {"via": str(v["via"])} if v.get("via") else {} + return ( + f"{v.get('qualified_name', '')} reaches the change in {hop} hop(s)", + {"hop": hop, "callers": int(f["callers"]), **via}, + ) + + # 2. tests a coverage run measured executing a touched definition. A file a call chain + # links too keeps the chain's test name, `hop` and `callers`. for c in inp.coverage: tp, roots = str(c.get("test_path") or ""), set(c.get("roots") or ()) links = _links_to(roots, names) evidence = f"a coverage run measured it executing {', '.join(links[:3])}" - if add(tp, COVERAGE, evidence=evidence, links_to=links): - rank[tp] = (len(roots), 0) - # 3. tests a call chain reaches a touched definition from - static, linked = _static_files(inp) - for f in static: - v, hop = f["node"], int(f["node"].get("hop") or 0) + named, fields = chain(chains[tp]) if tp in chains else ("", {}) added = add( - f["path"], - STATIC_CALL, - evidence=f"{v.get('qualified_name', '')} reaches the change in {hop} hop(s)", - hop=hop, - callers=int(f["callers"]), - links_to=_links_to(f["roots"], names), - **({"via": str(v["via"])} if v.get("via") else {}), + tp, + COVERAGE, + evidence=f"{evidence}; {named}" if named else evidence, + links_to=links, + confidence=round(float(c.get("confidence") or 0.0), 3), + **fields, ) if added: + rank[tp] = (len(roots), int(fields.get("callers") or 0)) + # 3. tests a call chain reaches a touched definition from + for f in static: + named, fields = chain(f) + if add( + f["path"], STATIC_CALL, evidence=named, links_to=_links_to(f["roots"], names), **fields + ): rank[f["path"]] = (len(f["roots"]), int(f["callers"])) # 4. stem partners of changed source files, by the repository's own naming src_changed = [p for p in inp.changed_paths if not is_test_path(p)] @@ -297,13 +312,15 @@ def add(test_path: str, why: str, **extra: Any) -> bool: evidence=f"calls {callees} other definition(s) of the edited files", callees=callees, ) - # Within a kind: the nearest hop, then the file that links to more of the touched - # definitions, then the one with more tests doing so: a module's own test file calls it - # from many tests, a bystander from one. + # Within a kind: a file a call chain names a test in, the nearest hop first, then the + # file that links to more of the touched definitions, then the one with more tests doing + # so (a module's own test file calls it from many tests, a bystander from one), then the + # more specific map row: the file whose tests run lines few other tests reach. ordered = sorted( rows.values(), key=lambda r: ( _ORDER[r["why"]], + "hop" not in r, int(r.get("hop") or 0), -rank.get(r["test_path"], (0, 0))[0], -rank.get(r["test_path"], (0, 0))[1], diff --git a/server/code/store/index/coverage.py b/server/code/store/index/coverage.py index 40cf0684d3e..108d20e9d06 100644 --- a/server/code/store/index/coverage.py +++ b/server/code/store/index/coverage.py @@ -12,6 +12,9 @@ from server.code.store.index.base import CodeRepoBase from server.code.store.index.sql import _batched +# `coverage_rows_for` reads this many paths; a caller with more knows its read was cut. +COVERAGE_ROW_PATHS = 50 + class CoverageMixin(CodeRepoBase): async def live_coverage_pairs(self, org: str, ns: str) -> set[tuple[str, str]]: @@ -41,7 +44,7 @@ async def live_coverage_files(self, org: str, ns: str) -> set[str]: async def coverage_rows_for( self, org: str, ns: str, paths: list[str], *, limit: int = 2000 ) -> list[dict[str, Any]]: - """The `coverage` test-map rows of the first 50 `paths`, most specific + """The `coverage` test-map rows of the first `COVERAGE_ROW_PATHS` paths, most specific first (the order total): the claim filters them by the subject's span, so it reads them all rather than the flat strongest page.""" if not paths: @@ -56,7 +59,7 @@ async def coverage_rows_for( ORDER BY confidence DESC, src_path, test_path LIMIT {limit:UInt32} """, - {"org": org, "ns": ns, "paths": paths[:50], "limit": limit}, + {"org": org, "ns": ns, "paths": paths[:COVERAGE_ROW_PATHS], "limit": limit}, ) async def coverage_files_for( diff --git a/tests/unit/test_code_impact_dispatch.py b/tests/unit/test_code_impact_dispatch.py index 080d830f3d9..d5ec5f949be 100644 --- a/tests/unit/test_code_impact_dispatch.py +++ b/tests/unit/test_code_impact_dispatch.py @@ -308,38 +308,44 @@ def test_partial_relationship_languages() -> None: assert not dispatch._partial_relationships("") -def test_touched_rows_fold_a_definitions_tier_ids_and_rank_changed_lines_first() -> None: - def row(sid: str, name: str, path: str, start: int, end: int, tier: str) -> dict: +def test_touched_rows_carry_a_definitions_tier_ids_and_rank_changed_lines_first() -> None: + def row(sid: str, name: str, path: str, start: int, end: int, **more: object) -> dict: return { "symbol_id": sid, "qualified_name": name, "path": path, "start_line": start, "end_line": end, - "tier": tier, + "tier": "scip", + **more, } rows = [ - row("ts_f", "DB::f", "src/a.cpp", 10, 20, "treesitter"), # same definition, parser tier - row("sc_f", "DB::f", "src/a.cpp", 10, 10, "scip"), - row("sc_g", "DB::g", "src/a.cpp", 30, 40, "scip"), # a hunk inside g - row("sc_h", "DB::h", "src/a.cpp", 90, 90, "scip"), # one line: only a header can name it - row("sc_i", "DB::i", "src/a.cpp", 50, 60, "scip"), # only headers name it - row("sc_k", "DB::k", "src/b.cpp", 1, 5, "scip"), # files-only: every function + # one definition both tiers hold, as the store folds it: the compiler row carrying + # the parser row's extent and id + row("sc_f", "DB::f", "src/a.cpp", 10, 20, tier_ids=["sc_f", "ts_f"]), + row("sc_g", "DB::g", "src/a.cpp", 30, 40), # a hunk inside g + row("sc_h", "DB::h", "src/a.cpp", 90, 90), # one line: only a header can name it + row("sc_i", "DB::i", "src/a.cpp", 50, 60), # only headers name it + row("get", "DB::C::x", "src/a.cpp", 100, 104), # two definitions under one name + row("set", "DB::C::x", "src/a.cpp", 106, 110), + row("sc_k", "DB::k", "src/b.cpp", 1, 5), # files-only: every function ] hunks = [ diff.Hunk("i", ((35, 36),), ()), # its lines sit in g, whatever the header says - diff.Hunk("", ((15, 15),), ()), # inside f's parser span + diff.Hunk("", ((15, 15),), ()), # inside f diff.Hunk("h", ((95, 95),), ()), # in no definition; h has no body extent diff.Hunk("i", ((70, 70),), ()), # in no definition; i's body ends above it + diff.Hunk("x", ((108, 108),), ()), # in the second x only ] touched, seed_ids, unmapped = diff._touched_rows_for_diff(rows, {"src/a.cpp": hunks}) assert [(r["symbol_id"], r["via"]) for r in touched] == [ ("sc_f", "hunk"), ("sc_g", "hunk"), + ("set", "hunk"), ("sc_h", "header"), ("sc_k", "file"), ] assert touched[0]["tier_ids"] == ["sc_f", "ts_f"] - assert seed_ids == ["sc_f", "ts_f", "sc_g", "sc_h", "sc_k"] + assert seed_ids == ["sc_f", "ts_f", "sc_g", "set", "sc_h", "sc_k"] assert unmapped == 1 diff --git a/tests/unit/test_code_test_gate.py b/tests/unit/test_code_test_gate.py index 9679f49fe3e..c4016e34e47 100644 --- a/tests/unit/test_code_test_gate.py +++ b/tests/unit/test_code_test_gate.py @@ -9,6 +9,7 @@ import pytest from server.code.domain.index import test_gate as tg +from server.code.store.index.symbol_rank import _prefer_scip from server.core.errors import ValidationError from server.settings import settings @@ -116,7 +117,7 @@ def test_build_gate_orders_by_evidence_and_dedupes() -> None: {"path": "tests/unit/test_hop.py", "callees": 9}, ], measured={"s1": {"executed": True, "commit": "c1"}}, - coverage=[{"test_path": "tests/unit/test_ran.py", "roots": ["s1"]}], + coverage=[{"test_path": "tests/unit/test_ran.py", "roots": ["s1"], "confidence": 0.5}], ) g = tg.build_gate(inp) # Five rows are about the change, so no file neighbour is listed. @@ -130,7 +131,9 @@ def test_build_gate_orders_by_evidence_and_dedupes() -> None: # A test file keeps its first (strongest) evidence: the changed test is also in the # map, and a test a call chain links names its definition, whatever the map says of it. assert g.tests[0]["evidence"] == "in the diff" - assert g.tests[1]["links_to"] == ["alpha"] + assert g.tests[1]["links_to"] == ["alpha"] and g.tests[1]["confidence"] == 0.5 + assert g.tests[1]["evidence"] == "a coverage run measured it executing alpha" + assert "hop" not in g.tests[1] assert g.tests[2]["links_to"] == ["alpha"] and "src_path" not in g.tests[2] hop = g.tests[3] assert hop["hop"] == 2 and hop["evidence"] == "test_b_hop reaches the change in 2 hop(s)" @@ -141,6 +144,38 @@ def test_build_gate_orders_by_evidence_and_dedupes() -> None: assert g.obligations is True +def test_coverage_rows_put_a_chain_linked_file_first_then_the_more_specific() -> None: + """Every file here executes the definition. The one a call chain names a test in is + first and keeps the test's name; the others follow by the specificity of their map + row, not by path.""" + inp = tg.GateInputs( + changed_paths=["src/app.py"], + touched=[_touched("s1", "src/app.py", "App::run")], + impacted={ + "t1": _node("test_run", "tests/test_z_app.py", 1, ["s1"]), + "t2": _node("test_run_twice", "tests/test_z_app.py", 1, ["s1"]), + }, + test_map=[], + measured={"s1": {"executed": True, "commit": "c1"}}, + coverage=[ + {"test_path": "tests/test_a_client.py", "roots": ["s1"], "confidence": 0.3}, + {"test_path": "tests/test_b_views.py", "roots": ["s1"], "confidence": 0.9}, + {"test_path": "tests/test_z_app.py", "roots": ["s1"], "confidence": 0.4}, + ], + ) + g = tg.build_gate(inp) + assert [(r["test_path"], r["why"]) for r in g.tests] == [ + ("tests/test_z_app.py", "coverage"), + ("tests/test_b_views.py", "coverage"), + ("tests/test_a_client.py", "coverage"), + ] + first = g.tests[0] + assert (first["hop"], first["callers"], first["confidence"]) == (1, 2, 0.4) + assert first["evidence"] == ( + "a coverage run measured it executing App::run; test_run reaches the change in 1 hop(s)" + ) + + def test_a_map_row_follows_the_call_chain_rows_and_its_stem_partner() -> None: g = tg.build_gate( tg.GateInputs( @@ -363,9 +398,18 @@ def __init__(self) -> None: self.kinds: tuple[str, ...] = () async def functions_for_paths(self, org, ns, paths, *, kinds=(), with_revision=False, **_kw): + """As the store answers: the two tiers' rows of a definition folded into one, and + with a revision only when both were parsed at one commit (`parsed_at` on a row, + the indexed commit otherwise).""" self.kinds = self.kinds or tuple(kinds) - rows = [s for s in self.symbols if s["path"] in paths and s["kind"] in kinds] - return [{**s, "extent_commit": "c" * 40} for s in rows] if with_revision else rows + rows = [] + for s in self.symbols: + if s["path"] in paths and s["kind"] in kinds: + row = {k: v for k, v in s.items() if k != "parsed_at"} + rows.append( + {**row, "extent_commit": s.get("parsed_at", "c" * 40)} if with_revision else row + ) + return _prefer_scip(rows) async def edges_for_symbols( self, org, ns, ids, *, direction, edge_kinds=None, limit=200, min_confidence=0.0 @@ -391,7 +435,7 @@ async def coverage_files_for(self, org, ns, paths): return {p: f for p, f in self.coverage_files.items() if p in paths} async def coverage_rows_for(self, org, ns, paths, *, limit=2000): - return [r for r in self.coverage_rows if r["src_path"] in paths] + return [r for r in self.coverage_rows if r["src_path"] in paths][:limit] async def get_state(self, org, ns, key): return "c" * 40 @@ -600,23 +644,37 @@ async def test_a_coverage_run_decides_untested_and_makes_the_answer_measured(int assert out.tests[0]["why"] == "coverage" and out.tests[0]["links_to"] == ["pkg.w::helper"] -async def test_a_one_line_compiler_row_is_measured_on_the_parser_rows_body(intel) -> None: - """The compiler tier may hold a definition as its declaration line only. Whether that - line ran says nothing about the body: the run is read against the parser row's extent, - and a definition with no extent wider than a line is not measured.""" +def _parser(row: dict[str, Any], **more: Any) -> dict[str, Any]: + return {**row, "tier": "treesitter", **more} + + +async def test_a_definition_is_measured_on_the_body_a_tier_holds_at_the_runs_commit(intel) -> None: + """The compiler tier may hold a definition as its declaration line only, and the two + tiers may have been parsed at different commits. The run is read against the body the + parser row holds at the run's commit, whichever row the changed line was matched in; a + definition with no extent wider than a line is not measured.""" repo = _py_repo() repo.symbols = [ _sym("fH", "pkg.w::helper", "pkg/w.py", 44, 44), - {**_sym("pH", "pkg.w::helper", "pkg/w.py", 44, 50), "tier": "treesitter"}, + _parser(_sym("pH", "pkg.w::helper", "pkg/w.py", 44, 50)), _sym("fS", "pkg.w::stub", "pkg/w.py", 60, 60), ] # the body of helper ran (46-48), its declaration line did not; line 60 ran repo.coverage_files = { "pkg/w.py": {"commit_sha": "c" * 40, "lines": "[[46, 48], [60, 60]]", "tests": 1} } + for parsed_at in ("c" * 40, "d" * 40): # the compiler row, at the run's commit or not + repo.symbols[0] = {**repo.symbols[0], "parsed_at": parsed_at} + out = await _gate(intel, repo, diff=_one_line("pkg/w.py", 47)) + assert [(t["qualified_name"], t["tier"]) for t in out.touched_symbols] == [ + ("pkg.w::helper", "scip") + ] + assert out.untested == [] and out.epistemic == "measured" + + # the parser row is of another commit than the run: no body to read the run against + repo.symbols[1] = {**repo.symbols[1], "parsed_at": "d" * 40} out = await _gate(intel, repo, diff=_one_line("pkg/w.py", 47)) - assert [t["qualified_name"] for t in out.touched_symbols] == ["pkg.w::helper"] - assert out.untested == [] and out.epistemic == "measured" + assert out.untested == [] and out.epistemic == "lower_bound" out = await _gate(intel, repo, diff=_one_line("pkg/w.py", 60)) assert [t["qualified_name"] for t in out.touched_symbols] == ["pkg.w::stub"] @@ -624,6 +682,104 @@ async def test_a_one_line_compiler_row_is_measured_on_the_parser_rows_body(intel assert "no_coverage" in out.causes +async def test_a_declaration_line_that_ran_is_not_the_body(intel) -> None: + """A module first imported under a test has its `def` lines in that test's coverage. + The body is the lines after the first: a definition whose first line alone ran is + measured unexecuted, and the importing test is not one that executes it.""" + repo = _py_repo() + repo.coverage_files = { + "pkg/w.py": {"commit_sha": "c" * 40, "lines": "[[14, 14], [22, 22], [44, 46]]", "tests": 2} + } + evidence = '{"commit": "%s", "lines": [[14, 14], [22, 22], [44, 44]]}' % ("c" * 40) + repo.coverage_rows = [ + { + "src_path": "pkg/w.py", + "test_path": "tests/test_imports.py", + "confidence": 1.0, + "evidence": evidence, + } + ] + diff = _one_line("pkg/w.py", 30) + "@@ -46 +46 @@\n-old\n+new\n" + out = await _gate(intel, repo, diff=diff) + assert [u["qualified_name"] for u in out.untested] == ["pkg.w::Widget::render"] + assert out.epistemic == "measured" + # helper's body ran (45-46), and not under the test that ran its first line only + assert [t["why"] for t in out.tests] == ["static_call"] + + +async def test_definitions_that_share_a_name_are_touched_and_measured_apart(intel) -> None: + """A property's getter and setter carry one qualified name. The run executed the + getter only: an edit to the setter touches the setter, which is measured unexecuted, + and no test is said to have executed it.""" + repo = _py_repo() + repo.symbols = [ + _sym("cW", "pkg.w::Widget", "pkg/w.py", 10, 40, kind="class"), + _parser(_sym("pG", "pkg.w::Widget::size", "pkg/w.py", 12, 14)), + _parser(_sym("pS", "pkg.w::Widget::size", "pkg/w.py", 17, 20)), + _sym("sG", "pkg.w::Widget::size", "pkg/w.py", 12, 12), + _sym("sS", "pkg.w::Widget::size", "pkg/w.py", 17, 17), + ] + repo.callers = {"pG": [_edge("t1", "pG", "tests.test_w::test_size", "tests/test_w.py")]} + repo.coverage_files = {"pkg/w.py": {"commit_sha": "c" * 40, "lines": "[[12, 14]]", "tests": 1}} + repo.coverage_rows = [ + { + "src_path": "pkg/w.py", + "test_path": "tests/test_w.py", + "confidence": 0.9, + "evidence": '{"commit": "%s", "lines": [[12, 14]]}' % ("c" * 40), + } + ] + out = await _gate(intel, repo, diff=_one_line("pkg/w.py", 19)) + assert [(t["qualified_name"], t["start_line"]) for t in out.touched_symbols] == [ + ("pkg.w::Widget::size", 17) + ] + assert [u["start_line"] for u in out.untested] == [17] + assert out.tests == [] and out.epistemic == "measured" + + out = await _gate(intel, repo, diff=_one_line("pkg/w.py", 13)) + assert [t["start_line"] for t in out.touched_symbols] == [12] + assert out.untested == [] + row = out.tests[0] + assert (row["why"], row["hop"], row["confidence"]) == ("coverage", 1, 0.9) + assert row["evidence"].endswith("; tests.test_w::test_size reaches the change in 1 hop(s)") + + # a file given without hunks touches both, each measured on its own body + out = await _gate(intel, repo, files=["pkg/w.py"]) + assert [t["start_line"] for t in out.touched_symbols] == [12, 17] + assert [u["start_line"] for u in out.untested] == [17] + + +async def test_a_cut_coverage_read_is_a_cause_and_a_test_only_change_has_none( + intel, monkeypatch: pytest.MonkeyPatch +) -> None: + import server.code.app.symbol.test_links as links + + repo = _py_repo() + repo.coverage_files = {"pkg/w.py": {"commit_sha": "c" * 40, "lines": "[[1, 99]]", "tests": 2}} + repo.coverage_rows = [ + { + "src_path": "pkg/w.py", + "test_path": f"tests/test_{i}.py", + "confidence": 0.5, + "evidence": '{"commit": "%s", "lines": [[45, 46]]}' % ("c" * 40), + } + for i in range(3) + ] + out = await _gate(intel, repo, diff=_one_line("pkg/w.py", 46)) + assert out.epistemic == "measured" and out.causes == [] + assert [t["why"] for t in out.tests].count("coverage") == 3 + # the read returned as many rows as it asks for: more may exist + monkeypatch.setattr(links, "_COVERAGE_ROWS", 2) + out = await _gate(intel, repo, diff=_one_line("pkg/w.py", 46)) + assert out.causes == ["truncated"] + assert [t["why"] for t in out.tests].count("coverage") == 2 + + # a change of test files only touches no source definition: never `measured`, no cause + out = await _gate(intel, repo, files=["tests/test_w.py"]) + assert [t["why"] for t in out.tests] == ["changed_test"] + assert (out.epistemic, out.causes) == ("lower_bound", []) + + async def test_measured_needs_every_changed_source_file_to_touch_a_definition(intel) -> None: """A coverage run settled every definition of one file; the other changed file holds no definition the index knows, so the change was not measured as a whole.""" From 79b960e054f935bfa94526154698ac5b0fc176e1 Mon Sep 17 00:00:00 2001 From: Lareb Zafar Date: Sat, 28 Nov 2026 23:14:26 +0530 Subject: [PATCH 6/6] A run added below a definition's last line and indented less than it is documented as not placed The index holds no column for a definition. Where a class and its last method end on one line, text added below that line and indented less than it may be the method's (a statement after its last nested block) or the class's (a new method), and the two indents the diff shows cannot tell which. The run touches neither and counts in unmapped_changes, so the answer is lower_bound. The operations page and the docstring say so, and a test holds the three cases. Co-Authored-By: Claude Fable 5.2 Signed-off-by: Lareb Zafar --- docs/features/code-index/operations.md | 9 ++++++--- server/code/app/symbol/diff.py | 6 +++++- tests/unit/test_code_trace_and_diff_impact.py | 18 ++++++++++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/docs/features/code-index/operations.md b/docs/features/code-index/operations.md index 18e90c55a8b..7f5b7033db6 100644 --- a/docs/features/code-index/operations.md +++ b/docs/features/code-index/operations.md @@ -469,9 +469,12 @@ definition that holds the lines on both sides of them. When the diff carries its and not only its hunk headers, the added text decides two more cases: lines that are all decorators touch the definition below them, and in Python a run indented as deep as the line above it touches the definition that line ends. Text added directly above a -definition is otherwise a new definition, which the index does not hold. A changed line -outside every definition touches nothing and adds `unmapped_changes` to `causes`; so does -a changed source file that touches no definition. +definition is otherwise a new definition, which the index does not hold. A run added after +a definition's last line and indented less than that line is not placed: the index holds +no column for a definition, so the run may sit in that definition or in one around it (a +method appended to a class whose last line is its last method's). A changed line outside +every definition, or one that is not placed, touches nothing and adds `unmapped_changes` +to `causes`; so does a changed source file that touches no definition. Each row of `tests` is one test file with the kind of evidence in `why`, strongest first: diff --git a/server/code/app/symbol/diff.py b/server/code/app/symbol/diff.py index 9595abf4a78..acc6842d4ca 100644 --- a/server/code/app/symbol/diff.py +++ b/server/code/app/symbol/diff.py @@ -273,7 +273,11 @@ def inserted_in(self, ins: Insertion) -> dict[str, Any] | None: the innermost definition that holds both. The added text can say more: decorators edit the definition that starts below them, and in an indented language a run as deep as the line above continues the definition that line ends. Text added - directly above a definition is otherwise a new one, which the index does not hold.""" + directly above a definition is otherwise a new one, which the index does not hold. + A shallower run after a definition's last line is not placed: a row carries no + column, so the run may be that definition's (a statement after its last nested + block) or an outer one's (a method appended to a class that ends on the same + line), and it counts as a changed line in no definition.""" if ins.decorates and ins.after + 1 in self.starts: return self.starts[ins.after + 1] if self.indented and ins.continues and ins.after in self.ends: diff --git a/tests/unit/test_code_trace_and_diff_impact.py b/tests/unit/test_code_trace_and_diff_impact.py index 32314b8290f..e1b6014fe2b 100644 --- a/tests/unit/test_code_trace_and_diff_impact.py +++ b/tests/unit/test_code_trace_and_diff_impact.py @@ -232,6 +232,24 @@ def test_added_text_places_an_insertion_the_line_numbers_cannot() -> None: assert [r["qualified_name"] for r in touched] == ["m::C"] +def test_a_shallower_run_after_a_definitions_last_line_is_not_placed() -> None: + """A class and its last method end on one line. Text added below it and indented less + than it may be the method's (after a nested block) or the class's (a new method): the + rows carry no column to tell, so the run touches neither and is counted.""" + rows = [_row("c", "m::C", 10, 20, "class"), _row("a", "m::C::last", 12, 20, "method")] + + def touched(body: str) -> tuple[list[str], int]: + added = body.count("\n+") + diff = f"+++ b/pkg/m.py\n@@ -20,2 +20,{2 + added} @@ class C:\n{body}" + found, _, unmapped = _touched_rows_for_diff(rows, _parse_unified_diff_full(diff)[2]) + return [r["qualified_name"] for r in found], unmapped + + assert touched(" return 1\n+\n+ def added(self):\n+ return 2\n \n") == ([], 1) + assert touched(" do(x)\n+ return 1\n \n") == ([], 1) + # as deep as the line above: the method's + assert touched(" return 1\n+ x = 2\n \n") == (["m::C::last"], 0) + + def test_lines_in_no_definition_are_counted_and_a_header_does_not_claim_them() -> None: # module level, after C: the header names the function above, whose body ended assert _touched(Hunk("as_sql", ((64, 65),), (Insertion(66),))) == ([], 3)