ADR 0046: A chunk write reports what it added, and a reader answers "which of these do I have?"

Status

Accepted.

Relates to ADR 0023, which stands — passages are still content-addressed and replaced a source at a time. This ADR does not change what is stored or how it is keyed; it changes what the two write and read surfaces are able to tell a caller about it. Relates to ADR 0044, which stands and is the direct cause of the defect below: an id derived from (source_id, text) makes a collision a normal outcome of chunking rather than a caller error, so the collapse it produces is correct and needs to be visible rather than prevented. Relates to ADR 0026, which stands — the new method lands on ChunkReader, the capability whose question it is, and not on the composed port. Relates to ADR 0012, which stands: this read is an index seek on the primary key, not a vector search, so nothing here bears on the ANN argument.

Closes BACKLOG B159 and B161.

Context

Both halves of this decision were found by a consumer, not by inspection, and both are the same absence seen from opposite sides: the store knew something the caller needed and had no way to say it.

The read. Every ChunkReader method was keyed on one thing — get on a chunk id, get_by_source on a source, get_by_entity on an entity. There was no way to ask about a set of ids, which is the question a resumable ingest asks on every batch. A caller loading a large corpus and wanting to skip what it already held had three options, and the third is the one that says a port is missing: