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
+15
View File
@@ -210,3 +210,18 @@ that a good result here can still be tested fairly.
detection rate of the tool.
4. The driver work shall record every model call with its model, version, sampling settings and cost.
5. While no paid run is in progress, the driver work shall run with both API keys unset.
## Amendments
- **2026-11-30, at approval.** The maintainer approved this document ("approved.") and raised memory:
"memory is key to save cycles, and it can improve. but we need a memory pruning and memory agent approach
here". Two changes. (a) Requirement 2 gains criterion 8 and Requirement 5 criterion 7, below: the cache
that saves cycles belongs to stage one. (b) The later stages of Requirement 7.1 gain two: whether
retrieval of verified cases from memory improves the driver on repositories the memory holds no case from
(M2), and whether a curator that prunes keeps that gain (M3). Like E2 to E6 they have no criteria until
the result before them is read. The thresholds of Requirements 5 and 6 are approved as proposed.
- Requirement 2, criterion 8: When a producer is asked for a result it already holds for the same
repository, revision, function content, engine version and query version, the driver work shall return
the stored result and shall record that it did.
- Requirement 5, criterion 7: When E0 is run a second time on the unchanged example book, the driver work
shall start no engine and shall report the same annotations byte for byte.
+3 -2
View File
@@ -3,11 +3,12 @@
"created_at": "2026-11-30T00:00:00+01:00",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "requirements-generated",
"phase": "requirements-approved",
"approvals": {
"requirements": {
"generated": true,
"approved": false
"approved": true,
"note": "maintainer 2026-11-30: 'approved.'; thresholds of Requirements 5 and 6 as proposed; memory amendment recorded in requirements.md"
},
"design": {
"generated": false,