Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
2b463ad
A read's answer records the revision of each item it carried
zlareb1 Dec 4, 2026
b0bf4e8
The analyzer's shape list holds one shape for the schema dump
zlareb1 Dec 4, 2026
659b3bc
Read receipts name the rows an answer printed, log each loss with its…
zlareb1 Dec 4, 2026
73eee87
Merge remote-tracking branch 'origin/main' into feat/read-receipt-rev…
zlareb1 Dec 4, 2026
4d88eda
The generated schema, settings pages and rule numbers match the read-…
zlareb1 Dec 4, 2026
7dff08b
An erasure's recorded time has one source, memory.for_file notes its …
zlareb1 Dec 4, 2026
70f507a
An erasure's first run and its resume read one recorded second, and t…
zlareb1 Dec 4, 2026
c00a359
A redacted row's receipt has a test on each read that selects it, and…
zlareb1 Dec 4, 2026
1ee0018
Merge origin/main: a whole body's receipt names the row or the shared…
zlareb1 Dec 4, 2026
b5b3b69
run.reliance lists what a run read, at which revisions, and what its …
zlareb1 Dec 4, 2026
99d4107
Merge origin/main: read receipts take rolling-upgrade rule 75
zlareb1 Dec 4, 2026
b5c6266
A hash one read left out of a receipt stays out, and a whole body's r…
zlareb1 Dec 4, 2026
d1f261b
Merge origin/main into the read receipts branch
zlareb1 Dec 4, 2026
0b34236
A token's reads have a wire test, and the page names two more reads t…
zlareb1 Dec 4, 2026
0224199
The dashboard's entry chunk fits its budget with the run detail's rea…
zlareb1 Dec 4, 2026
4f73593
run.reliance's receipt read runs under the caller-shaped ceilings, an…
zlareb1 Dec 4, 2026
c35da0f
The keep-reading test reruns the erasure until it completes, and a ro…
zlareb1 Dec 4, 2026
46eb89a
Merge origin/main into the read receipts branch
zlareb1 Dec 4, 2026
d043a97
The settings reference names run.reliance among the caller-shaped reads
zlareb1 Dec 4, 2026
948021a
The replay's e2e axe check waits for the table of what the run read
zlareb1 Dec 4, 2026
62eee3c
run.reliance sits on the read receipts change at its last head
zlareb1 Dec 4, 2026
9a6508c
run.reliance sits on main, which holds the read receipts change
zlareb1 Dec 4, 2026
927edf2
The reader user's problem and the deployment page name run.reliance
zlareb1 Dec 4, 2026
22a322f
run.reliance sits on main's head
zlareb1 Dec 4, 2026
76b9142
run.reliance sits on main with the knowledge factory example
zlareb1 Dec 4, 2026
bc80714
The knowledge factory guide says run.reliance lists the revision a ru…
zlareb1 Dec 4, 2026
77afb38
The reliance section's table holds the ref useShowMore returns
zlareb1 Dec 4, 2026
865a790
run.reliance sits on main with the proposal address and the source wo…
zlareb1 Dec 5, 2026
6f50974
run.reliance sits on main with the session run a run opened over MCP …
zlareb1 Dec 5, 2026
b6b1cd6
run.reliance sits on main with the read scope of memory.proposals
zlareb1 Dec 5, 2026
b729e6a
run.reliance sits on main with the listed handlers of the worker copy…
zlareb1 Dec 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 55 additions & 2 deletions docs/architecture/read-receipts.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,10 @@ month.

## Reading the table

No op serves this table; it is read with SQL. Bound every statement by time: an item
that is read often has many rows, and a run's rows sit in every namespace it read.
`run.reliance` serves one run's items in one namespace
([the op that reads a run](#the-op-that-reads-a-run)); every other question is answered
with SQL. Bound every statement by time: an item that is read often has many rows, and a
run's rows sit in every namespace it read.

Which revision of an item a run saw:

Expand Down Expand Up @@ -443,6 +445,55 @@ When writing a statement over the table:
`request_id` in `loom.memory_exposures` carries the query's digest and the keys
returned.

### The op that reads a run

`run.reliance` reads the receipts of one run in the namespace its caller names, after
the run's row in `loom.agent_runs`: a namespace that holds no run with the id answers
`found: false` and reads no receipt. [What a run read](../features/runs.md#what-a-run-read)
gives the answer's states and limits.

- **One row an item.** The statement groups by `kind` and `item_key` and collects the
item's distinct `(content_sha256, version)` pairs, so its bound counts items and never
cuts inside one. The revisions are then grouped as the rule above says: on the hash
where there is one, on the version where there is none.
- **The reported keys sort first**, then the items served most recently. A report holds
at most 500 keys and the answer 500 recorded items, so a cut answer still holds every
reported item's receipts: a report reads as not recorded only when the run has no
receipt of the item.
- **The pairs are sorted before they are cut.** An item keeps its 32 highest pairs by
version. An aggregate that stops at the first pairs it meets can keep a different set
from one run of the statement to the next, and can drop the newest revision.
- **No time bound**, although a statement written by hand should carry one. A run's
labels can be older than its row: a header names any id, and `run.begin` can take that
id later. A lower bound from the run's start would answer "not recorded" for a record
that exists, and an upper bound at its close would drop the reads a resumed session
labels after the close. The read takes the `(org, namespace)` prefix of the key and
then tests the bloom filter on every granule of the namespace, so its cost grows with
the receipts the namespace keeps, not with the deployment's. The statement reads and
groups every receipt under the label before its `LIMIT`, so its cost also grows with
the receipts that carry the run's id.
- **What the read costs.** Measured on a local ClickHouse, warm, for one run of 20 items
with two threads: in a namespace of 4 million receipts the filter test takes 3 to 7 ms
and the statement 36 to 55 ms; in one of 16 million, 14 to 38 ms and 49 to 111 ms. At
that rate, 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. A `budget.violated`
event for `run.reliance` is the sign that a namespace has reached that size. A run id
on 2 million receipts of distinct revisions makes one call use about 600 MB and take
over a second.
- **No hash in the answer.** A receipt written before a row was redacted or labelled
high-sensitivity keeps that read's hash for the receipt's lifetime, and the hash of a
short secret names it as well as the value does. The op groups and matches on the hash
and answers a revision by its versions; a revision the record holds by hash alone is
answered with no version.
- **No reader in the answer.** The statement selects no reader column.
- **A failed read fails the op.** A partial list would print "not recorded" for a
receipt that was not read. A run id on a read is client input, so the receipt read is
the caller's to shape and runs under the caller-shaped ceilings
(`LOOM_CH_CALLER_SHAPED_*`): one that needs more rows, time or memory answers 422. One
past the read deadline (`LOOM_CH_TIMEOUT_READ_S`,
[statement classes](clickhouse.md#statement-classes-deadlines-and-traffic-classes))
fails the op.

## Cost

- **On the request's path**, a note is a dictionary write (a row whose stored hash is
Expand Down Expand Up @@ -675,6 +726,8 @@ own id alone.
- `server/transport/mcp_runs.py` (`_LABELLED_READS`, `session_label`) and
`server/tasks/domain/session_runs.py` (`session_run_of`): the run an MCP read is filed
under
- `server/tasks/store/runs.py` (`receipted_items`, the statement `run.reliance` runs)
- `server/tasks/domain/reliance.py` (`revisions_of`, `reliance`: the states)

## Related

Expand Down
2 changes: 1 addition & 1 deletion docs/features/dashboard.md

Large diffs are not rendered by default.

Loading
Loading