ADR-0028 — Listing's filter and order
- Status: Accepted
- Date: 2026-11-13
- Supersedes: none
- Authors: project maintainers
Context
A thread has many checkpoints, in several namespaces when it calls subgraphs. Listing must say which checkpoint's metadata a filter applies to, how threads are ordered, and whether subgraph namespaces appear.
Decision
The filter will be JSONB containment (@>) on each thread's latest root checkpoint's metadata.
Threads come newest first by that checkpoint's id, ties broken by thread_id. Only the root
namespace is listed.
Alternatives considered
- Match any checkpoint's metadata — rejected: a thread would list under values it no longer has, and each thread would need a scan of its history.
- Richer filters (step, source, ranges) — not now: each needs an expression index and a caller.
Consequences
- An application that put a key only in a thread's first run's metadata will not find the thread by it once later checkpoints lack it; the documentation says to pass filter keys on every run.
- Subgraph namespaces are never listed.