spec: the scope is cut to a safety net that produces evidence; the plane is retired

The maintainer's second decision of 2026-11-30. The requirements of dspy-driver are
approved, with a memory amendment: a cache in stage one, a case memory and a curator
that prunes as later stages. The kube and AX plane is retired and its removal is
listed as steps C1 to C5 of the roadmap. search-with-proof is deferred to a follow-up
spec in Docker on a dedicated runner, opened once the driver's baseline is read.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
Marius Ciepluch
2026-11-30 09:59:56 +01:00
co-authored by Claude Fable 5.2
parent 3bc7059fd3
commit b38dcdbc60
17 changed files with 174 additions and 21 deletions
+39
View File
@@ -128,6 +128,45 @@ Input for the requirements and task phases. The ids are this brief's.
| D9 | The handoff of the top suspects to the proof arm | `hunter-learning-loop` 7.6 |
| D10 | One read of an accepted program on a held-out pilot, at most once per program | `hunter-learning-loop` 6 |
## Memory for the driver (added 2026-11-30)
The maintainer: "we have a rustfs memory. how should dspy use it. memory is key to save cycles, and it can
improve. but we need a memory pruning and memory agent approach here. dspy has this, but it's missing".
Read on 2026-11-30:
- The store exists: `src/openultrasast/plane/memory.py`, a file backend and an S3 backend tested on RustFS,
rows per repository and pin, blobs by content (`excerpts/`, `embeddings/<model>/`, `responses/`,
`programs/`). `learn/` uses it (7 files). The driver in `hunt/` does not: it has only DSPy's local disk
cache. The store sits in the plane package, which is retired; it moves out first (roadmap step C1).
- DSPy 3.4.1 as installed exports `configure_cache`, `History`, `Embedder`, `Embeddings`, `KNN`,
`KNNFewShot`, `Retrieve` and tools for `ReAct`. It has no long-term memory, no pruning and no memory
agent. Those are ours to build.
Three stages. Each is entered by a result, as Requirement 7 demands; only M1 belongs to stage one.
| Stage | What the driver gets | Saves or improves | How it is measured |
| --- | --- | --- | --- |
| M1 Cache | Joern's results keyed by repository, revision, function digest, engine and query version; model answers keyed by the request digest; both in the store, so a second machine or a later session reuses them | saves cycles; changes no answer | run E0 and E1 twice: the second run starts no engine, makes no model call, and gives the same pages |
| M2 Case memory | every read example with a verified label becomes a case: its annotation, family, outcome and miss cause. Before answering, the driver retrieves the nearest cases and sees them as demonstrations | may improve | one experiment: with and without retrieval, on repositories the memory holds no case from |
| M3 Curator | a step that runs after an experiment, never while the driver answers: it writes cases, merges duplicates, scores each case by what happened when it was retrieved, and prunes | keeps M2 from decaying | one experiment: pruned against unpruned memory on the same held-out examples; pruning is a tombstone first, so it can be undone |
Rules that hold from M1 on:
- **Only verified labels enter the case memory:** a label from a fix or, later, from a demonstration. The
driver's own unverified answer is never stored as a case, or the memory learns the driver's mistakes.
- **Retrieval is held out by repository:** a question never retrieves a case from its own repository, and
no case comes from an admission or evaluation population.
- **A key carries its versions.** A cached result is void when the code, the engine, the query or the
program changed. That is the first pruning rule, and it needs no judgment.
- **Pruning reasons are a closed list:** version changed; duplicate of a kept case; contradicted by a later
verified label; retrieved often and unhelpful; over the cap for its family and framework.
- **The memory agent is a DSPy module of its own**, the curator of M3. Whether the driver also asks the
memory through a tool while it works, or receives the cases up front, is experiment E6's question.
Carried work added: **D11** the cache of M1 through the store (with D3); **D12** the case memory (M2);
**D13** the curator and pruning (M3). D12 and D13 have no criteria until E1 is read.
## Scope
- **In.** The driver's inputs, signature, module, sampling, compilation and output; the two producers; the