mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-04 02:38:18 +00:00
spec(dspy-driver): the driver gets its own spec, measured by example
The open work of hunter-learning-loop (4.1, 6 and the group 7 of the same day) moves to dspy-driver as D1 to D10. The brief maps the driving in seven stages and orders the experiments E0 to E6. The abstract interpretation is wired in before anything is measured: the prover's trace and Joern's results are not inputs of the driver today. HarnessX is gone from the tree, and the four plane modules the ledger suspected are still imported. Co-Authored-By: Claude Fable 5.2 <[email protected]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
1a9865496b
commit
e3f2f608d5
+10
-3
@@ -23,7 +23,7 @@
|
||||
# lines need were carried (the roadmap's spec map says where). Nothing was deleted, and
|
||||
# the "closes" lines of superseded specs are history, the 2026-12-01 date for mcp.py included.
|
||||
# frozen = built and kept; no new machinery until an arm moves its number on the training pool.
|
||||
# Three lines: hunter-learning-loop (driver), search-with-proof with proof-arm-opencode (proof),
|
||||
# Three lines: dspy-driver (driver; it continues hunter-learning-loop), search-with-proof with proof-arm-opencode (proof),
|
||||
# pre-push-safety-net (the developer sees it); engine-change-scoped-analysis feeds line 1.
|
||||
# The capability entries below with status "review" are still undecided; see "Open for the maintainer".
|
||||
|
||||
@@ -35,8 +35,15 @@ open_fronts = 0 # filled by the gate script once it exists
|
||||
|
||||
# ---------------------------------------------------------------- specs
|
||||
|
||||
[spec.dspy-driver]
|
||||
status = "active" # opened 2026-11-30
|
||||
line = "dspy-driver"
|
||||
phase = "initialized"
|
||||
owner = ["src/openultrasast/hunt"]
|
||||
closes = "n/a (active)"
|
||||
|
||||
[spec.hunter-learning-loop]
|
||||
status = "active"
|
||||
status = "done" # 2026-11-30: built; open tasks moved to dspy-driver
|
||||
line = "hunter-learning-loop"
|
||||
phase = "requirements-generated"
|
||||
owner = ["src/openultrasast/learn", "src/openultrasast/tool_hunter.py", "src/openultrasast/hunter_tools.py"]
|
||||
@@ -224,7 +231,7 @@ status = "review"
|
||||
spec = "plane-on-kubernetes"
|
||||
modules = ["plane (reconciler, runner, generate, manifests, harvest, egress, delivery, router, doctor, profile, engine_alerts, workspaces)"]
|
||||
lines = 4885
|
||||
closes = "Pathfinder U8 lists which modules only the retired HarnessX loop used (engine_alerts, harvest, workspaces, profile are the suspects); delete those"
|
||||
closes = "checked 2026-11-30: HarnessX is gone from the tree and engine_alerts, harvest, workspaces and profile are all imported by cli.py and by benchmarks/learn or ops/ax, so none is a HarnessX leftover; the entry closes with the plane-on-kubernetes decision"
|
||||
|
||||
[capability.regress]
|
||||
status = "removed" # f5a904b, 2026-10-13: deep mode records regress_retired; proof is the search line
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
"superseded_by": [
|
||||
"access-control-prover",
|
||||
"engine-change-scoped-analysis",
|
||||
"hunter-learning-loop"
|
||||
"dspy-driver"
|
||||
],
|
||||
"supersession_note": "Carried: 2.6 (registration-based entry points) goes to `engine-change-scoped-analysis`; 3.3 (the hunter judges intent and raises no evidence) goes to `hunter-learning-loop` group 7. The rest is covered by `access-control-prover` (operations, enforcement witnesses, dominance)."
|
||||
"supersession_note": "Carried: 2.6 (registration-based entry points) goes to `engine-change-scoped-analysis`; 3.3 (the hunter judges intent and raises no evidence) goes to `dspy-driver`. The rest is covered by `access-control-prover` (operations, enforcement witnesses, dominance)."
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
> **SUPERSEDED 2026-11-30** (maintainer decision; `.kiro/steering/roadmap.md`, top section of 2026-11-30). No work lands in this spec.
|
||||
> The directory stays as history. Carried: 2.6 (registration-based entry points) goes to `engine-change-scoped-analysis`; 3.3 (the hunter judges intent and raises no evidence) goes to `hunter-learning-loop` group 7. The rest is covered by `access-control-prover` (operations, enforcement witnesses, dominance).
|
||||
> The directory stays as history. Carried: 2.6 (registration-based entry points) goes to `engine-change-scoped-analysis`; 3.3 (the hunter judges intent and raises no evidence) goes to `dspy-driver`. The rest is covered by `access-control-prover` (operations, enforcement witnesses, dominance).
|
||||
|
||||
# Implementation Plan
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@
|
||||
"superseded_on": "2026-11-30",
|
||||
"superseded_by": [
|
||||
"engine-change-scoped-analysis",
|
||||
"hunter-learning-loop"
|
||||
"dspy-driver"
|
||||
],
|
||||
"supersession_note": "Carried: 2.14 (control dependence), 5.6 and 7.2 (a sanitizer cleanses its own family), 5.12 (the ranker knows one framework) and 7.4 (one matcher) go to `engine-change-scoped-analysis`; 5.2 (vibe-code pairs, one as a whole repository) goes to `hunter-learning-loop` 4.1. Dropped: 3.1 (its remainder: item 5c and step 6 of the handover), 5.1, 5.9, 5.10, 5.14, 6.1, 7.3, 7.5 to 7.8. One closing action is left: the record commit for item 5b."
|
||||
"supersession_note": "Carried: 2.14 (control dependence), 5.6 and 7.2 (a sanitizer cleanses its own family), 5.12 (the ranker knows one framework) and 7.4 (one matcher) go to `engine-change-scoped-analysis`; 5.2 (vibe-code pairs, one as a whole repository) goes to `dspy-driver` (D6). Dropped: 3.1 (its remainder: item 5c and step 6 of the handover), 5.1, 5.9, 5.10, 5.14, 6.1, 7.3, 7.5 to 7.8. One closing action is left: the record commit for item 5b."
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
> **SUPERSEDED 2026-11-30** (maintainer decision; `.kiro/steering/roadmap.md`, top section of 2026-11-30). No work lands in this spec.
|
||||
> The directory stays as history. Carried: 2.14 (control dependence), 5.6 and 7.2 (a sanitizer cleanses its own family), 5.12 (the ranker knows one framework) and 7.4 (one matcher) go to `engine-change-scoped-analysis`; 5.2 (vibe-code pairs, one as a whole repository) goes to `hunter-learning-loop` 4.1. Dropped: 3.1 (its remainder: item 5c and step 6 of the handover), 5.1, 5.9, 5.10, 5.14, 6.1, 7.3, 7.5 to 7.8. One closing action is left: the record commit for item 5b.
|
||||
> The directory stays as history. Carried: 2.14 (control dependence), 5.6 and 7.2 (a sanitizer cleanses its own family), 5.12 (the ranker knows one framework) and 7.4 (one matcher) go to `engine-change-scoped-analysis`; 5.2 (vibe-code pairs, one as a whole repository) goes to `dspy-driver` (D6). Dropped: 3.1 (its remainder: item 5c and step 6 of the handover), 5.1, 5.9, 5.10, 5.14, 6.1, 7.3, 7.5 to 7.8. One closing action is left: the record commit for item 5b.
|
||||
|
||||
# Implementation Plan: contributor-scan
|
||||
|
||||
|
||||
@@ -0,0 +1,156 @@
|
||||
# Brief: the DSPy driver
|
||||
|
||||
Opened 2026-11-30 on the maintainer's words: "I would like to approach this empircally as a focus, and
|
||||
measure the driver by example. I would like to focus on a dspy strategy and map out this driving soldily
|
||||
because it is the core of the engine. can we move this into an extra spec?"
|
||||
|
||||
This spec is line 1 of the roadmap of 2026-11-30 (`.kiro/steering/roadmap.md`, top section). It takes the
|
||||
open work of `hunter-learning-loop` (tasks 4.1, 6 and the group 7 added that day) and owns the driver from
|
||||
here. `hunter-learning-loop` keeps what it delivered: the feature table, the paired ablation, the proposer
|
||||
and the acceptance rule. This spec builds on that code and does not rebuild it.
|
||||
|
||||
## Problem
|
||||
|
||||
- **Who has it.** The maintainer, and after them a developer who pushes AI-written web application code.
|
||||
- **Today.** The driver is the model-driven hunter, a DSPy program (`src/openultrasast/hunt/program.py`).
|
||||
It was measured in October with inputs that describe the shape of the code around a change, and those
|
||||
inputs could not decide whether a change is unsafe. The project then built a deterministic prover and
|
||||
kept Joern, and never connected either to the driver. Read on 2026-11-30: no module under `hunt/`,
|
||||
`learn/` or the hunter tools imports `cpg`, and the prover's trace is not among the driver's inputs. So
|
||||
the core of the engine, a model that drives the search with what abstract interpretation establishes,
|
||||
does not exist as a running thing. Nobody has decided, on evidence, how the DSPy program should be built
|
||||
either: one call or a tool loop, how many samples, which optimiser, on what examples.
|
||||
- **What should change.** The driver is mapped out as a DSPy strategy, wired to the abstract
|
||||
interpretation, and every choice in that strategy is made by an experiment on named examples. The
|
||||
maintainer can open any example and see what the driver was given, what it answered, and why it missed.
|
||||
|
||||
## What exists (read in the code on 2026-11-30, not run)
|
||||
|
||||
| Part | Where | State |
|
||||
| --- | --- | --- |
|
||||
| Program | `hunt/program.py`: `HuntProgram`, a `dspy.Module`; a `dspy.ReAct` loop when tools are bound, else `dspy.Predict` | built |
|
||||
| Signature | `signature_for(mask)`: nine text inputs, one output `findings: list[Finding]` (path, line, family, confidence, rationale, cited lines) | built |
|
||||
| Inputs | change summary, hunks, enclosing function, callers, entry points, roles, def-use, a function-local obligations check, the family list | built; shape features |
|
||||
| Tools | `read_file`, `grep_repo`, `find_refs`, clamped to the repository | built |
|
||||
| Model | `build_lm`: DeepSeek through `dspy.LM`, disk cache, fixed temperature | built |
|
||||
| Runner | `hunt/runner.py`: one record per change, input digest, spend ledger, `InstrumentFailure` | built |
|
||||
| Metric | `hunt/metric.py`: `search_outcome` (a finding within 10 lines of the labelled location) and `search_metric` | built |
|
||||
| Ablation | `hunt/ablation.py`: paired arms over the same changes, repository-clustered bootstrap | built |
|
||||
| Proposer | `hunt/propose.py`: GEPA, MIPROv2 or BootstrapFewShot, one change per round, on compile folds | built |
|
||||
| Acceptance | `hunt/accept.py`: compile and held-out folds both non-negative, one strictly positive | built |
|
||||
| Probe | `core/probes.py`: reversed-surface probes against shortcuts | built |
|
||||
| Prover trace | `hunt/prover.py` over `semantic/` (tree-sitter, control-flow graph, dominance, abstract domain, path composition); access control | built; **not an input of the driver** |
|
||||
| Joern | `cpg/`, used by `model/taint.py`, `model/dominance.py` and `push/` | built; **not reachable from the driver** |
|
||||
| Sampling | one answer per question | **missing**: no repeated sampling, no agreement score |
|
||||
| Examples | pool manifests and a feature table | **missing**: no small set a person can read end to end |
|
||||
|
||||
## The driving, mapped
|
||||
|
||||
One pushed change goes through these stages. Each stage names the choice that is open and the experiment
|
||||
that settles it.
|
||||
|
||||
1. **The question.** One change, and per changed function one question: does this change introduce a
|
||||
weakness of family F that an attacker can reach? Open: one question per change or one per changed
|
||||
function and family (E4).
|
||||
2. **What abstract interpretation says.** Two producers, each proving it read nonzero input.
|
||||
- The prover's ordered trace: the entry, the request-derived arguments with their provenance, the
|
||||
protected operation, the guards and whether one dominates. Family: access control.
|
||||
- Joern's results for the changed functions: the taint path from a request source to a sink with its
|
||||
steps, the sanitizers on it, the dominance answer. Family first: path traversal.
|
||||
- A location with no result says why (no entry recognised, operation not recognised, unresolved call,
|
||||
engine did not start). An empty annotation and a failed one are different records.
|
||||
Open: whether the results are handed over up front, or the driver asks for them through a tool (E6).
|
||||
3. **The signature.** Inputs: the change, the abstract interpretation for it, the family definition.
|
||||
Output: suspects, each with a location, a family, the step of the trace it rests on, and a rationale.
|
||||
Open: one signature for all families or one per family; one step or two (locate, then judge) (E4).
|
||||
4. **The module.** `dspy.Predict`, `dspy.ChainOfThought` or the `dspy.ReAct` tool loop. Open: whether the
|
||||
tool loop still earns its cost once the trace is in the input (E2).
|
||||
5. **The probabilistic loop.** The question is asked k times. A suspect's score is the share of samples
|
||||
that name it. The score orders suspects; it establishes nothing. Open: k, the temperature, and whether
|
||||
agreement separates true suspects from false ones at all (E3).
|
||||
6. **Compilation.** Instructions and demonstrations chosen by a DSPy optimiser on compile folds of
|
||||
training repositories, accepted by the existing rule, and passed through the reversed-surface probe.
|
||||
Open: instructions only (GEPA with the metric's feedback) against demonstrations (bootstrap), and
|
||||
whether either beats the uncompiled program on held-out folds (E5).
|
||||
7. **The output.** Ordered suspects go to the proof arm as starting intents (`search-with-proof` 7.1) and
|
||||
to the hook as advisory lines (`pre-push-safety-net` 18.1). The driver's opinion never becomes
|
||||
evidence: a finding needs the trace's own rule or a demonstration.
|
||||
|
||||
## Method: measure by example
|
||||
|
||||
- **The example book.** A small set of real changes that a person can read end to end, in the chosen
|
||||
scope: access control and path traversal, in AI-written web applications (Express/TypeScript,
|
||||
FastAPI/Python). To start: ten vulnerable changes, five per family, each with its fixed side, and
|
||||
twenty ordinary changes from the same repositories. Each is a `dspy.Example` with the labelled
|
||||
location and family. The book is development data: it is open, it is looked at, and nothing in it is
|
||||
ever an admission case.
|
||||
- **One page per example.** What the producers gave the driver (with byte counts), the k answers, the
|
||||
agreement score, hit or miss, and for a miss one cause from a closed list: no annotation; annotation
|
||||
wrong; annotation right and ignored; wrong family; wrong location; ordinary change flagged.
|
||||
- **One experiment at a time.** An experiment names its lever, changes one thing, runs the same examples
|
||||
on both arms, and reports the paired difference with the per-example table beside it. Its manifest is
|
||||
fixed before it runs. This is rule 12 of `detection-quality.md`.
|
||||
- **Three sets, never mixed.** The example book (read freely), the training set with its compile and
|
||||
held-out folds (teaches and selects), and the admission populations (untouched, read once).
|
||||
- **Two numbers and the table.** Search recall on vulnerable changes and suspicions per ordinary push,
|
||||
with counts and intervals, and top-K recall per push (K = 1, 3, 5). At book size the intervals are wide:
|
||||
the book shows mechanisms and causes, the training set gives the numbers.
|
||||
|
||||
## Experiments, in order
|
||||
|
||||
| Id | Question | Arms | Needs |
|
||||
| --- | --- | --- | --- |
|
||||
| E0 | Do the producers deliver? | share of examples with a nonempty annotation, per family and producer | D1, D2, D3; no model call |
|
||||
| E1 | Does abstract interpretation help the driver? | no annotation; prover trace; Joern results | E0 |
|
||||
| E2 | Does the tool loop earn its cost? | Predict; ChainOfThought; ReAct | E1 |
|
||||
| E3 | Does agreement mean anything? | k = 1, 3, 5; score against hit or miss | E1 |
|
||||
| E4 | How should the question be cut? | one signature; one per family; locate then judge | E2 |
|
||||
| E5 | Does compilation generalise? | uncompiled; GEPA instructions; bootstrap demonstrations; on held-out folds | D6, E4 |
|
||||
| E6 | Up front or on demand? | annotation in the input; annotation behind a tool | E2 |
|
||||
|
||||
E0 costs nothing and comes first. E1 is the baseline of the roadmap's step N1 and has the maintainer's
|
||||
ceiling of 10 USD. Every later experiment needs its own ceiling.
|
||||
|
||||
## Carried work
|
||||
|
||||
Input for the requirements and task phases. The ids are this brief's.
|
||||
|
||||
| Id | Work | From |
|
||||
| --- | --- | --- |
|
||||
| D1 | The example book: the thirty changes, their labels, the page format, the closed list of miss causes | new |
|
||||
| D2 | The prover's trace as an annotation of `HuntProgram` | `hunter-learning-loop` 7.1a; `reachability-flow-model` 4.1 |
|
||||
| D3 | Joern's results as an annotation: one run per revision, cached, in the shipped image, engine exit code on record | `hunter-learning-loop` 7.1b |
|
||||
| D4 | The baseline in three arms (E1) | `hunter-learning-loop` 7.2 |
|
||||
| D5 | Repeated sampling, the agreement score, top-K recall per push | `hunter-learning-loop` 7.3; `learned-decision-engine` 17.1, 17.2 |
|
||||
| D6 | The training set apart from every admission population, with vibe-code pairs, one as a whole repository | `hunter-learning-loop` 4.1; `contributor-scan` 5.2 |
|
||||
| D7 | Compilation on training repositories, the acceptance rule, the reversed-surface probe | `hunter-learning-loop` 7.4; `learned-decision-engine` 16 |
|
||||
| D8 | The driver gives an opinion on intent and raises no evidence | `hunter-learning-loop` 7.5; `authorization-obligations` 3.3 |
|
||||
| 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 |
|
||||
|
||||
## Scope
|
||||
|
||||
- **In.** The driver's inputs, signature, module, sampling, compilation and output; the two producers; the
|
||||
example book; the experiments above.
|
||||
- **Out.** New engine queries or facts (they go to `engine-change-scoped-analysis`, and only when an
|
||||
experiment names the missing fact). The proof arm. The hook's output and its deadline. Benchmark
|
||||
machinery. Families other than the two chosen, until E1 has been read.
|
||||
|
||||
## Constraints
|
||||
|
||||
- Admission and evaluation populations never train and are never read during this work.
|
||||
- Software shape features alone decide nothing; a compiled program passes the reversed-surface probe.
|
||||
- A zero proves its instrument: every producer and every run records the bytes it read and the exit codes.
|
||||
- Joern runs in the shipped image, once per revision, offline for these runs. Its start-up time is recorded
|
||||
and does not gate an experiment.
|
||||
- Paid runs have a ceiling set by the maintainer before they start. Both API keys are unset for anything
|
||||
that is not a paid run.
|
||||
- Standard metrics, plain English, ASCII in written files.
|
||||
|
||||
## Open questions for the requirements phase
|
||||
|
||||
- Which thirty changes go into the example book, and from which repositories. The maintainer may want to
|
||||
name some: the bugs they want to avoid.
|
||||
- Whether the driver stays on DeepSeek for every experiment, or a second model is an arm.
|
||||
- Whether the driver's records adopt the core's model contract (`hunt/model_contract.py`) from the start.
|
||||
- What "found" means for path traversal: the sink line, the unsanitised step, or either.
|
||||
@@ -0,0 +1,27 @@
|
||||
# Requirements Document
|
||||
|
||||
## Project Description (Input)
|
||||
**Who has the problem.** The maintainer, and after them a developer who pushes AI-written web application
|
||||
code (Express/TypeScript, FastAPI/Python) and wants to be told about the access-control and path-traversal
|
||||
bugs in a change before it ships.
|
||||
|
||||
**Current situation.** The driver, the model-driven hunter, is a DSPy program (`src/openultrasast/hunt/`).
|
||||
It was measured in October 2026 on inputs that describe the shape of code and cannot decide unsafety. The
|
||||
abstract interpretation the project has, the access-control prover's ordered trace and Joern's taint and
|
||||
dominance results, is not connected to it: no module under `hunt/` imports `cpg`, and the trace is not among
|
||||
the driver's inputs. The choices of the DSPy strategy (one call or a tool loop, how many samples, which
|
||||
optimiser, which examples) were never settled by measurement.
|
||||
|
||||
**What should change.** The driver becomes the mapped-out core of the engine: it reads a change together
|
||||
with what abstract interpretation establishes about it, is sampled several times and scored by agreement,
|
||||
and is compiled on training repositories only. Every choice in that strategy is made by one experiment on
|
||||
named examples, and a small example book lets the maintainer read, per example, what the driver was given,
|
||||
what it answered and why it missed. Admission populations are never read by this work.
|
||||
|
||||
The map of the driving, the method, the ordered experiments E0 to E6 and the carried work D1 to D10 are in
|
||||
`brief.md`.
|
||||
|
||||
## Requirements
|
||||
<!-- Will be generated in /kiro-spec-requirements phase -->
|
||||
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"feature_name": "dspy-driver",
|
||||
"created_at": "2026-11-30T00:00:00+01:00",
|
||||
"updated_at": "2026-11-30T00:00:00+01:00",
|
||||
"language": "en",
|
||||
"phase": "initialized",
|
||||
"approvals": {
|
||||
"requirements": {
|
||||
"generated": false,
|
||||
"approved": false
|
||||
},
|
||||
"design": {
|
||||
"generated": false,
|
||||
"approved": false
|
||||
},
|
||||
"tasks": {
|
||||
"generated": false,
|
||||
"approved": false
|
||||
}
|
||||
},
|
||||
"ready_for_implementation": false,
|
||||
"roadmap_state_2026_11_30": "active, line 1 (the driver finds the bugs); takes hunter-learning-loop 4.1, 6 and group 7",
|
||||
"builds_on": [
|
||||
"hunter-learning-loop",
|
||||
"access-control-prover"
|
||||
]
|
||||
}
|
||||
@@ -493,7 +493,7 @@ declare, so both single-query sub-routes (CLI `--param` and session named-arg) r
|
||||
|
||||
Maintainer decision of 2026-11-30 (`.kiro/steering/roadmap.md`, top section). This brief is the home of the
|
||||
engine work the driver needs. It supplies facts to the driver; it claims no detection number of its own.
|
||||
Nothing below starts before the driver's baseline (`hunter-learning-loop` 7.2) or its ablation names it as
|
||||
Nothing below starts before the driver's baseline (`dspy-driver` D4, experiment E1) or its ablation names it as
|
||||
the missing fact: the lever and its number first (`detection-quality.md` rule 12).
|
||||
|
||||
Carried from `contributor-scan` (superseded):
|
||||
|
||||
@@ -20,5 +20,6 @@
|
||||
}
|
||||
},
|
||||
"ready_for_implementation": false,
|
||||
"roadmap_state_2026_11_30": "active, line 1 (the driver finds the bugs); group 7 added"
|
||||
"roadmap_state_2026_11_30": "built; takes no new work; open tasks 4.1, 6 and group 7 moved to dspy-driver",
|
||||
"continued_by": "dspy-driver"
|
||||
}
|
||||
|
||||
@@ -93,48 +93,10 @@
|
||||
- Done when the measurement record exists with the before-and-after table and the instrument proof for every change
|
||||
- _Requirements: 7.3, 7.4, 7.5, 8.1, 8.2, 8.3, 8.6_
|
||||
|
||||
## Amendment of 2026-11-30: the driver on the trace (roadmap line 1)
|
||||
## Amendment of 2026-11-30: the open work moves to `dspy-driver`
|
||||
|
||||
Maintainer decision of 2026-11-30 (`.kiro/steering/roadmap.md`, top section): "for me it's prio that the
|
||||
driver (augmented by abstract interpreation and wrapped into probablistic dspy loops) finds bugs I want to
|
||||
avoid". This spec is the driver's spec and is active again. The correction of 2026-10-14 is narrowed: the
|
||||
driver may be compiled on compile folds of training repositories; admission and evaluation populations never
|
||||
train; software shape features alone decide nothing. Tasks 4.1 and 6 stay open as written. Group 7 is new.
|
||||
Requirements and design do not yet say this: run `/kiro-spec-requirements hunter-learning-loop` and
|
||||
`/kiro-spec-design hunter-learning-loop` for the amendment before group 7 is implemented beyond 7.1 and 7.2,
|
||||
which only measure what exists.
|
||||
|
||||
- [ ] 7. The driver reads the abstract interpretation and runs as a probabilistic DSPy loop
|
||||
- [ ] 7.1 Put the trace into the driver's input
|
||||
- The prover's ordered trace for a changed location (entry, request-derived arguments with provenance, the protected operation, the guards and whether one dominates) and the engine's facts for it become one annotation of `HuntProgram`, beside the diff hunk; a location with no trace says so with its cause, and is not dropped
|
||||
- Done when the driver runs on a fixture change with and without the annotation and the record shows the trace bytes it was given, nonzero
|
||||
- _Carried from: reachability-flow-model 4.1 (path context for the hunter)_
|
||||
- [ ] 7.2 Baseline: the driver with and without the trace on the training pool (roadmap N1)
|
||||
- Same changes, same program and same sampling for both arms over `benchmarks/valid/train/pool-train.toml`, through the paired ablation of 4.3; search recall and suspicions per ordinary push, per family and pooled, with intervals; the record proves nonzero input for every change
|
||||
- Paid: needs the maintainer's spend ceiling before it starts
|
||||
- Done when the measurement record exists under `benchmarks/measurements/` in the fixed schema of `detection-quality.md` rule 3
|
||||
- _Depends: 7.1_
|
||||
- [ ] 7.3 Sample the driver and score by agreement
|
||||
- Each question is asked k times; a location's score is the share of samples that name it; k, the temperature and the model version are fixed in the manifest before the run; the score orders suspects and never establishes a defect
|
||||
- Report top-K recall per push (K = 1, 3, 5) of the true vulnerable function among the changed functions
|
||||
- Done when a fixture run with the scripted model yields the scores, and the top-K metric is reported beside search recall
|
||||
- _Carried from: learned-decision-engine 17.1, 17.2 (the triage objective)_
|
||||
- [ ] 7.4 Compile the loop on training repositories (roadmap N3)
|
||||
- The proposer of 5.1 and the acceptance rule of 5.2 over the training set of 4.1; instructions and demonstrations only, chosen on compile folds, never on held-out folds or an admission population
|
||||
- Every accepted program passes the reversed-pair probe of `src/openultrasast/core/probes.py` before any admission read; a program that separates reversed fixes by diff shape is rejected and recorded
|
||||
- Done when one accepted or rejected candidate exists with its compile-fold and held-out results and its probe result
|
||||
- _Carried from: learned-decision-engine 16 (the jointly optimised LLM program)_
|
||||
- _Depends: 4.1, 7.2, 7.3_
|
||||
- [ ] 7.5 The driver judges intent and raises no evidence
|
||||
- Where the trace shows an operation with no dominating check, the driver says whether the entry is meant to be open, as a ranked opinion; it cannot turn a suspect into a finding. A finding needs the trace's own rule or a demonstration
|
||||
- Done when a test shows a driver opinion changes the order of suspects and never their evidence class
|
||||
- _Carried from: authorization-obligations 3.3_
|
||||
- [ ] 7.6 Hand the top suspects to the proof arm
|
||||
- The top-K suspects of a push go to `search-with-proof` as starting intents, with the trace; the record carries the proof arm's workload per 100 pushes
|
||||
- Done when one training-pool change runs driver to search on a fixture executor and the handoff record names the suspect, the trace digest and the search outcome
|
||||
- _Depends: 7.3; search-with-proof 7.1_
|
||||
|
||||
Folded into 4.1 from `contributor-scan` 5.2: the training set holds vibe-code pairs, and at least one of them
|
||||
as a whole repository. The maintainer named them on 2026-11-30: the families are access control and path
|
||||
traversal; the repositories are AI-written web applications, Express/TypeScript and FastAPI/Python. This
|
||||
narrows 4.1's "two languages" to TypeScript and Python. The spend ceiling for 7.2 is 10 USD.
|
||||
Maintainer decision of 2026-11-30 (`.kiro/steering/roadmap.md`, top section). The driver gets a spec of its
|
||||
own, `.kiro/specs/dspy-driver/`. This spec keeps what it delivered (the feature table, the paired ablation,
|
||||
the proposer, the acceptance rule) and takes no new work. Its open tasks move: 4.1 is D6 there, 6 is D10,
|
||||
and the group 7 that was added here earlier the same day (commit `1a98654`) is D2 to D5 and D7 to D9. The
|
||||
boxes of 4, 4.1 and 6 stay unticked here as the record; they are not this spec's to close.
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
"phase_before_supersession": "implementation",
|
||||
"superseded_on": "2026-11-30",
|
||||
"superseded_by": [
|
||||
"hunter-learning-loop",
|
||||
"dspy-driver",
|
||||
"search-with-proof",
|
||||
"engine-change-scoped-analysis"
|
||||
],
|
||||
"supersession_note": "Carried: 16 (the jointly optimised LLM program) and 17.1, 17.2 (top-K recall per push) go to `hunter-learning-loop` group 7; 17.3 goes to `search-with-proof` group 7; 11.1 and 11.2 (discharge facts mined from fix diffs, admitted by held-out separation) go to `engine-change-scoped-analysis`. Dropped: 6.7, 7, 8, 9, 10, 11.3 to 11.6, 12, 13, 14 and 15 (the classifier fitted on features, which the correction of 2026-10-14 rules out)."
|
||||
"supersession_note": "Carried: 16 (the jointly optimised LLM program) and 17.1, 17.2 (top-K recall per push) go to `dspy-driver`; 17.3 goes to `search-with-proof` group 7; 11.1 and 11.2 (discharge facts mined from fix diffs, admitted by held-out separation) go to `engine-change-scoped-analysis`. Dropped: 6.7, 7, 8, 9, 10, 11.3 to 11.6, 12, 13, 14 and 15 (the classifier fitted on features, which the correction of 2026-10-14 rules out)."
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
> **SUPERSEDED 2026-11-30** (maintainer decision; `.kiro/steering/roadmap.md`, top section of 2026-11-30). No work lands in this spec.
|
||||
> The directory stays as history. Carried: 16 (the jointly optimised LLM program) and 17.1, 17.2 (top-K recall per push) go to `hunter-learning-loop` group 7; 17.3 goes to `search-with-proof` group 7; 11.1 and 11.2 (discharge facts mined from fix diffs, admitted by held-out separation) go to `engine-change-scoped-analysis`. Dropped: 6.7, 7, 8, 9, 10, 11.3 to 11.6, 12, 13, 14 and 15 (the classifier fitted on features, which the correction of 2026-10-14 rules out).
|
||||
> The directory stays as history. Carried: 16 (the jointly optimised LLM program) and 17.1, 17.2 (top-K recall per push) go to `dspy-driver`; 17.3 goes to `search-with-proof` group 7; 11.1 and 11.2 (discharge facts mined from fix diffs, admitted by held-out separation) go to `engine-change-scoped-analysis`. Dropped: 6.7, 7, 8, 9, 10, 11.3 to 11.6, 12, 13, 14 and 15 (the classifier fitted on features, which the correction of 2026-10-14 rules out).
|
||||
|
||||
# Implementation Plan
|
||||
|
||||
|
||||
@@ -682,7 +682,7 @@ Preserve all completed task evidence below.
|
||||
- Deferred by the same decision, not dropped: 11.3 (batch path through the session), 13.2 and 13.3 (PHP transfer). 15 stays provisional. 8.3 and 16 stay open as written.
|
||||
- _Boundary: hook output and scan report_
|
||||
- [ ] 18.1 Advisory suspects from the driver
|
||||
- The hook consumes the driver's ordered suspects for the pushed change (`hunter-learning-loop` 7.3) through the consumer contract of the core; each line names the location, the family and what the trace shows; the count per push is bounded and the bound is stated
|
||||
- The hook consumes the driver's ordered suspects for the pushed change (`dspy-driver` D5) through the consumer contract of the core; each line names the location, the family and what the trace shows; the count per push is bounded and the bound is stated
|
||||
- Done when a push on a development-pool repository prints the suspects, and a push with the driver unavailable prints one operational notice and no suspect
|
||||
- [ ] 18.2 A demonstrated finding in the hook output
|
||||
- The hook prints the artifact of `search-with-proof` 7.2 in one bounded block; BLOCK is offered only for a demonstration, and only where the user chose blocking
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
"phase_before_supersession": "tasks-generated",
|
||||
"superseded_on": "2026-11-30",
|
||||
"superseded_by": [
|
||||
"hunter-learning-loop",
|
||||
"dspy-driver",
|
||||
"access-control-prover"
|
||||
],
|
||||
"supersession_note": "Carried: 4.1 (the path_context tool and a path-scoped prompt) goes to `hunter-learning-loop` group 7. The rest is covered by the path records of `access-control-prover`; if the driver's ablation shows a missing path, the work reopens under `engine-change-scoped-analysis`."
|
||||
"supersession_note": "Carried: 4.1 (the path_context tool and a path-scoped prompt) goes to `dspy-driver`. The rest is covered by the path records of `access-control-prover`; if the driver's ablation shows a missing path, the work reopens under `engine-change-scoped-analysis`."
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
> **SUPERSEDED 2026-11-30** (maintainer decision; `.kiro/steering/roadmap.md`, top section of 2026-11-30). No work lands in this spec.
|
||||
> The directory stays as history. Carried: 4.1 (the path_context tool and a path-scoped prompt) goes to `hunter-learning-loop` group 7. The rest is covered by the path records of `access-control-prover`; if the driver's ablation shows a missing path, the work reopens under `engine-change-scoped-analysis`.
|
||||
> The directory stays as history. Carried: 4.1 (the path_context tool and a path-scoped prompt) goes to `dspy-driver`. The rest is covered by the path records of `access-control-prover`; if the driver's ablation shows a missing path, the work reopens under `engine-change-scoped-analysis`.
|
||||
|
||||
# Implementation Plan
|
||||
|
||||
|
||||
@@ -70,9 +70,9 @@ go-ahead, and the cluster is the operator's.
|
||||
|
||||
- [ ] 7. Proof on the driver's suspects, shown to the developer
|
||||
- [ ] 7.1 Take starting intents from the driver. A search may start from the suspects that
|
||||
`hunter-learning-loop` 7.6 hands over (location, family, trace) instead of from an empty board; the fixed
|
||||
`dspy-driver` D9 hands over (location, family, trace) instead of from an empty board; the fixed
|
||||
side stays blind to the vulnerable revision. Record the demonstrated rate with and without the handoff on
|
||||
the same pairs. _Depends: hunter-learning-loop 7.6_
|
||||
the same pairs. _Depends: dspy-driver D9_
|
||||
- [ ] 7.2 A demonstrated finding a developer can read. One artifact per demonstration: the family, the
|
||||
location, the request or input that triggers it, the observed effect on the vulnerable revision, the
|
||||
absence of it on the fixed revision or the control, and the command that replays it. No model text is
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
## Amendment of 2026-11-30 (maintainer decision; wins over the text below where they differ)
|
||||
|
||||
- **Rule 11 is executed.** The access-control arm is parked since 2026-10-31. Its fallback is now
|
||||
the plan: the driver (`hunter-learning-loop`) finds, `search-with-proof` demonstrates, and a
|
||||
the plan: the driver (`dspy-driver`) finds, `search-with-proof` demonstrates, and a
|
||||
push is blocked only on a demonstration. `search-with-proof` is active, not parked.
|
||||
- **Rule 1 is narrowed.** "Recognition, then resolution, then judgment" ordered the deterministic
|
||||
prover. It does not hold the driver back: the driver reads whatever the trace holds today, and
|
||||
|
||||
@@ -6,7 +6,7 @@ Everything below this section is dated history; where it disagrees with this sec
|
||||
|
||||
- **The project steers back to bug finding** (maintainer decision, 2026-11-30; `roadmap.md`, top
|
||||
section). Three lines of work and nothing else: the driver finds the bugs
|
||||
(`hunter-learning-loop`), proof shows them (`search-with-proof`), the developer sees them
|
||||
(`dspy-driver`, which continues `hunter-learning-loop`), proof shows them (`search-with-proof`), the developer sees them
|
||||
(`pre-push-safety-net`). The benchmark and the core contract are frozen as built.
|
||||
- **The driver** is the model-driven hunter, a DSPy program. It reads the change together with
|
||||
what abstract interpretation establishes (the prover's ordered trace, the engine's facts), is
|
||||
|
||||
+30
-16
@@ -50,7 +50,9 @@ revision and not on the fixed one.
|
||||
Work lands on these three lines and on nothing else. A session that touches none of them is
|
||||
plumbing and needs the maintainer's word for that session.
|
||||
|
||||
1. **The driver finds the bugs.** Spec: `hunter-learning-loop` (amended 2026-11-30, group 7).
|
||||
1. **The driver finds the bugs.** Spec: `dspy-driver` (opened 2026-11-30; it continues
|
||||
`hunter-learning-loop`, whose open tasks moved there). Its brief maps the driving and orders the
|
||||
experiments E0 to E6; the driver is measured by example.
|
||||
The driver reads the change and the abstract interpretation of it (the prover's trace, the
|
||||
engine's facts) and names suspect locations. It runs as a DSPy program: sampled several times
|
||||
per question, scored by agreement, and compiled on training repositories only. Its facts come
|
||||
@@ -74,17 +76,22 @@ before the step starts.
|
||||
|
||||
- **N0. Close the plumbing.** The record commit for `contributor-scan` item 5b. Item 5c and step 6
|
||||
are not done; they end with the spec (see the spec map). No number.
|
||||
- **N1. Driver baseline on the trace.** Run the driver as it is over
|
||||
`benchmarks/valid/train/pool-train.toml`, once with the trace in its input and once without, the
|
||||
same changes and sampling for both. Number: search recall and suspicions per ordinary push, with
|
||||
intervals. Paid: needs the maintainer's ceiling. (`hunter-learning-loop` 7.1, 7.2.)
|
||||
- **N1. Wire the abstract interpretation into the driver, then take the baseline.** Read on
|
||||
2026-11-30: the driver receives neither the prover's trace nor anything from Joern; no module
|
||||
under `hunt/` imports `cpg`. The maintainer: "that must be done first, otherwise we are testing
|
||||
ghosts". So first the two producers, the prover's trace (access control) and Joern's taint path
|
||||
and dominance results (path traversal), each proving nonzero input (`dspy-driver` D2, D3; a small
|
||||
example book first, D1). Number for the wiring: the share of training-pool changes with a nonempty annotation, per
|
||||
family. Only then the baseline over `benchmarks/valid/train/pool-train.toml`: the same changes
|
||||
and sampling with no annotation, with the trace, and with Joern's results. Number: search recall
|
||||
and suspicions per ordinary push, with intervals. Paid: 10 USD ceiling. (D4, experiment E1.)
|
||||
- **N2. The bugs to avoid, as a training set.** The maintainer names the families and the kind of
|
||||
repository that matter; the training set is sourced apart from every admission population
|
||||
(`hunter-learning-loop` 4.1, with the whole-repository vibe-code pairs carried from
|
||||
(`dspy-driver` D6, with the whole-repository vibe-code pairs carried from
|
||||
`contributor-scan` 5.2). Number: accepted positives per family and language.
|
||||
- **N3. The DSPy loop.** Compile on the compile folds, accept by the rule of task 5.2, pass the
|
||||
reversed-pair probe of `core/probes.py`. Number: the paired gain on held-out folds over N1.
|
||||
(`hunter-learning-loop` 7.3 to 7.5.)
|
||||
(`dspy-driver` D5, D7, D8; experiments E2 to E6.)
|
||||
- **N4. Proof on what the driver finds.** Finish the path family of the pilot (five
|
||||
demonstrations, zero false proofs), then feed the driver's suspects into the search. Number:
|
||||
demonstrated rate, false proofs, cost per search. (`search-with-proof` 6.2 to 6.4, 7.1.)
|
||||
@@ -116,7 +123,8 @@ N1 to N3 and N4 run side by side. N4 does not wait for N3: the proof arm has its
|
||||
|
||||
| Spec | State | What happens to its open tasks |
|
||||
| --- | --- | --- |
|
||||
| `hunter-learning-loop` | active, line 1 | 4.1 and 6 stay; group 7 added |
|
||||
| `dspy-driver` | active, line 1; new 2026-11-30 | brief and requirements input written; requirements, design and tasks to come |
|
||||
| `hunter-learning-loop` | built; no new work | 4.1, 6 and group 7 moved to `dspy-driver` (D6, D10, D2 to D9) |
|
||||
| `access-control-prover` | done | supplies the trace |
|
||||
| `engine-change-scoped-analysis` | active, line 1 | takes the carried engine tasks (its `brief.md`) |
|
||||
| `search-with-proof`, `proof-arm-opencode` | active, line 2 | all open tasks stay; group 7 added |
|
||||
@@ -124,10 +132,10 @@ N1 to N3 and N4 run side by side. N4 does not wait for N3: the proof arm has its
|
||||
| `valid-detection-benchmark` | frozen as built | 11.6 and 11.7 wait for N6 |
|
||||
| `detection-core` | frozen as built | group headers unticked, subtasks done; the contract stays |
|
||||
| `plane-on-kubernetes` | parked | only what `search-with-proof` needs on kube-ax; the operator decides the rest |
|
||||
| `contributor-scan` | superseded | 2.14, 5.6, 5.12, 7.2, 7.4 to `engine-change-scoped-analysis`; 5.2 to `hunter-learning-loop`; the rest dropped |
|
||||
| `learned-decision-engine` | superseded | 16 and 17 to `hunter-learning-loop`; 17.3 to `search-with-proof`; 11.1 and 11.2 to `engine-change-scoped-analysis`; the rest dropped |
|
||||
| `reachability-flow-model` | superseded | 4.1 to `hunter-learning-loop`; the rest is covered by the prover's path records |
|
||||
| `authorization-obligations` | superseded | 2.6 to `engine-change-scoped-analysis`; 3.3 to `hunter-learning-loop`; the rest is covered by the prover |
|
||||
| `contributor-scan` | superseded | 2.14, 5.6, 5.12, 7.2, 7.4 to `engine-change-scoped-analysis`; 5.2 to `dspy-driver`; the rest dropped |
|
||||
| `learned-decision-engine` | superseded | 16 and 17 to `dspy-driver`; 17.3 to `search-with-proof`; 11.1 and 11.2 to `engine-change-scoped-analysis`; the rest dropped |
|
||||
| `reachability-flow-model` | superseded | 4.1 to `dspy-driver`; the rest is covered by the prover's path records |
|
||||
| `authorization-obligations` | superseded | 2.6 to `engine-change-scoped-analysis`; 3.3 to `dspy-driver`; the rest is covered by the prover |
|
||||
| `finding-feedback-loop`, `flow-aware-ranking`, `zero-with-a-reason`, `ir-consolidation`, `mcp-shift-left-agent` | superseded | none carried |
|
||||
|
||||
A superseded spec keeps its directory as history, with a notice at its top; no work lands there.
|
||||
@@ -149,10 +157,16 @@ with its lever and number named.
|
||||
### Open for the maintainer
|
||||
|
||||
- The spend ceiling of N3.
|
||||
- Code that the superseded specs leave without an owner (the ledger's `review` entries: the plane
|
||||
executor modules of the removed HarnessX loop, the scan extensions whose results never reach a
|
||||
finding, `map_gate.py` and `pair_gate.py`, the local kind executor). Nothing is deleted by this
|
||||
amendment.
|
||||
- Code that the superseded specs leave without an owner (the ledger's `review` entries: the scan
|
||||
extensions whose results never reach a finding, `map_gate.py` and `pair_gate.py`, the local kind
|
||||
executor). Nothing is deleted by this amendment.
|
||||
- **HarnessX is not used anymore** (maintainer, 2026-11-30), and the tree agrees: it was removed on
|
||||
2026-09-30, and `tests/test_removed_plane_references.py` fails on any mention outside the
|
||||
retirement notes in `config.py`. No code depends on it. The ledger's suspicion that
|
||||
`plane/engine_alerts.py`, `harvest.py`, `workspaces.py` and `profile.py` served only the HarnessX
|
||||
loop does not hold: read on 2026-11-30, each is imported by `cli.py`, and by `benchmarks/learn`
|
||||
or `ops/ax`. They are plane code and follow the plane's fate, not HarnessX's. What is left of
|
||||
HarnessX is wording: comments that cite the `harnessx-removal` spec, and the superseded specs.
|
||||
- Whether the cohort review of 11.6 gets a second reviewer or a recorded single-maintainer rule.
|
||||
- M2, the 30 second gate: no task owns graph reuse. Either line 3 takes it, or the hook answers in
|
||||
the background and says so.
|
||||
|
||||
@@ -76,7 +76,7 @@ does not pass: useful recall and coverage are required alongside low noise.
|
||||
## Specification boundaries (amended 2026-11-30)
|
||||
|
||||
The list below this note is of 2026-09. Since 2026-11-30 the hook is line 3 of the roadmap: it
|
||||
shows what the driver (`hunter-learning-loop`) suspects, as advisory, and what `search-with-proof`
|
||||
shows what the driver (`dspy-driver`) suspects, as advisory, and what `search-with-proof`
|
||||
demonstrated, with its evidence. The sentence "The hook does not require an LLM ranker" stays
|
||||
true for the hook's own code; the driver is a separate producer the hook consumes.
|
||||
`contributor-scan`, `flow-aware-ranking`, `zero-with-a-reason` and `finding-feedback-loop` are
|
||||
|
||||
Reference in New Issue
Block a user