Repository navigation
run.reliance lists what a run read, at which revisions, and what its client reported relying on - #2182
Merged
Conversation
After an item changes, the record of which keys a run was served cannot say which revision the run saw. loom.read_receipts holds one row per item of a receipted read's answer: the memory row's version and stored content hash, or the document's revision, with the request, the run and the reader. It holds identifiers and a hash, never content or query text. The revision is noted by the code that holds the row while the read runs. It is never looked up afterwards and never taken from another row under the same key. The rows queue for one sender per process, which sends one insert each half second, so receipts hold one ClickHouse connection and a fixed insert rate whatever the read rate and never fail or delay a read. A request that runs a mirror leg writes none. Both erasure scopes cover the table with lightweight deletes, and no row is written while a replica without the erasure step serves. A user's census counts the receipts stamped before the erasure was recorded, so a user who keeps reading does not fail their own erasure. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
The rebase left the shape of main's dump beside the shape of this branch's. The list is regenerated with python -m tests.analyzer.corpus --write. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
… cause and total, and live 190 days A context pack's receipts are the rows its rendered text prints, at the version of the search hit each was printed from; an abstaining search's rows are receipted and not counted as served. search.query receipts its memory hits from the search's own models, which keep the private row version. Each kind of loss (closed replica gate, queue bound, failed insert) is logged at most once a minute with its total since the process started. The closed-gate line names its cause and counts only answers that had rows to record, so the gate is asked when an answer's rows are queued. Reader strings pass through as_valid_unicode (server/core/hashing.py, shared with memory.for_file), so a lone surrogate costs no insert. An unnamed agent is stored as '-'. A user's erasure counts the receipts stamped up to the second it was recorded in, and its whole-org counts and delete run under the DDL deadline. The table keeps a row 190 days, so every row outlives six calendar months, and its agent column defaults to '-'. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…isions Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> # Conflicts: # tests/analyzer/shapes.txt
…receipts table schemas/schema.sql and docs/reference/schema.md carry the 190-day TTL and the agent column's default. The settings reference, schema and example carry the setting's comment. The read-receipts rolling-upgrade rule is rule 74, after the rule main numbers 73, and the rollback note names it. The design page's log table names the handler in the per-answer line and lists knowledge.search among the MCP reads filed under no run. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…answer once, and each read path's note has a test The time an erasure was recorded is bound once by the saga and by the restore replay (recorded_scope). The census reads it to the second and the code-index purge reads it directly, where it read the ledger row on every step. memory.for_file notes the rows of its answer in the handler, where the rows of the request's namespaces and of the caller's other namespaces meet, so one call covers both reads. search_sections builds the thread-history section in a helper, which keeps it inside the function-length limit. Tests: an integration case reads a row by its id, for a file and as a pinned row of the stack and compares each receipt with the stored revision; unit cases cover the stack's pinned and recalled rows and the body a procedure match is built from. Each fails when its note call is removed. Docs: loom.read_receipts is listed with its own 190 days, and the erasure section names the deadline to raise, LOOM_CH_TIMEOUT_DDL_S. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…wo more read paths' notes have a test recorded() answers the second the erasure was recorded in, as the ledger row holds it, so a first run and a resume bind the same value. The code-index purge holds for a code worker whose next pass was due anywhere in that second, on every run. Tests: an integration case reads a file's block that prints a row the caller wrote in another namespace and compares its receipt, filed under that namespace, with the stored revision. The stack's unit case answers only the columns its statements select. A purge case binds the time as a first run and as a resume do. Each fails when its behaviour is removed. Docs: the erasure section names the read deadline's setting. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… the purge's hold is tested at its deadline The stack's two row reads and the file read select `redacted_at` so a redacted row's receipt carries no hash; no test failed when a statement stopped selecting it. Each now has a case whose store answers only the selected columns, for a live row and a redacted one. The code-index purge waits a deadline past the end of the second the erasure was recorded in. A clock seam lets a test check the hold half a second before that end and at it, for a worker's newest row and for a first pass. The pages said a receipt is written half a second after its answer at the earliest; a row queued while the sender waits goes out sooner. They now say within about half a second, and state that the user census compares the reading replica's clock with the recording replica's with no margin. The description of `ch_batched_insert_background_wait_max_ms` names the receipt sender, which waits under it. The integration file's two settings cleanups check the server's answer and wait for what it serves. `recorded_at()` no longer floors a value `recorded()` floored, and the `after_write` docstring covers a detached task. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… copy it was read from A hit expanded to its whole body is receipted at the read that body came from: the row of loom.memory, or for a shared row its copy in loom.shared, whose version and hash the body read now returns (`shared_values` answers a value and a version). A governed hit keeps the note of the copy the term leg read, and a body the budget cut keeps its hit's note. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…client reported relying on A run's read receipts are the record of what Loom served it, and memories_used is the client's own statement of what it relied on. run.reliance joins the two in one viewer read: one entry per item, with the revisions the run was served and one of four states (returned, reported, reported_and_served, not_recorded). One function derives the state (server/tasks/domain/reliance.py) and every surface reads it through the op. No state means a mismatch: a read can leave no receipt, so a report with no record reads not_recorded. The answer names a revision by its stored versions, as decimal text, and carries no content hash and no reader: a receipt keeps the hash of a row that is redacted or labelled high-sensitivity after the read. The receipt statement returns one row per item, sorts the reported keys first and sorts an item's (hash, version) pairs before it cuts them. A cut answer (500 recorded items, 32 versions of each, truncated: true) therefore keeps every reported item and the highest versions. It has no time bound: a read can carry the run's id before the run's row is written and after the run closes. A failed receipt read fails the op, and a token narrowed below the namespace is refused, as for run.get. Surfaces: the wire op, the generated call in the five SDKs and agent.run.reliance in Python, loom call, loom_op by name, and the section "What this run read" in the dashboard's run detail. versionTime has its own module, so the shell's chunk does not carry it. Tests: unit cases for the function's truth table, the handler, the store statement's parameters and caps, and the op's contract; integration cases for each state against a server, for HTTP, the SDK, the CLI and MCP answering alike, for one run id in two namespaces and for a cut answer; the cross-principal walk probes the op with a seeded read; dashboard cases for the section and the run detail. Docs: the runs page has a section on what a run read, the read-receipts page a subsection on the op that reads a run. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
Main added rule 74 for an active worker source registration. The read receipts rule keeps its text and takes the next number, and the upgrade runbook's reference follows it. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…eceipt has a test over the wire A redacted or high-sensitivity row's note marks its hash as withheld, and no other note of that version adds it: a row redacted between a search's leg and its body read keeps its version, so the leg's hash named the removed text. The mark stays in the notes and is never stored. A row whose stored hash is set is noted without encoding its value; the value is hashed only where the column is unset. The design page says which reads hash the value they hold, what a hit served its source passage records, and that a governed definition of a later page keeps its hash. Tests: the keep-reading erasure test runs the erasure again where the first run ends with loom.read_receipts as its only residue, which the page documents, and reads the receipts step from the run that completed (a run that failed on residue lists no steps). The cleanup wait of the file-lookup test accepts the answer a second clear gets. New unit cases cover a withheld hash in both orders, a governed hit, a body no read returned, a shared copy that reads as high, a source passage and a later page's hits; new integration cases cover a whole body after a touch and a promoted row's shared copy. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Main's changes since the last merge touch no file of this change. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…hat get no receipt The design page names two more reads that get no receipt: a hit that is no stored memory row, and a memory.ask answer reused from an earlier one. A stored hash is read through hash_text where a statement's rows are noted, and a row whose hash is set returns the column's text without a second decode. A comment says why the fan-out of search.query hands its served hits to the handler inside the payload. Tests: a read made under a token and as no end user is filed under the token's subject and id, and a user erasure of that subject removes it while another subject's receipt stays. The keep-reading test waits for the last read's receipt before it runs the erasure a second time. The file-lookup test clears its override and waits out one refresh, as the receipts switch does. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…d list RunReliance is the third importer of useShowMore, so the build makes the hook a chunk of its own and the entry chunk's preload map gains its file name and the references to it: 58 characters, where the budget has 24 to spare, and `npm --prefix frontend run budget` fails. refreshDetail is in its own module, not in lib/format.ts, which loads with the shell. Only the lazily loaded Code view calls it, so it lands in that view's chunk and adds none: the entry chunk is 122,822 characters against 122,880, with 117 scripts in the build either way. The budget script and RunReliance are unchanged. The e2e fixture of run.reliance sits above the run.get comment, so that comment is on its function. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
…d its pages state what bounds it
A run id on a read is client input, and the receipt statement groups every
receipt that carries it before its LIMIT, so its cost is the caller's to
shape: one id on 2 million receipts of distinct revisions costs a call about
600 MB. receipted_items runs inside caller_shaped("one run id for each
run"): a read past the row, time or memory ceiling answers 422 with the way
to narrow it, where a memory refusal of the statement is otherwise a 500 with
no hint. The run row's point read stays outside. The statement is unchanged.
The wire comment, the reference and the runs page give the per-item cap in
its unit, (content hash, version) pairs. A version read with and without its
hash is two pairs and a receipt that names no revision is one, so an item
past its 32 pairs can list fewer than 32 versions, or all of them, with
truncated true. The statement and the cap are unchanged.
RunRelianceInput's first sentence names `run_id`: the loom_op catalogue row
lists no identity key as an argument, so its purpose is where a caller over
MCP learns what to send. The Go models' schema digest follows the docstring.
Docs:
- The runs page: a memory's versions are those of the stored row the read
held (the memory row's, its search document's or a shared copy's), which
memory.history does not all list; the Python SDK row names the reads that
carry a run (header or body, in a run scope and with auto_run) and no op
that writes no receipt; the answer's bounds are not the read's.
- The read-receipts page: the measured cost of the read as a range with its
conditions, where the filter test alone reaches the op's budget,
budget.violated as the sign of it, and the ceilings and the read deadline.
Tests:
- The receipt read alone runs in the caller-shaped scope, and a cap inside
it is a ValidationError with the hint.
- The bound of run.complete's memories_used is at most DERIVED_LIMIT: a cut
answer keeps every reported item only while that holds.
- A version read both ways counts twice against the pair cap.
- The cross-surface integration test holds a not_recorded item: the SDK and
the CLI answer as HTTP, and MCP lists the same items and states without
the empty fields its transport drops.
- A narrowed token is checked with honours_read_scope, which also covers a
group key, and three case names say what the cases check.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
…w's set hash is checked once Each server process sends its own receipts. The test waited for the last read's receipt, which proves only that the process that served it has sent. It now runs the erasure again until one completes, and each run that does not must name the receipts table as its only residue. row_content_sha256 returns the stored hash when it is set and hashes the value otherwise, without handing the stored column to live_sha256 for a second check that could not pass. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Main's change since the last merge is to the worker supervisor and its setting's description; it touches no file of this change by hand. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
run.reliance's receipt read runs inside caller_shaped, so the three LOOM_CH_CALLER_SHAPED_* ceilings bound it: a read past one answers 422. The comment above those settings lists the reads they bound, and the settings reference and the settings file template print it. An operator who lowers a ceiling for code.grep reads there that the same ceiling refuses run.reliance. docs/reference/configuration.md and loom.example.yaml are regenerated. The settings schema carries no comment and is unchanged. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
The section that lists what a run read loads from its own request, run.reliance, after run.get's answer draws the rest of the replay. A test that waits only for run.get's text can run axe before the table is drawn, and passes whether or not axe read it. The replay test waits for the table by its role and name before the axe check, so a replay that draws no table fails. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com>
The merge brings in the commits the read receipts change gained after this branch was cut from it. The hand-written files merge without a conflict: the two sides edit different parts of docs/architecture/read-receipts.md, server/settings/catalog.py and the leakage test. Seven files conflict, all of them derived from the registry or from a source file's hash. Each is produced again, none is merged by hand: - sdk/typescript/src/generated/ops.ts, the Ruby op table, sdk/rust/src/wire_models.rs and sdk/go/wire/models.gen.go are written by their generators, with rustfmt 1.85.1 and gofmt 1.27.4. - docs/reference/operations.md and docs/reference/status.md are written by docs_reference: 388 operations, 274 of them experimental. - tests/unit/session_content_senders.json pins the SHA-256 of the merged sources: sdk/python/loom/memory.py as the read receipts change left it and sdk/python/loom/run.py with RunClient.reliance. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Main carries the read receipts change as one commit with the content this branch already holds, so the difference from main is the run.reliance change alone: the same 54 files as before the merge. Two pages conflict, docs/architecture/read-receipts.md and docs/features/runs.md. Main's text of both is the text this branch was built on, so each keeps this branch's side: main's page plus the sections on run.reliance. Every generator of an op and of a setting, and the analyzer's shape list, is run again on the merged tree; each file is current. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
run.reliance's receipt read runs inside caller_shaped, so it runs as LOOM_CH_READER_USER and fails while ClickHouse refuses that user. The comment above the ceilings in server/settings/catalog.py lists it; two other lists of the same reads left it out: - the docstring and the message of _reader_user_problems (ch_reader_user_failing in /v1/health and loom doctor), which tell an operator which ops fail; - the Read-only user bullet of docs/operations/deployment.md. The three lists name the same five reads. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Main gained three commits while this branch was merged with it: reads over MCP filed under the identity the call names, the receipts that land after an erasure's census counted by loom erasure-re-verify, and ledger rows that store a string UTF-8 cannot encode. None touches a file of run.reliance by hand, and the merge has no conflict: docs/architecture/read-receipts.md and tests/analyzer/shapes.txt merge on their own, each side in its own lines. Every generator of an op and of a setting, and the analyzer's shape list, is run again on the merged tree; each file is current. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Main gained the knowledge factory example, its guide and its tests. They share no file with run.reliance, and the merge has no conflict. Every generator with --check and the analyzer's shape list are current on the merged tree. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…n was served The guide and two comments, one in the example and one in its unit test, said that no op serves a read's receipt. `run.reliance` lists the versions a run was served, and the example does not call it. The guide says so in its table of what Loom enforces, in its paragraph on `not_read` and in its coverage table, and the table's row links to "What a run read" in docs/features/runs.md. The example's calls, its `revision_receipts` coverage entry and expected.json are unchanged. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
`useShowMore` takes the type of the element that holds its rows. The section passes `HTMLTableElement`, reads the rows from the argument of `rows` and gives the hook's `list` to the table, so it keeps no ref of its own. The section's Show more test fails when the table lacks that ref. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…rker commands Main gained two commits: the Review queue opens a pending proposal by its address, and the `loom knowledge source worker-*` commands call the source worker's setup operations. The first adds `memory_keys` and `actor` to the proposal models, so the two generated wire-model files conflict: sdk/go/wire/models.gen.go and sdk/rust/src/wire_models.rs. Each is written again by its generator on the merged tree and holds main's proposal models and the run.reliance models. docs/features/dashboard.md, docs/guides/without-the-dashboard.md, the Python, Ruby and TypeScript op tables, tests/analyzer/cases/planes.py and tests/analyzer/shapes.txt merge on their own, each side in its own lines. Every generator of an op and of a setting passes --check on the merged tree, and the analyzer's shape list is current. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
…records Main gained two commits. Over MCP every receipted op is labelled with the session's run, and a run opened there names that run in `metadata.session_run`. Owner-only worker sources keep a private copy in the mirror. Four files conflict, and each keeps both sides: - server/tasks/app/run.py imports the reliance states and the session run helpers. - docs/features/runs.md: the paragraph on the receipts table names `run.reliance` and the session's reads of a run opened over MCP, and the Operations table holds main's `run.begin` row and the `run.reliance` row. - docs/architecture/read-receipts.md lists the source entry points of both. - sdk/go/wire/models.gen.go is written again by its generator. The "An MCP session" row of "What is listed" in docs/features/runs.md said that no answer gives an agent the id of its session's run. On main a run opened with `run.begin` over MCP names it in `metadata.session_run`, which `run.get` returns. The row now says that an MCP read is listed under the session's run, that `run.reliance` reads the one id it is given and does not follow that key, and that an agent calls it once for each id. tests/analyzer/shapes.txt is written again on the merged tree. Besides this branch's shape it replaces one shape of main's list: the knowledge source access read selects `owner_subject`, and the list held the statement without it. Every generator of an op and of a setting passes --check on the merged tree. tests/unit/test_degraded_unnoted.py fails on main and here for two handlers of server/knowledge/app/source_access.py, which this merge does not touch. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Main gained one commit: `memory.proposals` names no contradicting memory and counts no graded run outside the caller's read scope. It shares no file with run.reliance, and the merge has no conflict. Every generator of an op and of a setting passes --check on the merged tree, and the analyzer's shape list is current. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… read gate Main gained three commits: the prompt hook's risk label for a bug report's first pick, the `make bench-revision` target, and the worker copy read gate's broad handlers listed with the statement shapes regenerated. The merge has no conflict. Main's shape list now holds the knowledge source access read as this branch's list did, so tests/analyzer/shapes.txt differs from main by the shape of `run.reliance` alone. tests/unit/test_degraded_unnoted.py passes on the merged tree. docs/reference/configuration.md, loom.example.yaml, server/settings/catalog.py and tests/unit/session_content_senders.json merge on their own, each side in its own lines. Every generator of an op and of a setting passes --check on the merged tree, and the analyzer's shape list is current. Signed-off-by: Mohammad Lareb Zafar <lareb.zafar@clickhouse.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of: #1760
Related: #2137
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
run.reliancelists what one run read, at which revisions, and what its client reported relying on, with one state per item:returned,reported,reported_and_servedornot_recorded. The dashboard's run detail shows the same list in a section "What this run read".Why
A run's read receipts record what Loom served it, and
memories_usedis the client's own statement of what it relied on. Without the op the two are read apart: the receipts with SQL, the report throughrun.get. A reader who joins them by hand has to decide what a report with no receipt means, and each client that does so decides differently.run.reliancejoins them in one place. One pure function (server/tasks/domain/reliance.py) derives the state of each item, the handler is its only caller, and every surface reads the op. No state means a mismatch: a read can leave no receipt (receipts off, expired, a mirror leg, another label), so a report with no record readsnot_recorded, never "not served".Design in brief:
run.reliance, viewer, read-only, idempotent, experimental, not audited, budget 300 ms, in no MCP roster. Inputorg,namespace,run_id. Outputfound,items[](kind,key,state,revisions[].versions,last_served_at),truncated.loom.agent_runs, then one grouped read ofloom.read_receiptsunder the caller's(org, namespace)and the run's id. A namespace with no such run answersfound: falseand reads no receipt.(hash, version)pairs. An aggregate that stops at the first pairs it meets can drop the newest revision and answer differently between calls.not_recordedfor a record that exists.not_recordedfor a receipt that was not read.LOOM_CH_CALLER_SHAPED_*: 30 s, 4 GB and 500 M rows read by default) and, whereLOOM_CH_READER_USERis set, as the reader user. A read past a ceiling answers 422 with "narrow it (one run id for each run)"; without the ceilings a memory refusal of the statement is a 500 with no hint. The lists of the caller-shaped reads namerun.reliance: the settings reference, the settings file template, thech_reader_user_failingproblem and the Read-only user bullet ofdocs/operations/deployment.md.What is listed, by caller:
run_id) or the request carriesX-Loom-Run-Id.memory.searchandmemory.askcarry the header, andmemory.get,memory.bulk_getandcontext.packcarry the run in their body;memory.get_by_id,procedure.matchand the document reads carry neither. Withauto_runand no scope open, everymemory.*,working_memory.*,observe.*andcontext.*read carries the header;procedure.matchand the document reads carry none.run.begin, which lists the reads that name it. That run names the session's run inmetadata.session_run(run.get), and the op reads the one id it is given, so an agent calls it once for each id.Not listed: a read that wrote no receipt, an item of another namespace, a read older than the receipts' lifetime, which passage of a document was served, and who read (a run id on a read is client input, so the list can hold another caller's reads of the namespace's items under the same id).
A run that a plugin's hook opens lists the items of the context packs the hooks requested. The agent's own reads over MCP are filed under the session's run, a second row of the Runs list, and the hook's closing
run.completenames no memory, so that run holds no report afterwards. Linking the two is a follow-up owned by the run-label work, not this change.Alternatives rejected, with their cost:
content_sha256itemstorun.getrun.getpays the bloom read inside its budget, and a failed receipt read fails the replay.not_recordedfor reads labelled before the window. Kept as the one lever if the op exceeds its budget on a deployment.Later slices, each its own pull request: a run opens by its address in the dashboard; a run that names a session's run lists that session's reads made while it was open;
memories_usedentries carry the version relied on, which makesreported_and_servedreachable from the wire and changesrun.complete.Scope and risk
loom.agent_runsandloom.read_receiptsunder the caller's(org, namespace). The op is in neither set of ops a narrowed token may call, so a token narrowed below the namespace is refused before the handler, as forrun.get.run.get, the Recalled figure,recalled_keys,memory.outcome_run, the run-label work, and the "Memories the agent relied on" chips of the run detail, which stay when the read fails. The op does not readmetadata.session_run, which a run opened over MCP records: it lists the receipts under the one id it is given.LIMIT). Measured below. The caps of the answer (500 recorded items, 32(hash, version)pairs an item) do not bound the read; the caller-shaped ceilings do.truncatedtrue.not_recordeditem has norevisionsand nolast_served_atkey there. The items and states are the same on every surface.docs/guides/knowledge-factory-workflow.md) and two comments, one in the example and one in its unit test, said that no op serves a read's receipt. They say thatrun.reliancelists the revision a run was served and that the example does not call it. The example's calls, itsrevision_receiptscoverage entry (needs: read_receipts_op) andexpected.jsonare unchanged, so its result is too.refreshDetailmoves fromfrontend/src/lib/format.tstofrontend/src/lib/refreshDetail.ts. Only the lazily loaded Code view calls it, so it is built into that view's chunk and not into the entry chunk, whichlib/format.tsis part of (figures below).ch_reader_user_failingproblem (/v1/health,loom doctor) and its docstring namerun.relianceamong the reads that fail while ClickHouse refuses the reader user. The problem's code, severity and fix text are unchanged.Compatibility, rollout and rollback
run.reliance(experimental). No field, default or existing op changes.sdk/python:RunClient.reliance(run_id); the generated call in the TypeScript, Ruby, Rust and Go SDKs.Tests
Run locally on one loaded machine, against a ClickHouse and servers started for the run. Main moved while the run went on, and the branch is merged with it four times; the head is the last merge. A result names the tree it ran on where that is not the head.
What the merges needed:
sdk/go/wire/models.gen.goin both andsdk/rust/src/wire_models.rsin the first. Neither is merged by hand: each is written again by its generator, withrustfmtandgofmtfrom container images of the toolchains at the versions CI pins (Rust 1.85.1, Go 1.27.4).server/tasks/app/run.pyconflicts in its imports,docs/features/runs.mdin its paragraph on the receipts table and in its Operations table, anddocs/architecture/read-receipts.mdin its list of source entry points. Each keeps both sides.metadata.session_run. The "An MCP session" row of "What is listed" indocs/features/runs.mdsaid that no answer gives an agent the id of its session's run. It now says what the table above says.tests/analyzer/shapes.txtis written again after each merge. It differs from main's list by the shape ofrun.reliancealone.Passed at the head:
ruff format --check .,ruff check server extractor sdk/python tests scripts .claude, the function-length gate, the secrets check,biome lint frontend/src, Biome format on the changed dashboard files, and Prettier on the changed pages.--check: the Python, TypeScript, Ruby, Rust and Go SDK generators, the Rust fixtures,op_reach_census,docs_reference, the three settings generators, the admin routes, the plugin copies, and the standalone and served skill bundles.python -m tests.analyzer.corpus --writeleavestests/analyzer/shapes.txtas committed.make typecheck: 0 errors.-n 2, 621 passed and 12 skipped, the repository scans:test_package_contracts.py,test_op_transport_contract.py,test_tunable_constants.py,test_store_names_refused.py,test_degraded_unnoted.py,test_public_copy.py,test_doc_links.py,test_agent_instructions.py,test_session_content_senders.py,test_settings_defaults.pyandtests/analyzerwith no ClickHouse. The 12 skipped are the 10 that need aclickhousebinary on the machine and the two analyzer tests that need a ClickHouse.-n 2, 3062 passed, 23 skipped and 69 subtests passed, 46 files:run.reliance:test_run_reliance.py,test_sdk_run_reliance.py,test_run_ledger.py,test_ch_caller_shaped.py,test_arg_feedback.py,test_op_budgets.py,test_op_reach_census.py,test_op_surfaces.py,test_sdk_surface_contract.py,test_read_scope_admission.py,test_op_inputs_after_gate.py,test_docs_reference.py,test_sql_alias_shadow.py,test_reads_llm_free.py,test_integration_suite_targets.py,test_mcp_listing_budget.py,test_sdk_example_knowledge_factory.pyandtest_knowledge_factory_example.py.test_mcp_session_runs.py,test_read_receipts.py,test_run_reads_statement_sql.py,test_cli_surface_snapshot.py,test_proposal_triage.py,test_proposals_read_scope.py,test_conflicts_repo.py,test_cli_knowledge_source_worker.pyandtest_ch_params.py.frontend/srcorfrontend/e2e.clickhousebinary.tests/analyzer: 12 passed against the run's ClickHouse.npm --prefix frontend run buildpasses.npm --prefix frontend run budget:bundle-budget: OK. The entry chunk is 121,652 characters against the 122,880 budget, 1,228 under, with 120 scripts; the boot scripts are 188.5 kB gzipped against 198 kB.refreshDetailis built into the Code view's chunk, andversionTimeand the section into the Runs view's; none is in the entry chunk, whichlib/format.tsis part of. The flow reusesuseShowMore, a chunk of its own that the entry chunk names once.Passed at the third merge. The head differs from that tree under
server/,frontend/,sdk/, the migrations andtests/integrationby the comment of one setting inserver/settings/catalog.py:tests/integration/test_run_reliance.py(6 passed),tests/integration/test_read_receipts.py(20 passed) andtests/integration/test_mcp_session_run_scope.py(3 passed; its other 4 need auth on). The first two each hold a test that turns receipts off for the deployment, so they do not run beside each other.tests/integration/test_cross_principal_leakage.py, the walk as three principals, the core-set check and two positive controls (6 passed), andtests/integration/test_mcp_session_run_scope.py(7 passed). By hand on the same server: a viewer 200 withfound: false, a viewer narrowed toown_user403, another namespace's viewer 403, no token 401.knowledge.get, thenrun.begin, then amemory.get_by_idand amemory.getthat names the opened run.run.getthroughloom_opreturned the session's run inmetadata.session_run.run.reliancethroughloom_oplisted the document and the memory read by id asreturnedunder the session's run, and only the named read under the opened run.Passed at the first merge;
frontend/is the same at the head:lib/state.ts,api/review.ts), the source-scanning rule tests and the accessibility tests.Failed: none at the head. At the second merge
tests/unit/test_degraded_unnoted.pyfailed for two handlers ofserver/knowledge/app/source_access.py, a file this change does not touch, as it did on main at that commit. Main has since listed both, and the scan passes at the head.Not run:
frontend/e2e/fixtures.tsserves the new read toruns.spec.ts, whose replay test waits for the section's table before its axe check, so axe reads the table.tsc -btype-checks the spec, andRuns.detail.test.tsxfinds the table in the dialog by the same role and name.make formatandmake format-checkas targets: the machine has noshfmt. Of the formatters they call, ruff ran on the repository and Biome and Prettier on the changed files; the change holds no TOML or shell file.server/tasks/store/runs.pyis as it was then, andtest_ch_caller_shaped.pypasses at the head.The receipt read, measured. Taken at an earlier commit of this branch and not repeated at its head:
receipted_itemsand its statement's shape are the same there. One namespace seeded with runs of 20 items over 180 days,max_threads = 2, one run read, figures fromEXPLAIN indexes = 1andsystem.query_log. Cold is the first read after a restart of ClickHouse; the host's page cache is not dropped. A local measurement of one statement, not a benchmark.At 0.9 to 2.4 ms a million receipts, the filter test alone takes the op's 300 ms budget at 125 to 340 million receipts in one namespace;
docs/architecture/read-receipts.mdcarries the range.One run id reused across a namespace, measured apart on the op of a local server: with 2.0 M receipts of distinct revisions under one id, three calls answer 200 in 1.2 to 1.5 s with 500 items and
truncated; the statement reads 2,032,768 rows in 547 to 708 ms and uses 570 to 630 MB. That is under the 4 GB ceiling, so the read still answers; the ceilings bound the case above it.The plan names
PrimaryKeyonorg, namespaceandSkip: run_id_bloom_idx. To reproduce: insert the rows withINSERT INTO loom.read_receipts SELECT ... FROM numbers(N)(20 rows a run,tsspread over 180 days, 50,000 item keys), run the statement ofreceipted_itemsinserver/tasks/store/runs.pywithmax_threads = 2and alog_comment, then readread_rows,read_bytes,memory_usage,query_duration_msandProfileEvents['FilteringMarksWithSecondaryKeysMicroseconds']fromsystem.query_log.Coverage, not run on a deployment. The share of closed runs that report a memory and have a read on record under their own id, over the exposure ledger:
Over the receipts: the same statement with
loom.read_receiptsin place ofloom.memory_exposures. Both are lower bounds: a run closed again with no report is not counted.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code. Checked by running the gates listed above; not yet read line by line by a person.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make format-checkas a target needsshfmt, andrustfmtandgofmtran from container images. The fullmake test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.docs/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.py).main; no merged migration is edited: no migration.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version: no plugin file changes.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code