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]>
14 KiB
Requirements Document
Introduction
The driver is the model-driven hunter, a DSPy program. It should read a pushed change together with what abstract interpretation establishes about it (the access-control prover's ordered trace, Joern's taint and dominance results) and name the locations where the change introduces a bug. Today neither result reaches the driver, and no choice in its strategy has been settled by measurement.
The maintainer's condition for this spec, 2026-11-30: "i need this design to be empircally measureable and not theoretic. with that I want to avoid another endless circle of specs, that essentially cement things we have to undo".
So this document is staged. It specifies in full only the first stage: the example book, the wiring, the
delivery check (E0) and the baseline (E1). Each requirement ends in something that is run and read. The
later strategy questions (E2 to E6 of brief.md) are named in Requirement 7 and get their own criteria only
after the result before them has been read. Nothing is designed or built for a stage whose predecessor has
no result.
The thresholds in Requirements 5 and 6 are proposals. The maintainer confirms or changes them when approving this document; after that they are fixed before the runs.
Boundary Context
- In scope: the example book; the two producers that hand abstract interpretation to the driver; the record of one example; the rules of an experiment; the delivery check E0; the baseline E1; the rule by which later stages enter this spec.
- Out of scope: new engine queries or facts; the proof arm; the hook's output and its deadline; benchmark machinery; any admission run; families other than access control and path traversal; repositories other than AI-written web applications in TypeScript and Python.
- Adjacent expectations:
access-control-proversupplies the trace as it is today. The engine supplies its existing taint and dominance queries as they are today.hunter-learning-loopsupplies the runner, the paired ablation, the proposer and the acceptance rule as built. Where an experiment shows a fact is missing, the finding goes toengine-change-scoped-analysiswith the examples that show it; this spec does not add the fact.search-with-proofandpre-push-safety-netconsume the driver's ordered suspects later and are not changed here.
Requirements
Requirement 1: The example book
Objective: As the maintainer, I want a small set of real changes I can read end to end, so that every claim about the driver points at examples I can open.
Acceptance Criteria
- The example book shall hold ten vulnerable changes, five of access control and five of path traversal, each with its fixing change, and twenty ordinary changes from the same repositories.
- The example book shall draw every change from AI-written web application repositories in TypeScript or Python, with at least three vulnerable changes in each language.
- The example book shall record for each vulnerable change the repository, the two revisions, the family, the labelled file and line range, and the source that establishes the vulnerability.
- When the maintainer names a change as one to include, the example book shall include it or record why it cannot be used.
- If a candidate change belongs to a repository of any admission or evaluation population, then the example book shall refuse it and name the population.
- When the example book is frozen, the driver work shall record its digest, and every later record shall carry that digest.
- If an example is added, removed or relabelled after the freeze, then the driver work shall record a new digest and shall not compare results across the two digests as one series.
Requirement 2: Abstract interpretation reaches the driver
Objective: As the maintainer, I want the driver to receive what the prover and Joern establish about a change, so that a driver run measures the engine and not the hunter of October.
Acceptance Criteria
- When the driver is asked about an access-control example, the driver work shall give it the prover's ordered trace for the changed location: the entry, the request-derived arguments with their origin, the protected operation, the guards, and whether a guard dominates the operation.
- When the driver is asked about a path-traversal example, the driver work shall give it Joern's results for the changed functions: the path from a request source to a file operation with its steps, the sanitizers on that path, and the dominance answer.
- If a producer has no result for a location, then the driver work shall record one cause from a closed list (no entry recognised; operation not recognised; call unresolved; no source-to-sink path; language not supported; engine did not start; engine timed out) and shall hand the driver that statement in place of a result.
- The driver work shall record, for every producer run, the number of source bytes read, the engine's exit status and its run time.
- If a producer read zero source bytes or the engine exited with an error, then the driver work shall mark the annotation failed, and shall not record it as empty.
- The driver work shall run Joern in the shipped image for every recorded result.
- While an experiment is running, the driver work shall give every arm that includes an annotation the same annotation bytes for the same example.
Requirement 3: One page per example
Objective: As the maintainer, I want to see for any example what the driver was given, what it answered and why it missed, so that a number never stands without its cases.
Acceptance Criteria
- When a run finishes an example, the driver work shall write one page for it holding the annotation the driver received with its byte count, every answer the driver gave, the labelled location, and hit or miss.
- When a vulnerable example is missed, the driver work shall record one cause from a closed list: no annotation; annotation wrong; annotation right and not used; wrong family; wrong location.
- When an ordinary example draws a suspicion, the driver work shall record the suspicion and what the annotation said at that location.
- If a miss cause cannot be set from the records alone, then the driver work shall mark it "to be read" and the experiment's result shall count it separately until a person has set it.
- When the maintainer names an example and a run, the driver work shall show that page with one command.
- When the maintainer names an example and an arm, the driver work shall run that one example again with one command and state what the run costs before it starts.
Requirement 4: The rules of an experiment
Objective: As the maintainer, I want every change to the driver to be one measured comparison, so that no strategy choice enters the engine on argument alone.
Acceptance Criteria
- When an experiment is opened, the driver work shall record before any run: its question, the one thing that differs between its arms, the examples, the model and its version, the number of samples per question, the spend ceiling, and the rule that will read its result.
- The driver work shall run every arm of an experiment over the same examples.
- If two arms differ in more than the one recorded thing, then the driver work shall refuse the run.
- When an experiment ends, the driver work shall report per arm the vulnerable examples found out of the total, the suspicions per ordinary change, and the top-1, top-3 and top-5 hit counts, with the per-example table beside them.
- When an experiment runs on the example book alone, the driver work shall report counts and paired differences, and shall not report a recall rate without its interval.
- If the spend of an experiment reaches its ceiling, then the driver work shall stop, keep the finished records, and report what remains undone.
- If more than one example in ten of an arm ends in an instrument failure, then the driver work shall report the experiment as not read and shall give no comparison.
- When an experiment has been read, the driver work shall record its decision in one dated line: what was chosen, on which examples, and what would reverse it.
Requirement 5: The delivery check (E0)
Objective: As the maintainer, I want to know that the producers deliver before any model is called, so that the first paid run does not measure an empty input.
Acceptance Criteria
- When E0 runs, the driver work shall run both producers over every example of the book and shall make no model call.
- When E0 ends, the driver work shall report per family and per language the number of vulnerable examples whose annotation is nonempty and covers the labelled function, and the causes for the rest.
- When E0 ends, the driver work shall report the number of ordinary examples with a nonempty annotation.
- If fewer than four of the five vulnerable examples of a family carry an annotation that covers the labelled function, then the driver work shall report that family as not ready, and E1 shall not run for it.
- When a family is not ready, the driver work shall list the examples and causes that keep it so, as the input for the engine work.
- The driver work shall record the run time of each producer per example, with the engine's start-up time apart from the query time.
Requirement 6: The baseline (E1)
Objective: As the maintainer, I want to know whether abstract interpretation helps the driver find the bugs of the book, so that the central bet of the engine has a result.
Acceptance Criteria
- When E1 runs, the driver work shall run three arms over the example book with the driver as it is built today: no annotation; the prover's trace; Joern's results.
- The driver work shall report a family only under the arms whose annotation covers it, and under the arm without annotation.
- The driver work shall ask each question three times in every arm and shall count an example as found when at least two of the three answers name the labelled location within ten lines.
- When E1 ends, the driver work shall state for each family whether the annotated arm found at least two more of the five vulnerable examples than the arm without annotation, with no more suspicions per ordinary change.
- If no family meets that mark, then the driver work shall stop the strategy experiments and report the miss causes of Requirement 3 as the result, and the next step shall be the maintainer's decision.
- When a family meets the mark, the driver work shall name the annotated arm as the starting point of the next experiment for that family.
- The driver work shall keep the spend of E1 within the maintainer's ceiling of 10 USD.
- When E1 ends, the driver work shall publish its record under
benchmarks/measurements/with the example book's digest, the counts, the per-example pages and the proof that every input was read.
Requirement 7: Later stages enter one at a time
Objective: As the maintainer, I want the spec to grow only from results, so that it cements nothing that a later measurement would have to undo.
Acceptance Criteria
- The driver work shall hold these questions as later stages, each without criteria until it is opened: whether the tool loop earns its cost (E2); whether agreement across samples separates true suspects from false ones (E3); how the question is cut (E4); whether compilation on training repositories carries to held-out repositories (E5); whether the annotation is given up front or on demand (E6).
- When a stage is opened, the driver work shall add its criteria to this document as a dated amendment that cites the result it rests on.
- If the experiment before a stage has no read result, then the driver work shall not open the stage and shall not build for it.
- The design of this spec shall cover the open stage and the stages already read, and nothing beyond.
- When a later result contradicts a recorded decision, the driver work shall reverse the decision in a dated line and shall keep the earlier line as history.
- The driver work shall reuse the runner, the paired comparison, the proposer and the acceptance rule that exist, and shall add a new shared contract or abstraction only when two read experiments have needed it.
- Where a stage compiles the driver, the driver work shall compile on training repositories only, shall accept a program only when it passes the reversed-surface probe, and shall tune nothing on an admission label.
Requirement 8: Populations and honesty
Objective: As the maintainer, I want the driver work unable to touch what later qualifies a release, so that a good result here can still be tested fairly.
Acceptance Criteria
- The driver work shall read no case, label or result of an admission or evaluation population.
- If a run names a repository of such a population, then the driver work shall refuse the run before any model call.
- The driver work shall treat the example book as development data and shall quote no figure from it as a detection rate of the tool.
- The driver work shall record every model call with its model, version, sampling settings and cost.
- 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.