Report reliance as returned, reported, reported and served, or not recorded

Abierto
#1,760 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
24/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
clickhouse, python

Línea de trabajo

Start with the related proposal in #1149 and the named files server/memory/app/exposure_ledger.py, server/tasks/api/models_run.py, and server/memory/api/models_search.py; the issue says the required read-record version and hash storage is proposed separately in #1149. This issue also calls for a shared server-side state derivation, a changed memories_used wire shape, comparison output changes, and rollout evidence. Done means the four acceptance cases pass and the requested read-only deployment count and rolling-upgrade behavior are addressed.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement
Company

ClickHouse

Component

Conversations, sessions and runs

Use case

#1149 keeps two kinds of evidence apart: content Loom returned, and content a client says it relied on, which stays labeled client-reported. It also requires that unknown revisions and unavailable usage data remain explicit.

A report that joins the two has to say what it shows when the read record is missing, and a missing record is ordinary:

  • the ledger write is best-effort, and a failed write is logged and dropped (server/memory/app/exposure_ledger.py);
  • the ledger can be turned off (memory_exposure_ledger_enabled) and its rows expire;
  • a read that returned nothing writes no row;
  • a read made over MCP is filed under the connection's implicit run, not the run the client later completes (recalled_keys in server/tasks/api/models_run.py).

If the join reads "reported, no record" as a mismatch, it flags honest reports.

Describe the solution you'd like

Derive the reliance state on read, in one server-side function every surface uses. This is a proposal; nothing is implemented or measured.

State Meaning
returned The run's read record shows the item at that version or hash.
reported The client names the item as relied on. Labeled client-reported.
reported_and_served Reported, and the reported version or hash is in that run's read record.
not_recorded The run has no read record for the item.
  • not_recorded is never a mismatch. This proposal defines no mismatch state: one needs proof that a run's read records are complete, which the ledger does not give.
  • A read record written before revisions were recorded matches by key, and the state carries "revision not recorded".
  • memories_used entries gain the version the client relied on, and the content hash where the read returned one. A memory.search hit carries version and no content hash today (server/memory/api/models_search.py). An entry with a key alone stays valid and reads reported.
  • A second list beside memories_used would give two fields for one fact, so the entry changes shape. That changes a wire field, and the change names the break.
  • For tasks that ran under both compared revisions, the comparison in #1149 also names the tasks that improved and the tasks that regressed, and prints the excluded and ungraded counts beside the totals. Ungraded runs get a count and no pass share. The sample counts, configuration differences, uncertainty and the bar on causal claims stay as #1149 states them.

Acceptance fixture, added to the cases #1149 lists:

  1. A run that retrieves an item and does not report it reads returned.
  2. A report whose version or hash is in the run's read record reads reported_and_served.
  3. A report for a run with no read record reads not_recorded, also with the ledger turned off.
  4. A comparison with ungraded runs shows their count and no pass share for them.

Evidence still needed before rollout:

  • A read-only count, on a deployment with closed runs, of the share of runs naming memories_used that have a read record under the same run id. It sizes how often not_recorded appears and whether MCP reads need a join key.
  • How a replica of the previous build answers the new entry shape while two builds serve side by side during a rolling upgrade.
Describe alternatives you've considered
  • Flag every reported item without a read record as unmatched. The four cases above make that a false flag.
  • Keep reliance as keys. Two revisions of one key then stay indistinguishable.
  • Call the joined state "confirmed". Loom confirms that the revision was served, not that the agent used it.
Where the need comes from

An AI tool suggested this feature

Additional context

Found by source review; no report was computed.

The states read the version and hash a read record carries, which is a separate storage proposal under #1149. Without it a read record matches by key only, and no state can name a revision.

Related: Proposed as part of #1149. Roadmap: #1232.

Lenguaje dominante
Python
Estrellas
263
Forks
47
Merge medio
14 h 21 min
PR fusionados (30 d)
873

Preparar el entorno

Abrir en Codespaces

Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de ClickHouse/loom

Todos los issues de ClickHouse/loom

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.