11 Commits
Author SHA1 Message Date
Marius CiepluchandClaude Fable 5.2 17131525b0 spec(dspy-driver): the tasks of stage one are approved
Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-30 11:00:15 +01:00
Marius CiepluchandClaude Fable 5.2 b975acb7e0 refactor(memory): the memory store and the spend meter leave the plane package (C1)
openultrasast.plane.memory and openultrasast.plane.budget are now
openultrasast.memory and openultrasast.budget; every importer follows. A pure move:
no behaviour changes. The two renames themselves were swept into 1aad435 by mistake
(they were staged when that spec commit was made), so the three commits between it
and this one do not import; this commit completes the move.

memory.py still reaches into the plane in two lazy imports (results_root in
open_store, the reconciler in seed); the cut of the plane has to settle both.

Checked: ruff, ruff format, mypy; 163 test files around memory, budget, plane, learn
and hunt passed across three runs by the implementing agent, and the six closest
files again before this commit. The whole suite was not run locally.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-30 10:56:25 +01:00
Marius CiepluchandClaude Fable 5.2 e22bd420d9 docs(steering): the third menu of 2026-11-30: the samples branch is step C6
Sample code only, forward only, with the plane cut after E1. The example book is
mixed, its repositories are fetched on the new machine, and the roadmap lists what
does not travel with git.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-30 10:16:20 +01:00
Marius CiepluchandClaude Fable 5.2 f0f2097586 spec(dspy-driver): tasks for stage one; the book is mixed and fetched on any machine
The design is approved. The example book takes AI-written cases where a sound one
exists and advisory-backed web applications otherwise (the maintainer's answer). No
repository is cloned on this machine, which has 2.1 GB free: the work moves to a new
machine, so the first task is a fetch command that needs nothing outside this tree.
Tasks generated, not approved.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-30 10:15:12 +01:00
Marius CiepluchandClaude Fable 5.2 1aad435265 spec(dspy-driver): design for stage one, on the seam the hunt code already has
Two producers (the prover's trace, Joern's taint and dominance results), two driver
inputs, arms as masks of the existing paired ablation, three samples with a vote, one
page per example, and the cache keys in the memory store. Generated, not approved.
The answers to the second menu of 2026-11-30 are recorded in the roadmap.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-30 10:03:52 +01:00
Marius CiepluchandClaude Fable 5.2 b38dcdbc60 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]>
2026-11-30 09:59:56 +01:00
Marius CiepluchandClaude Fable 5.2 3bc7059fd3 spec(dspy-driver): requirements for stage one, each ending in a run
Staged on the maintainer's condition of 2026-11-30: measurable, not theoretic. The
example book, the wiring of the prover's trace and Joern's results, the delivery
check E0 and the baseline E1 are specified. E2 to E6 enter by dated amendment only
after the result before them is read. Generated, not approved.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-30 09:52:13 +01:00
Marius CiepluchandClaude Fable 5.2 e3f2f608d5 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]>
2026-11-30 09:51:09 +01:00
Marius CiepluchandClaude Fable 5.2 1a9865496b spec: nine specs superseded, their needed tasks carried to the three lines
hunter-learning-loop gets group 7 (the driver on the trace), search-with-proof
group 7 (proof on the driver's suspects, shown to the developer), pre-push-safety-net
task 18, and engine-change-scoped-analysis the carried engine work. Superseded specs
keep their directory with a notice. The breadth ledger follows.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-30 09:22:35 +01:00
Marius CiepluchandClaude Fable 5.2 0c5e06bb14 docs(steering): the roadmap returns to bug finding: the driver, then proof
The maintainer's decision of 2026-11-30 after the project review. Three lines of
work: the driver finds the bugs, proof shows them, the developer sees them. The
ladder of 2026-11-20 is superseded and kept as history. The benchmark and the core
contract are frozen as built. Admission populations never train; the training pool
teaches, and the driver may be compiled on it.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
2026-11-30 09:22:34 +01:00
Marius Ciepluch 7ecd60ec4e ci(release): the retention prunes image versions too
The maintainer's request, on 2026-11-29: "packages haven't beeen updated in github. do we delete
them?". The two image packages were updated (2.2.0-alpha.1, three hours before); what is old is
the tag latest, which release.yml gives only to a release tag without a hyphen. Asked by menu
what to do with the image versions, the maintainer chose "Prune image versions (Recommended)":
keep the versions of the kept release tags, keep main with its sha tags, delete the other
sha-tagged and the untagged versions of openultrasast and openultrasast-runner; the first run
only lists, and the deletion waits for the maintainer's word.

What changed
.github/workflows/release-retention.yml, 150 to 262 lines (the python of the step: 105 to 215).
The rule for tags and releases is as before. For image versions, after the versions that go with
a deleted release tag: a version that carries no tag of a kept release and not main is pruned
when it is untagged or tagged with a sha only. Two safeguards, found while the rule was written
and in its review. First, an untagged version can be the image manifest or the attestation
manifest of an image that stays: the four release images read on 2026-11-29 are OCI indexes with
an amd64 manifest and an attestation manifest (s10_pkg_indexes.out), and the packages hold more
untagged versions than tagged ones. So the step logs in to the registry, reads the index of each
image that stays once, whatever tag keeps it, with docker buildx imagetools inspect, and keeps
every version whose digest is one of the manifests that index lists. The index is read one level
deep: an index inside it is not followed, and build-push-action makes none. Second, that fails
closed: an index none of whose manifests is a version of the package, an index entry without a
digest, or output that is not an index stops the job before anything is pruned or deleted. A
version with a tag the rule does not name, or untagged without a digest, stays and is listed.
The limit for image versions is 100 in one run (the limit of 20 stays for tags and releases).
The summary lists every version to prune with the start of its digest and its tags before
anything is deleted. A failed docker call stops the job and names the call and the reason, as a
failed gh call does.

Checks
The harness /tmp/opencode/s10_rr2_harness.py runs the python of the step on fixtures with
stand-ins for git, gh and docker (/tmp/opencode/s10_rr2_bin), ten cases. Against the workflow at
HEAD (d98334a) eight of the ten fail (s10_rr2_red.out): the old script prunes nothing, makes no
docker call, and has no limit for image versions. Against this file ten of ten pass
(s10_rr2_green.out): a dry run that lists and deletes nothing; two deleting runs that delete
exactly the expected 10 image versions and 5 tag operations (keep 3), and 13 and 6 (keep 1,
where the image of a pre-release goes with its release); a failing login, a failing index read,
an index entry without a digest, versions named by another form of digest, the image limit, a
failing read of the releases and a failing read of an image each stop the job with nothing
deleted. The harness also checks that the plan is complete in the summary at the first deleting
call, that each index is read once, and that the token is printed nowhere. The YAML parses, the
step passes bash -n and the python compiles; the file is ASCII, its widest line 120 columns; git
diff --check exits 0 (s10_rr2_diffcheck.out). The gates give ten zeros (s10_rr2_exits.txt, label
rr2). No test reads the workflow. The s10 files are under /tmp/opencode, outside the repository.

Not verified
The run on GitHub: whether the package versions API names each version by the digest that the
index lists, and what docker buildx imagetools inspect prints there. The first run is a dry run.
If the API names versions by another form of digest, that run stops on the second safeguard, and
nothing is deleted; its summary is read before any deletion.

Review.
Three read-only rounds, the harness re-run in each (last r3_new 10 of 10,
r3_head 2 of 10) and copies of the fixtures under /tmp/opencode/s10_rev_rr2.
Round one blocked the file on two gaps: an image that stays under another
tag lost its untagged children, and a digest of another form made the
safeguard match nothing. Round two found both closed, the tags and releases
part identical to d98334a, and blocked the message on one sentence, since
corrected. Round three found the file unchanged (same hash, same python),
the new fixture right by hand, and the mutant without the empty-digest guard
caught. Shown by runs: the dry run list and the deleting plan are equal;
every failed or malformed read stops the job with nothing deleted; twelve
mutants are caught. Open remarks: the stop needs no child to be a version;
a nested index is not followed. Not seen: the API's fields, the run, the chat.
2026-11-29 13:20:41 +01:00
111 changed files with 1740 additions and 206 deletions
+121 -9
View File
@@ -1,9 +1,11 @@
name: Release retention
# Keeps the newest RELEASES_TO_KEEP version tags with their releases and their versioned images,
# and names the older ones. The run that follows a release only lists. A manual run deletes when
# "dry run" is off. It never touches a tag that is not a version tag (vX.Y.Z with an optional
# pre-release), the latest stable release, or an image version that carries a tag no release made
# (latest, main, a sha).
# Keeps the newest RELEASES_TO_KEEP version tags with their releases, and names the older ones. The
# run that follows a release only lists. A manual run deletes when "dry run" is off. It never touches
# a tag that is not a version tag (vX.Y.Z with an optional pre-release) or the latest stable release.
# Image versions: one goes with its deleted release tag. One that carries no tag of a kept release
# and not "main" goes too when it is untagged or tagged with a sha only, unless its digest is a
# manifest that an image which stays lists. An index whose manifests are not versions of the
# package stops the job. The plan is in the summary before anything is deleted.
on:
workflow_dispatch:
inputs:
@@ -49,12 +51,17 @@ jobs:
import sys
OWNER, REPO = os.environ["GITHUB_REPOSITORY"].split("/")
ACTOR = os.environ["GITHUB_ACTOR"]
KEEP = int(os.environ["RELEASES_TO_KEEP"])
APPLY = os.environ["APPLY"] == "true"
PACKAGES = os.environ["IMAGE_PACKAGES"].split()
VERSION = re.compile(r"^v(\d+)\.(\d+)\.(\d+)(-[0-9A-Za-z][0-9A-Za-z.-]*)?$")
SHA_TAG = re.compile(r"^sha-[0-9a-f]{7,40}$")
LIMIT = 20
# More deletions than this in one run is a plan that nobody has read.
IMAGE_LIMIT = 100
# The same for image versions: a repository that pushed an image for every commit has many.
REGISTRY = f"ghcr.io/{OWNER}"
def gh(*args):
try:
@@ -62,6 +69,50 @@ jobs:
except subprocess.CalledProcessError as error:
sys.exit(f"gh {' '.join(args)}: exit {error.returncode}\n{error.stderr}")
def docker(*args, stdin=None):
"""One docker call. A failed one stops the job and names the call and the reason."""
try:
result = subprocess.run(
["docker", *args], check=True, capture_output=True, text=True, input=stdin,
)
return result.stdout
except FileNotFoundError:
sys.exit("docker: not found on the runner")
except subprocess.CalledProcessError as error:
sys.exit(f"docker {' '.join(args)}: exit {error.returncode}\n{error.stderr}")
def digest_of(version):
"""The digest a package version is stored under."""
return version.get("digest") or version.get("name") or ""
read_indexes = {}
def index_children(package, tag, digests):
"""The digests of the manifests an image index lists; each index is read once.
An image that is one manifest lists none."""
if (package, tag) in read_indexes:
return read_indexes[(package, tag)]
raw = docker("buildx", "imagetools", "inspect", f"{REGISTRY}/{package}:{tag}", "--raw")
try:
index = json.loads(raw)
except json.JSONDecodeError as error:
sys.exit(f"docker buildx imagetools inspect {package}:{tag}: the output is not JSON: {error}")
if not isinstance(index, dict):
sys.exit(f"docker buildx imagetools inspect {package}:{tag}: the output is not an image index")
entries = index.get("manifests", [])
if any(not isinstance(entry.get("digest"), str) for entry in entries):
sys.exit(f"docker buildx imagetools inspect {package}:{tag}: an entry of the index has no digest")
children = [entry["digest"] for entry in entries]
# An index none of whose manifests is a version of this package: the parts of an image
# cannot be told from orphans, so the job stops before it prunes or deletes anything.
if children and not digests & set(children):
sys.exit(
f"image {package}:{tag} lists {len(children)} manifests, and none is a version of the "
"package: the safeguard for untagged versions cannot work; nothing is done"
)
read_indexes[(package, tag)] = children
return children
def say(line):
print(line)
with open(os.environ["GITHUB_STEP_SUMMARY"], "a") as summary:
@@ -118,7 +169,9 @@ jobs:
say(f"To delete: {', '.join(kinds) if kinds else 'nothing'}")
if len(deleted) > LIMIT:
sys.exit(f"{len(deleted)} tags to delete, more than the limit of {LIMIT}: nothing is done")
docker("login", "ghcr.io", "-u", ACTOR, "--password-stdin", stdin=os.environ["GH_TOKEN"])
images = {}
pruned = {}
for package in PACKAGES:
path = f"/user/packages/container/{package}/versions?per_page=100"
pages = json.loads(gh("api", "--paginate", "--slurp", path))
@@ -126,17 +179,76 @@ jobs:
images[package] = image_plan(versions, deleted)
for version_id, tags_of_version in images[package]:
say(f"To delete: image {package}, version {version_id}, tags {', '.join(tags_of_version)}")
chosen_ids = {version_id for version_id, _ in images[package]}
left = [version for version in versions if version["id"] not in chosen_ids]
with_release = {version_id for version_id, _ in images[package]}
# Every image that stays has its index read, whatever tag keeps it: a tag of a kept
# release, main, or one this rule does not name (latest, a hand-made one). Every
# manifest the index lists stays with it: an untagged version can be the image
# manifest or the attestation manifest of a release image.
keep_tags = {tag for kept_tag in kept for tag in image_tags(kept_tag)} | {"main"}
digests = {digest_of(version) for version in versions} - {""}
stays = set()
outside = []
for version in versions:
tags_of_version = set(version["metadata"]["container"]["tags"])
named_tags = {tag for tag in tags_of_version if not SHA_TAG.match(tag)}
if version["id"] in with_release or not named_tags:
continue
if digest_of(version):
stays.add(digest_of(version))
if not named_tags & keep_tags:
outside.append(", ".join(sorted(named_tags)))
# The tags of one version lead to one image: a kept tag names the release, and
# else the longest tag is read.
tag = max(named_tags & keep_tags or named_tags, key=len)
stays.update(index_children(package, tag, digests))
pruned[package], unnamed = [], []
for version in versions:
tags_of_version = set(version["metadata"]["container"]["tags"])
if version["id"] in with_release or digest_of(version) in stays:
continue
sha_only = bool(tags_of_version) and all(SHA_TAG.match(tag) for tag in tags_of_version)
if (not tags_of_version and digest_of(version)) or sha_only:
pruned[package].append(version)
else:
unnamed.append(version)
for version in pruned[package]:
tags_of_version = version["metadata"]["container"]["tags"]
named = ", ".join(tags_of_version) if tags_of_version else "untagged"
say(f"To prune: image {package}, version {version['id']}, {digest_of(version)[:19]}, {named}")
gone = with_release | {version["id"] for version in pruned[package]}
left = [version for version in versions if version["id"] not in gone]
names = []
for version in left:
tags_left = version["metadata"]["container"]["tags"]
names.append(', '.join(tags_left) if tags_left else f"id {version['id']}, untagged")
names.append(", ".join(tags_left) if tags_left else f"id {version['id']}, untagged")
say(f"Image {package}: {len(left)} of {len(versions)} versions stay: {'; '.join(names)}")
parts = [
version["id"] for version in left
if not version["metadata"]["container"]["tags"] and digest_of(version) in stays
]
parts_listed = " ".join(str(part) for part in parts) if parts else "none"
say(
f"Image {package}: untagged versions that stay, each part of an image that stays: {parts_listed}"
)
if outside:
say(f"Image {package}: stays under a tag this rule does not name: {'; '.join(outside)}")
if unnamed:
unplaced = []
for version in unnamed:
tags_unplaced = version["metadata"]["container"]["tags"]
unplaced.append(", ".join(tags_unplaced) if tags_unplaced else f"id {version['id']}, untagged")
say(f"Image {package}: stays, and this rule cannot place it: {'; '.join(unplaced)}")
count = sum(len(chosen) for chosen in images.values()) + sum(len(chosen) for chosen in pruned.values())
if count > IMAGE_LIMIT:
sys.exit(f"{count} image versions to delete, more than the limit of {IMAGE_LIMIT}: nothing is done")
if not APPLY:
say("Dry run: nothing was deleted.")
sys.exit(0)
for package, chosen in images.items():
for package in PACKAGES:
pruned_here = [
(version["id"], version["metadata"]["container"]["tags"]) for version in pruned[package]
]
chosen = images[package] + pruned_here
for version_id, _ in chosen:
gh("api", "--method", "DELETE", f"/user/packages/container/{package}/versions/{version_id}")
say(f"Deleted image {package}, version {version_id}")
+37 -17
View File
@@ -18,17 +18,37 @@
# fail when a new directory under src/openultrasast/ lands without a [capability.*] entry;
# fail when an entry has status "retiring" for more than 14 days with its "closes" unexecuted.
# Amended 2026-11-30 (maintainer decision; .kiro/steering/roadmap.md, top section):
# superseded = no work lands; the spec directory stays as history with a notice; open tasks the three
# 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: 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".
# Second decision of 2026-11-30: the kube and AX plane is retired and cut (roadmap C1 to C5);
# deferred = search-with-proof waits for a follow-up spec in Docker, opened once dspy-driver E1 is read.
# The memory store and the spend meter move out of plane/ and stay.
[meta]
amended = "2026-11-30"
drafted = "2026-10-13"
spec_count = 22
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 = "tasks-approved"
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"
phase = "tasks-approved"
owner = ["src/openultrasast/learn", "src/openultrasast/tool_hunter.py", "src/openultrasast/hunter_tools.py"]
closes = "n/a (active)"
@@ -40,14 +60,14 @@ owner = ["src/openultrasast/push"]
closes = "n/a (active)"
[spec.search-with-proof]
status = "active"
status = "deferred" # 2026-11-30, second decision
line = "search-with-proof"
phase = "tasks-generated (11 of 24 done)"
owner = ["src/openultrasast/search", "src/openultrasast/sandbox"]
closes = "n/a (active)"
[spec.proof-arm-opencode]
status = "active"
status = "deferred" # 2026-11-30, second decision
line = "search-with-proof"
phase = "brief"
owner = ["src/openultrasast/search"]
@@ -61,80 +81,80 @@ owner = ["src/openultrasast/cpg", "src/openultrasast/model", "src/openultrasast/
closes = "n/a (active)"
[spec.valid-detection-benchmark]
status = "active"
status = "frozen" # 2026-11-30, was the status of 2026-10-13
line = "hunter-learning-loop" # the benchmark every line is measured on
phase = "tasks (18 of 24 done)"
owner = ["benchmarks/valid", "benchmarks/unseen/replay.py", "benchmarks/unseen/score.py"]
closes = "n/a (active)"
[spec.learned-decision-engine]
status = "parked"
status = "superseded" # 2026-11-30, was the status of 2026-10-13
phase = "implementation (20 of 47 tasks)"
owner = ["src/openultrasast/learn"]
note = "the classifier it built is the second stage of the hunter arm and stays; new learn work goes through hunter-learning-loop, not here"
closes = "mark remaining 27 tasks superseded by hunter-learning-loop; no code deletion"
[spec.plane-on-kubernetes]
status = "parked"
status = "superseded" # 2026-11-30, second decision
phase = "implementation (14 of 43 tasks)"
owner = ["src/openultrasast/plane"]
note = "kube move paused after groups 1-2 (2026-10-02); the ax lane is blocked on the gVisor checkpoint path (operator-owned)"
closes = "when the ax lane is restored: finish; otherwise delete plane/runner.py container path and ops/k8s"
[spec.contributor-scan]
status = "parked"
status = "superseded" # 2026-11-30, was the status of 2026-10-13
phase = "implementation (27 of 51 tasks), paused since 2026-09-23"
owner = ["src/openultrasast/model", "src/openultrasast/cpg"]
closes = "fold the open census/family-context tasks into engine-change-scoped-analysis; close this spec"
[spec.mcp-shift-left-agent]
status = "parked"
status = "superseded" # 2026-11-30, was the status of 2026-10-13
phase = "brief"
owner = ["src/openultrasast/mcp.py", "src/openultrasast/skills.py", "src/openultrasast/index.py"]
note = "follow-up to the pre-push hook; waits for a hook that catches something"
closes = "if not started by 2026-12-01: delete mcp.py, skills.py, index.py and their tests"
[spec.authorization-obligations]
status = "review"
status = "superseded" # 2026-11-30, was the status of 2026-10-13
phase = "tasks-generated (0 of 24)"
owner = ["src/openultrasast/semantic/obligations"]
note = "overview.md calls it superseded in practice by the dominance arbiter; obligations code exists and is called from scan (cli.py:1388)"
closes = "Pathfinder U5 decides: keep obligations as an annotation producer for the hunter, or delete semantic/obligations and its tests"
[spec.finding-feedback-loop]
status = "retiring"
status = "superseded" # 2026-11-30, was the status of 2026-10-13
phase = "design, dormant since 2026-09-09"
owner = []
closes = "delete .kiro/specs/finding-feedback-loop (no code was written)"
[spec.reachability-flow-model]
status = "retiring"
status = "superseded" # 2026-11-30, was the status of 2026-10-13
phase = "tasks-generated (0 of 23), dormant"
owner = []
note = "largely delivered by adopting Joern (overview.md)"
closes = "delete .kiro/specs/reachability-flow-model"
[spec.flow-aware-ranking]
status = "retiring"
status = "superseded" # 2026-11-30, was the status of 2026-10-13
phase = "brief"
owner = []
closes = "delete .kiro/specs/flow-aware-ranking; keep the one sentence it owns in safety-net.md"
[spec.zero-with-a-reason]
status = "retiring"
status = "superseded" # 2026-11-30, was the status of 2026-10-13
phase = "brief"
owner = []
note = "its idea (coverage gaps are reported, never a clean verdict) is already a product principle in safety-net.md"
closes = "delete .kiro/specs/zero-with-a-reason"
[spec.ir-consolidation]
status = "retiring"
status = "superseded" # 2026-11-30, was the status of 2026-10-13
phase = "brief"
owner = []
closes = "delete .kiro/specs/ir-consolidation"
[spec.ai-service-plane]
status = "done"
status = "retired" # 2026-11-30, second decision
owner = ["src/openultrasast/plane"]
[spec.model-grounded-detection]
@@ -214,7 +234,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
+21 -6
View File
@@ -1,15 +1,30 @@
{
"feature_name": "access-control-prover",
"created_at": "2026-10-14T13:48:18Z",
"updated_at": "2026-11-01T15:44:59Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "tasks-generated",
"approvals": {
"requirements": {"generated": true, "approved": true},
"design": {"generated": true, "approved": true},
"tasks": {"generated": true, "approved": true}
"requirements": {
"generated": true,
"approved": true
},
"design": {
"generated": true,
"approved": true
},
"tasks": {
"generated": true,
"approved": true
}
},
"ready_for_implementation": true,
"depends_on": ["authorization-obligations", "valid-detection-benchmark", "hunter-learning-loop", "detection-core"],
"approval_note": "2026-10-14 maintainer directive in session: spec the prover and queue implementation with Codex (fast-track; the three gates were passed on that instruction, review the documents before the second delivery). 2026-10-29: requirements amended after the 2026-10-28 gates 1-5 measurements (trace resolution, programmatic entry facts, failure visibility). 2026-10-29 (later): maintainer instruction in session ('can you address the issues?') treated as requirements approval and as the directive to regenerate the design. 2026-10-29 (capability lift): per-target vocabulary became acquired data; engine/target split, pattern discipline and complexity caps were recorded in steering; all phases reopened. 2026-10-29 (abstract-interpretation amendment): the maintainer accepted the design-review recommendations by asking to make the amendments. Requirements and design were regenerated with a three-way judgment, explicit evidence algebra, stable symbols, resource/authority domains, label-blind acquisition and separate admission measurement; that directive is recorded as approval to regenerate tasks. The merged task plan passed an independent task-graph sanity review after two design repairs. Tasks await human approval before implementation. 2026-10-29 (implementation start): the maintainer invoked /kiro-impl access-control-prover in session; that directive is recorded as tasks approval. 2026-11-01: maintainer approved moving the production fact authority, matcher and artifact writer from detection-core into access-control-prover; Requirement 13, design ownership and the repaired tasks are approved for implementation. 2026-11-01 (repo-local review ceremony): maintainer approved recording the generator as producer, maintainer session approval as reviewer basis, and the checked-in digest-addressed directory as trusted store; Tasks 14.3-14.4 implement the wire/resolver and ceremony records before data migration in Task 14.5."
"depends_on": [
"authorization-obligations",
"valid-detection-benchmark",
"hunter-learning-loop",
"detection-core"
],
"approval_note": "2026-10-14 maintainer directive in session: spec the prover and queue implementation with Codex (fast-track; the three gates were passed on that instruction, review the documents before the second delivery). 2026-10-29: requirements amended after the 2026-10-28 gates 1-5 measurements (trace resolution, programmatic entry facts, failure visibility). 2026-10-29 (later): maintainer instruction in session ('can you address the issues?') treated as requirements approval and as the directive to regenerate the design. 2026-10-29 (capability lift): per-target vocabulary became acquired data; engine/target split, pattern discipline and complexity caps were recorded in steering; all phases reopened. 2026-10-29 (abstract-interpretation amendment): the maintainer accepted the design-review recommendations by asking to make the amendments. Requirements and design were regenerated with a three-way judgment, explicit evidence algebra, stable symbols, resource/authority domains, label-blind acquisition and separate admission measurement; that directive is recorded as approval to regenerate tasks. The merged task plan passed an independent task-graph sanity review after two design repairs. Tasks await human approval before implementation. 2026-10-29 (implementation start): the maintainer invoked /kiro-impl access-control-prover in session; that directive is recorded as tasks approval. 2026-11-01: maintainer approved moving the production fact authority, matcher and artifact writer from detection-core into access-control-prover; Requirement 13, design ownership and the repaired tasks are approved for implementation. 2026-11-01 (repo-local review ceremony): maintainer approved recording the generator as producer, maintainer session approval as reviewer basis, and the checked-in digest-addressed directory as trusted store; Tasks 14.3-14.4 implement the wire/resolver and ceremony records before data migration in Task 14.5.",
"roadmap_state_2026_11_30": "done; supplies the trace to the driver"
}
+8 -3
View File
@@ -1,9 +1,9 @@
{
"feature_name": "ai-service-plane",
"created_at": "2026-09-29T15:40:00Z",
"updated_at": "2026-10-02T00:00:00Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "implementation-complete",
"phase": "superseded",
"approvals": {
"requirements": {
"generated": true,
@@ -18,5 +18,10 @@
"approved": true
}
},
"ready_for_implementation": true
"ready_for_implementation": false,
"phase_before_supersession": "implementation-complete",
"superseded_on": "2026-11-30",
"superseded_by": [],
"supersession_note": "This spec was complete. The plane it built is retired; its code is removed by the cut (roadmap step C2). The memory store and the spend meter move out of the plane package first (C1) and stay.",
"roadmap_state_2026_11_30": "retired with the kube and AX plane"
}
+3
View File
@@ -1,3 +1,6 @@
> **RETIRED 2026-11-30** (maintainer decision; `.kiro/steering/roadmap.md`, "Second decision of
> 2026-11-30"). No work lands in this spec. The directory stays as history. This spec was complete. The plane it built is retired; its code is removed by the cut (roadmap step C2). The memory store and the spend meter move out of the plane package first (C1) and stay.
# Implementation Plan
Order follows the dependency chain: ax bring-up (parallel with 1-2) -> manifests -> budget -> runner ->
@@ -1,9 +1,9 @@
{
"feature_name": "authorization-obligations",
"created_at": "2026-09-05T17:00:00Z",
"updated_at": "2026-09-05T19:10:00Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "tasks-generated",
"phase": "superseded",
"approvals": {
"requirements": {
"generated": true,
@@ -18,11 +18,19 @@
"approved": true
}
},
"ready_for_implementation": true,
"ready_for_implementation": false,
"depends_on": [
"reachability-flow-model",
"guard-dominance-regime",
"corpus-seeded-mechanisms"
],
"approval_note": "2026-09-05 requirements, design and tasks approved by the maintainer in session"
"approval_note": "2026-09-05 requirements, design and tasks approved by the maintainer in session",
"phase_before_supersession": "tasks-generated",
"superseded_on": "2026-11-30",
"superseded_by": [
"access-control-prover",
"engine-change-scoped-analysis",
"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 `dspy-driver`. The rest is covered by `access-control-prover` (operations, enforcement witnesses, dominance)."
}
@@ -1,3 +1,6 @@
> **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 `dspy-driver`. The rest is covered by `access-control-prover` (operations, enforcement witnesses, dominance).
# Implementation Plan
- [ ] 1. Foundation: closed facts and obligation shapes
+11 -4
View File
@@ -1,9 +1,9 @@
{
"feature_name": "contributor-scan",
"created_at": "2026-09-08T20:00:00Z",
"updated_at": "2026-11-27T14:15:26.457978+00:00",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "implementation",
"phase": "superseded",
"approvals": {
"requirements": {
"generated": true,
@@ -18,7 +18,7 @@
"approved": true
}
},
"ready_for_implementation": true,
"ready_for_implementation": false,
"depends_on": [
"model-grounded-detection"
],
@@ -102,5 +102,12 @@
"channel": "alpha",
"rollout_decision": "NO-GO",
"status_record": "census-repair-verification.md"
}
},
"phase_before_supersession": "implementation",
"superseded_on": "2026-11-30",
"superseded_by": [
"engine-change-scoped-analysis",
"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 `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."
}
+3
View File
@@ -1,3 +1,6 @@
> **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 `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
## Guidance for the implementing agent
+3 -2
View File
@@ -1,7 +1,7 @@
{
"feature_name": "detection-core",
"created_at": "2026-10-30T13:55:30Z",
"updated_at": "2026-11-11T08:22:15Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "tasks-generated",
"approvals": {
@@ -19,5 +19,6 @@
}
},
"ready_for_implementation": true,
"approval_note": "2026-11-11: The maintainer approved the fail-closed per-case outcome amendment after Task 15.3 debug exposed an unauthenticated combination input. The amended design derives and revalidates case-input identity, seals unanimous component outcomes, binds combined case lineage, and splits implementation into Tasks 15.3-15.6; requirements, design, and regenerated tasks remain approved after independent review."
"approval_note": "2026-11-11: The maintainer approved the fail-closed per-case outcome amendment after Task 15.3 debug exposed an unauthenticated combination input. The amended design derives and revalidates case-input identity, seals unanimous component outcomes, binds combined case lineage, and splits implementation into Tasks 15.3-15.6; requirements, design, and regenerated tasks remain approved after independent review.",
"roadmap_state_2026_11_30": "frozen as built; the contract stays"
}
+195
View File
@@ -0,0 +1,195 @@
# 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 |
## 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
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.
+273
View File
@@ -0,0 +1,273 @@
# Design Document: the DSPy driver, stage one
## Overview
This design covers stage one only, as Requirement 7.4 demands: the example book, the wiring of abstract
interpretation into the driver, the cache, the delivery check E0 and the baseline E1. It adds no stage
that has no result before it.
The finding that shapes it: `src/openultrasast/hunt/` already has the seam this stage needs. A driver input
is produced by a versioned **producer** (`hunt/producers.py`), every producer records provenance
(`ok`, `reason`, `version`, `bytes_read`), and an experiment arm is a **mask** that drops producers or
inputs (`hunt/ablation.py`, `ousast-hunt run --mask`). So the wiring is two new producers and two new
inputs, and E1 is a paired ablation over three masks. Nothing here is a new framework.
Every statement about existing code below was read on 2026-11-30, not run, except where "run" is said.
### Goals
- The driver receives the prover's trace and Joern's results for a change, or a stated cause why not.
- A maintainer can open one page per example and see input, answers, hit or miss, and the miss cause.
- E0 and E1 run from two commands, write their records, and can be read against fixed marks.
- A second run of E0 starts no engine; a second run of E1 makes no model call.
### Non-Goals
- No change to the driver's signature, module, instruction or tools. E1 measures the driver as built.
- No compilation, no case memory, no curator, no new engine query or fact.
- No change to the hook, the scan path, the proof arm or the benchmark machinery.
- No new shared contract. The core model contract (`hunt/model_contract.py`) is not adopted in this stage.
## Boundary Commitments
### This Spec Owns
- Two producers, `trace` and `joern`, and their two driver inputs.
- The example book: its manifest, its repositories map, its freeze digest.
- The sampling wrapper (three answers per question, found on two of three).
- The page renderer and the two commands that run E0 and E1.
- The cache keys for Joern results and model answers in the memory store.
### Out of Boundary
- `hunt/prover.py`, `semantic/`, `cpg/`, `model/taint.py`, `model/dominance.py`: called, never changed. A
missing fact or an unresolved call is recorded as a cause and reported to `engine-change-scoped-analysis`.
- `hunt/program.py` beyond the input table; `hunt/ablation.py`, `hunt/runner.py`, `hunt/accept.py`,
`hunt/propose.py`: used as built.
- Every admission and evaluation population.
### Allowed Dependencies
- `openultrasast.hunt` (producers, table, runner, ablation, metric, program), `openultrasast.hunt.prover`.
- `openultrasast.cpg.backend.JoernBackend`, `openultrasast.model.specs`, `model.taint`, `model.dominance`.
- `openultrasast.memory` and `openultrasast.budget` (after roadmap step C1 moves them out of `plane/`).
- DSPy 3.4.x as pinned. No new third-party package.
### Revalidation Triggers
- A change of a producer's output shape or version: every stored annotation of that producer is void.
- A change of the engine image, the Joern version or a query file: every cached Joern result is void.
- A change of the example book after its freeze: a new digest, a new series (Requirement 1.7).
- A change of the driver's program, model or sampling settings between arms: the run is refused.
## Architecture
### Existing Architecture Analysis
| Existing part | What stage one does with it |
| --- | --- |
| `producers.PRODUCERS`: `diff`, `source`, `semantic`, `taxonomy`; each a `Producer(name, version, columns, compute)` | adds `trace` and `joern` in the same form |
| `table.FEATURE_NAMES`, `PROVENANCE_NAMES` | adds the two producers' columns; provenance columns come for free |
| `program.INPUTS` (name, feature column, description) | adds `trace` and `engine_flows`; order after `obligations` |
| `prover.prove_change(root, change, ctx)` returns `ProverResult(findings, coverage, degradations, traces)` | called once per change by the `trace` producer |
| `model/specs`: taint spec for `path` in Python, JavaScript and TypeScript; dominance spec for `access_control` in all three (run on 2026-11-30) | the `joern` producer asks both, per changed function |
| `ablation.Manifest`, `register`, `run`, `analyse`: paired arms, masks, registered before the run | E1 is one manifest with three masks |
| `runner.run`: resumable, one record per change, spend ledger, `InstrumentFailure` | unchanged; the sampling wrapper sits around the program |
| `metric.search_outcome`: a finding within ten lines of the label | the hit rule of Requirement 6.3 |
| `memory.MemoryStore.put_blob / get_blob` by content | the cache |
### Boundary Map
```mermaid
flowchart LR
book["Example book: manifest + repos map + digest"] --> rows["compute_rows per change"]
rows --> p1["producers that exist: diff, source, semantic, taxonomy"]
rows --> p2["trace producer -> prove_change"]
rows --> p3["joern producer -> JoernBackend, taint and dominance queries"]
p3 <--> cache["memory store: joern results by key"]
p1 --> table["feature table with provenance"]
p2 --> table
p3 --> table
table --> e0["E0: delivery report, no model"]
table --> arms["three masks"]
arms --> prog["HuntProgram, asked 3 times"]
prog <--> cache2["memory store: answers by request digest"]
prog --> pages["one page per example"]
pages --> e1["E1: counts, paired differences, the mark"]
```
### Technology Stack
| Layer | Choice | Note |
| --- | --- | --- |
| Driver | DSPy 3.4.1, `HuntProgram` as built, DeepSeek through `dspy.LM` | unchanged in this stage |
| Trace | `hunt/prover.py` over tree-sitter | no engine start |
| Engine | Joern inside the shipped image, through `JoernBackend` | the image is rebuilt from HEAD before the first recorded run |
| Store | `openultrasast.memory`, file backend by default, S3 on RustFS when `OUSAST_MEMORY` says so | no bucket setup in this stage |
## File Structure Plan
### Directory Structure
```
src/openultrasast/hunt/
annotations.py the two producers: trace and joern; the closed cause lists; the cache keys
sampling.py ask a program k times, vote, keep every answer
pages.py render one page per example from run records; set the miss cause
book.py load, check and freeze the example book; refuse reserved repositories
benchmarks/driver/
book/ book.toml (the thirty changes), repos.json is local and git-ignored
e0.py the delivery check
e1.py registers the three-arm manifest and runs it
tests/
test_hunt_annotations.py, test_hunt_sampling.py, test_hunt_pages.py, test_hunt_book.py
```
### Modified Files
- `src/openultrasast/hunt/table.py`: `FEATURE_NAMES` gains `"trace": ("trace",)` and
`"joern": ("flows", "dominance")`.
- `src/openultrasast/hunt/producers.py`: `PRODUCERS` gains the two producers.
- `src/openultrasast/hunt/program.py`: `INPUTS` gains two rows; nothing else.
- `src/openultrasast/hunt/cli.py`: two subcommands, `page` and `rerun` (Requirement 3.5, 3.6).
## System Flows
**E0.** Load the frozen book. For each change, check out its head, run `compute_rows` with all producers.
Write the annotation of each producer with its provenance. Report per family and language how many
vulnerable examples have a nonempty annotation whose trace or flow touches the labelled function, and the
causes for the rest. No program is built and no key is set.
**E1.** Register one manifest: the book's digest, the three masks, model and version, three samples, the
ceiling, the mark of Requirement 6.4. Run the arms over the same changes. For each example and arm, ask
three times, keep the three answers, vote. Render the pages. Compare each annotated arm with the arm
without annotation, per family. State whether the mark is met.
The three masks, over the same program:
| Arm | Mask (dropped) | Families reported |
| --- | --- | --- |
| A none | `trace`, `joern` | both |
| B prover | `joern` | access control |
| C joern | `trace` | path traversal, and access control through the dominance answer |
## Requirements Traceability
| Requirement | Met by | Checked by |
| --- | --- | --- |
| 1.1 to 1.4 | `book.py`, `benchmarks/driver/book/book.toml` | `test_hunt_book`; the list the maintainer approves |
| 1.5 | `book.py` refuses a repository named by a reserved population; it reuses the guard the tree has for reserved repositories | a test with a reserved identity |
| 1.6, 1.7 | the freeze digest in every record | a test that an edited book gives a new digest and refuses a mixed series |
| 2.1 | `annotations.trace` | a fixture change with a known trace; bytes nonzero |
| 2.2 | `annotations.joern` | one Python and one TypeScript repository in the shipped image |
| 2.3, 2.5 | the closed cause lists; failed is not empty | a test per cause; an engine that exits nonzero gives `failed` |
| 2.4, 5.6 | provenance columns plus engine exit status, start-up and query seconds | the E0 record |
| 2.6 | E0 and E1 refuse a Joern result that does not carry the image digest | a test |
| 2.7, 4.2, 4.3 | arms read the same stored table; the manifest names one difference | a test that a second difference is refused |
| 2.8, 5.7 | cache keys | E0 run twice: second run starts no engine, same bytes |
| 3.1 to 3.4 | `pages.py` | golden pages on fixtures |
| 3.5, 3.6 | `ousast-hunt page`, `ousast-hunt rerun` | a test with the scripted model |
| 4.1, 4.8 | `ablation.register` and one decision line appended to the record | the registered file exists before the first call |
| 4.4, 4.5 | `ablation.analyse` plus the top-K counts | a fixture analysis |
| 4.6, 6.7 | the runner's budget and the spend meter | a test that the run stops at the ceiling and keeps its records |
| 4.7 | the instrument-failure share per arm | a test at two failures in ten |
| 5.1 to 5.5 | `benchmarks/driver/e0.py` | the E0 record itself |
| 6.1 to 6.6, 6.8 | `benchmarks/driver/e1.py` | the E1 record under `benchmarks/measurements/` |
| 6.3 | `sampling.py` | a test of the vote on scripted answers |
| 7 | this document covers stage one only | review |
| 8.1, 8.2 | `book.py` and `runner.refuse_pilot` | tests |
| 8.4, 8.5 | the spend ledger; the commands unset both keys unless `--paid` is given | a test |
## Components and Interfaces
### Producer `trace`
- **Input:** root, change, path, line, the shared `Context`.
- **Does:** calls `prove_change` once per change (kept on the context), selects the traces whose operation
or hops lie in the changed function, and renders each as ordered text: entry and boundary, parameters
with origin, each hop with the guards before its call, the operation with its line and arguments, the
guards required, those that dominate, and what is missing.
- **No result:** one cause from: no entry recognised; operation not recognised; call unresolved; language
not supported. Taken from the prover's `coverage.unchecked_by_reason` and `degradations`. To verify in
the first task: that these two fields are enough to set the cause per location; if not, the cause is
"to be read" and the gap is reported.
- **Output column:** `feature.trace.trace`, a list of trace texts or the cause statement.
### Producer `joern`
- **Input:** as above.
- **Does:** builds or loads the graph for the change's head revision once per revision, then asks, for
each changed function, the taint query with the `path` spec of the file's language and the dominance
query with the `access_control` spec. Renders flows as ordered steps (source, each step with file and
line, sink, sanitizers on the path) and the dominance answer as operation, guard, and whether the guard
dominates.
- **No result:** one cause from: no source-to-sink path; language not supported; engine did not start;
engine timed out. "No path" is a result of a query that ran; the other three are failures.
- **Instrument proof:** the record holds the image digest, the Joern version, the source bytes the graph
was built from, the exit status, start-up seconds and query seconds. Zero bytes or a nonzero exit marks
the annotation failed.
- **Output columns:** `feature.joern.flows`, `feature.joern.dominance`.
### Cache
- **Joern result key:** sha256 over repository, revision, file path, function content digest, language,
family, query file digest, spec digest, engine image digest. Stored with `put_blob("annotations/joern", ...)`.
- **Graph:** the engine's own graph cache is used as it is; this design adds no second one.
- **Model answer key:** the request digest the runner already computes (`runner.input_digest`) plus the
sample index and the model version. Stored with `put_blob("responses", ...)`. DSPy's own disk cache stays
on; the store makes the answers reusable from another machine.
- **Void by key:** any changed part of a key is a miss. There is no other pruning in this stage.
### Sampling
- `ask(program, inputs, k=3) -> list[Prediction]`, each call with its own sample index so the cache keeps
three answers and the model is not asked for one answer three times.
- `vote(predictions, tolerance=10)`: a location counts when at least two of three answers name it within
the tolerance; the agreement share is kept for every named location.
- To verify in its task: that DeepSeek through `dspy.LM` returns different samples at the fixed
temperature; if three calls return one cached answer, the design uses DSPy's rollout id for the sample
index.
### Pages
- One Markdown file per example and arm under the run directory: the label, each annotation with its byte
count and provenance, the three answers, the vote, hit or miss.
- Miss cause, set from records where they decide it: no annotation (provenance says failed or a cause);
wrong family (a named location matches, the family does not); wrong location (the family matches, no
location within tolerance). "Annotation wrong" and "annotation right and not used" need a person: the
page is marked "to be read" (Requirement 3.4).
### Example book
- `book.toml`: per change an id, repository, base and head revisions, kind (vulnerable or ordinary), and
for a vulnerable change the family, the labelled file and lines, the fixing revision and the source of
the label. The format is the manifest `ousast-hunt run` already reads, so no loader is new.
- The freeze writes the digest of the canonical file; every record carries it.
## Error Handling
- A producer never raises into the run: it returns a cause or a failure with its reason, as the existing
producers do.
- An engine failure fails the annotation, never the run; more than one failed example in ten of an arm
makes the experiment "not read" (Requirement 4.7).
- The ceiling stops the run and keeps finished records; the report lists what is undone.
- A repository of a reserved population stops the command before any checkout.
## Testing Strategy
- **Unit, offline, no engine and no key:** the cause lists, the cache keys, the vote, the page renderer,
the book checks. The scripted model that the hunt tests already use stands in for the driver.
- **Engine, in the shipped image:** the `joern` producer on one Python and one TypeScript fixture
application with a known path traversal; skipped by cause where the image is absent.
- **The measurements are the acceptance:** E0 then E1 on the frozen book, each read against its mark.
A green unit suite does not close this stage; the two records do.
## Risks, each with what would show it
| Risk | Shown by | Then |
| --- | --- | --- |
| The prover recognises few entries in the book's frameworks (it did on the admission repositories) | E0: access control not ready | the examples and causes go to engine work; E1 runs for the ready family only |
| Joern finds no path on real applications in the time allowed | E0: path traversal not ready, causes "timed out" or "no path" | as above; the start-up and query times are in the record |
| The annotation is right and the driver ignores it | E1 pages: "annotation right and not used" | the next stage is the signature (E4), not more facts |
| Three samples agree always | E1: agreement is 0 or 1 everywhere | E3 is answered early: sampling adds cost and no signal at these settings |
| Thirty examples are too few to tell arms apart | E1: paired difference of one example | the mark of Requirement 6.4 is not met; no claim is made |
+240
View File
@@ -0,0 +1,240 @@
# 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-prover` supplies the trace as it is today. The engine supplies
its existing taint and dominance queries as they are today. `hunter-learning-loop` supplies the runner,
the paired ablation, the proposer and the acceptance rule as built. Where an experiment shows a fact is
missing, the finding goes to `engine-change-scoped-analysis` with the examples that show it; this spec
does not add the fact. `search-with-proof` and `pre-push-safety-net` consume 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
1. 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.
2. 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.
3. 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.
4. When the maintainer names a change as one to include, the example book shall include it or record why it
cannot be used.
5. 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.
6. When the example book is frozen, the driver work shall record its digest, and every later record shall
carry that digest.
7. 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
1. 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.
2. 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.
3. 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.
4. The driver work shall record, for every producer run, the number of source bytes read, the engine's
exit status and its run time.
5. 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.
6. The driver work shall run Joern in the shipped image for every recorded result.
7. 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
1. 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.
2. 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.
3. When an ordinary example draws a suspicion, the driver work shall record the suspicion and what the
annotation said at that location.
4. 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.
5. When the maintainer names an example and a run, the driver work shall show that page with one command.
6. 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
1. 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.
2. The driver work shall run every arm of an experiment over the same examples.
3. If two arms differ in more than the one recorded thing, then the driver work shall refuse the run.
4. 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.
5. 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.
6. If the spend of an experiment reaches its ceiling, then the driver work shall stop, keep the finished
records, and report what remains undone.
7. 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.
8. 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
1. When E0 runs, the driver work shall run both producers over every example of the book and shall make no
model call.
2. 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.
3. When E0 ends, the driver work shall report the number of ordinary examples with a nonempty annotation.
4. 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.
5. 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.
6. 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
1. 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.
2. The driver work shall report a family only under the arms whose annotation covers it, and under the
arm without annotation.
3. 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.
4. 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.
5. 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.
6. 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.
7. The driver work shall keep the spend of E1 within the maintainer's ceiling of 10 USD.
8. 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
1. 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).
2. 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.
3. 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.
4. The design of this spec shall cover the open stage and the stages already read, and nothing beyond.
5. 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.
6. 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.
7. 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
1. The driver work shall read no case, label or result of an admission or evaluation population.
2. If a run names a repository of such a population, then the driver work shall refuse the run before any
model call.
3. 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.
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.
- **2026-11-30, the example book.** The search of the development data (same day) found that the book
cannot be filled with AI-written applications only: no path-traversal case exists in an AI-written
TypeScript application, and most AI-written fixes carry a label taken from a commit title that nobody
reviewed. The maintainer chose "Mixed, as proposed". Requirement 1.2 now reads: the example book shall
draw every change from web application repositories in TypeScript or Python, AI-written where a sound
case exists and advisory-backed otherwise, with at least three vulnerable changes in each language; it
shall record for each repository whether it shows a sign of being AI-written. The ten proposed
repositories are in `tasks.md`, task 1.1.
- **2026-11-30, a new machine.** The maintainer: "once we have spec'ed this out, I plan to move this to a
new machine". This machine had 2.1 GB free on that day and one of the ten repositories is 1.8 GB. So no
repository is cloned here. Requirement 1 gains criterion 8: When the example book is set up on a machine,
the driver work shall fetch every repository of the book from its recorded address and revisions with one
command, and shall need no file that is not in the repository of this project.
+31
View File
@@ -0,0 +1,31 @@
{
"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": "tasks-approved",
"approvals": {
"requirements": {
"generated": true,
"approved": true,
"note": "maintainer 2026-11-30: 'approved.'; thresholds of Requirements 5 and 6 as proposed; memory amendment recorded in requirements.md"
},
"design": {
"generated": true,
"approved": true,
"note": "maintainer 2026-11-30, question tool: 'Approve, generate tasks'"
},
"tasks": {
"generated": true,
"approved": true,
"note": "maintainer 2026-11-30: 'approved'"
}
},
"ready_for_implementation": true,
"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"
],
"staging_note": "Requirements cover stage one only (example book, wiring, E0, E1). Later stages E2 to E6 enter by dated amendment after the result before them is read (Requirement 7)."
}
+88
View File
@@ -0,0 +1,88 @@
# Implementation Plan
Stage one of `dspy-driver`: the example book, the wiring, the cache, E0 and E1. Nothing beyond it
(Requirement 7). The work moves to a new machine before it starts, so task 1 makes the setup travel. A task
is done when its "Done when" line can be shown, and tasks 4.2 and 5.2 are done by a record that is read, not
by a green test.
- [ ] 1. The example book, on any machine
- [ ] 1.1 Write the book's manifest and its fetch command
- The ten vulnerable changes as approved by the maintainer on 2026-11-30 ("Mixed, as proposed"), each with repository address, vulnerable and fixing revision, family, labelled file and lines, label source and the AI-written sign. Access control: triggerdotdev/trigger.dev, mage-ai/mage-ai, andrea9293/mcp-documentation-server, HHHHHejia/openniw, langflow-ai/langflow. Path traversal: lfnovo/open-notebook (the upload), hkuds/vibe-trading, dgtlmoon/changedetection.io, ulab-uiuc/tiny-scientist, naorsabag/openhop
- One command clones every repository into a directory named by an environment variable, checks both revisions exist, and prints the size on disk. It reads nothing outside this repository: no local results directory, no git-ignored file
- The loader refuses a repository that a reserved, admission or evaluation population names, using the guard the tree already has
- Done when the command, run on a machine with an empty target directory, fetches all ten repositories and reports both revisions present for each
- _Requirements: 1.1, 1.2, 1.3, 1.5, 1.8_
- [ ] 1.2 Check every label by hand and add the ordinary changes
- Each vulnerable label is read against its fix diff; openniw (label from a commit title) and vibe-trading (review pending) first. A label that does not hold is replaced from the candidate list of 2026-11-30 and the replacement is recorded
- Two ordinary changes per repository from its own history, each read by hand: none touches authorization or file handling
- The list of thirty goes to the maintainer; a change the maintainer names is added or its refusal recorded
- Done when the maintainer has approved the list and the freeze has written the book's digest
- _Requirements: 1.1, 1.4, 1.6, 1.7_
- [ ] 2. Abstract interpretation reaches the driver
- [ ] 2.1 The prover's trace as a producer (P)
- `trace` producer in the existing producer form: one `prove_change` per change, the traces of the changed function rendered as ordered text, or one cause from the closed list
- First check in this task: whether the prover's coverage and degradation fields decide the cause per location; if they do not, the cause is "to be read" and the gap is reported, not papered over
- Done when a fixture change with a known trace yields nonzero trace bytes with provenance, and each cause has a test that produces it
- _Requirements: 2.1, 2.3, 2.4, 2.5_
- _Boundary: hunt/annotations.py_
- [ ] 2.2 Joern's results as a producer (P)
- `joern` producer: the graph of the head revision once per revision, the `path` taint query and the `access_control` dominance query per changed function, rendered as ordered steps; "no path" is a result, "did not start" and "timed out" are failures
- The record holds the image digest, the Joern version, the source bytes read, the exit status, start-up seconds and query seconds; the image is rebuilt from HEAD before the first recorded run
- Done when, in the shipped image, one Python and one TypeScript fixture application with a known path traversal each yield a nonempty flow, and an engine made to exit nonzero yields a failed annotation
- _Requirements: 2.2, 2.3, 2.4, 2.5, 2.6_
- _Boundary: hunt/annotations.py_
- [ ] 2.3 The cache through the memory store
- Joern results keyed by repository, revision, path, function content, language, family, query, spec and image digests; model answers keyed by request digest, sample index and model version; both through the store's blob calls
- Done when a second producer run on unchanged input starts no engine and returns the same bytes, and a changed query digest is a miss
- _Requirements: 2.8, 5.7_
- _Depends: roadmap step C1_
- [ ] 2.4 The two inputs and the three masks
- `FEATURE_NAMES`, `PRODUCERS` and `INPUTS` gain the two producers; the arms of E1 are masks over one stored table, so every annotated arm reads the same bytes
- Done when a run with each of the three masks shows the expected inputs present and absent in its record
- _Requirements: 2.7_
- _Depends: 2.1, 2.2_
- [ ] 3. Reading a run
- [ ] 3.1 Three answers and a vote (P)
- Ask a program three times with distinct sample indices; a location counts on two of three within ten lines; every answer and the agreement share are kept
- First check in this task: three calls at the fixed temperature return three samples and not one cached answer; if not, use DSPy's rollout id
- Done when scripted answers give the expected votes, and a live probe of three calls (inside the E1 ceiling) shows three distinct request records
- _Requirements: 6.3_
- _Boundary: hunt/sampling.py_
- [ ] 3.2 One page per example (P)
- Label, each annotation with byte count and provenance, the answers, the vote, hit or miss; the miss causes the records decide are set, the two that need a person are marked "to be read" and counted apart
- Done when golden pages on fixtures match for a hit, each decidable miss cause, and an ordinary change that drew a suspicion
- _Requirements: 3.1, 3.2, 3.3, 3.4_
- _Boundary: hunt/pages.py_
- [ ] 3.3 Show a page and rerun one example
- `ousast-hunt page` shows the page of an example and run; `ousast-hunt rerun` runs one example and arm again and states the cost before it starts
- Done when both commands work against a fixture run with the scripted model
- _Requirements: 3.5, 3.6_
- [ ] 4. E0, the delivery check
- [ ] 4.1 The E0 command
- Both producers over the frozen book, no model call, both API keys unset; the report per family and language of vulnerable examples whose annotation covers the labelled function, the causes for the rest, the count for ordinary examples, and the producer times
- Done when the command runs on a fixture book and its report shows every field
- _Requirements: 5.1, 5.2, 5.3, 5.5, 5.6, 8.5_
- [ ] 4.2 Run E0 and read it
- The run on the frozen book in the shipped image; then the same run again
- A family with fewer than four of five covered is reported not ready, with its examples and causes handed to `engine-change-scoped-analysis`
- Done when the E0 record is published with the book's digest, the readiness of each family is stated, and the second run started no engine and gave the same bytes
- _Requirements: 5.2, 5.4, 5.5, 5.7_
- [ ] 5. E1, the baseline
- [ ] 5.1 The E1 manifest and its refusals
- One registered manifest: the book's digest, the three masks, model and version, three samples, the 10 USD ceiling, the mark; a second difference between arms, a reserved repository, or a missing registration refuses the run; the ceiling stops it and keeps its records; an arm with more than one instrument failure in ten is "not read"
- Done when each refusal and the stop have a test with the scripted model
- _Requirements: 4.1, 4.2, 4.3, 4.6, 4.7, 8.1, 8.2, 8.4_
- [ ] 5.2 Run E1 and read it
- The three arms over the ready families of the book; counts, paired differences and top-K per arm with the per-example table; the pages; "to be read" causes set by a person
- The mark per family: the annotated arm finds at least two more of five than the arm without, with no more suspicions per ordinary change
- Done when the record is published under `benchmarks/measurements/` with the proof that every input was read, the mark is stated met or not per family, and one dated decision line is written
- _Requirements: 4.4, 4.5, 4.8, 6.1, 6.2, 6.4, 6.6, 6.7, 6.8, 8.3_
- [ ] 6. Close the stage with the maintainer
- The E1 result and its pages go to the maintainer. If a family met the mark, the next stage is opened by a dated amendment of the requirements that cites this result. If none did, the strategy experiments stop and the miss causes are the result
- Done when the maintainer's decision is recorded in the requirements
- _Requirements: 6.5, 7.2, 7.3, 7.5_
@@ -488,3 +488,30 @@ The first MVP used the single-query `cpg.run("taint", …)` path and returned
`originAnchors`, `quotedSanitizers`, `fieldParameterSources`) that `taint.sc`'s `exec` signature does not
declare, so both single-query sub-routes (CLI `--param` and session named-arg) reject them. The batch path
(`run_batch` → `requestsFile` JSON) tolerates them, which is why the pilot scans ran and this MVP used it.
## Amendment of 2026-11-30: carried work (roadmap line 1)
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 (`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):
- 2.14 Control dependence is not populated, and two arbiters want it.
- 5.6 and 7.2 A sanitizer cleanses the family it cleanses, keyed to the weakness it prevents.
- 5.12 The ranker knows one framework, and everything else lands in "unknown".
- 7.4 One matcher, used by every query.
Carried from `authorization-obligations` (superseded):
- 2.6 Recognize registration-based entry points. The admission reads of 2026-10-30 and 2026-10-31 named
this gap: event bridges, MCP tools and router factories outside the route-shaped entry model.
Carried from `learned-decision-engine` (superseded):
- 11.1 Mine candidate discharge facts from the fix diffs (sanitizer calls, guarding conditions).
- 11.2 Admit a candidate fact by held-out separation per outer fold. On training repositories only.
Still this brief's own: start the analysis from the code the push changed, and the injection security
object (the taint flow with argument provenance), which waits for the driver's baseline.
@@ -1,3 +1,6 @@
> **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. No task is carried. No code was written for this spec.
# Requirements Document: finding-feedback-loop
> **Status 2026-10-02:** dormant. Requirements approved and design generated on 2026-09-09; the design was never approved and no tasks exist. It depends on `contributor-scan`, which is paused; reopen it with that spec.
+7 -3
View File
@@ -1,9 +1,9 @@
{
"feature_name": "finding-feedback-loop",
"created_at": "2026-09-09T12:00:00Z",
"updated_at": "2026-09-09T13:00:00Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "design",
"phase": "superseded",
"approvals": {
"requirements": {
"generated": true,
@@ -22,5 +22,9 @@
"depends_on": [
"contributor-scan"
],
"approval_note": "2026-09-09 brief drafted. Scope lifted out of contributor-scan, where two task groups (a counter-example ledger and per-repository evolutionary prompting) had been appended directly to tasks.md without passing requirements or design -- a workflow error, and they are a separate feature rather than a refinement of scan integration. Prompted by the maintainer asking for GEPA/SIMBA-style evolution with declarative persistent per-repository state so developers can commit dismissals and evolve the harness. The design boundary is that an optimiser may evolve the QUESTION (judge and residual prompts) and never the FACTS (tables, rulesets, declared policy), because the closed-loop leak measured 2026-09-05 turned a -0.059 holdout Youden into +0.059 by teaching from the pairs it then recovered. Not approved; requirements not generated. ; 2026-09-09 requirements generated at the maintainer's direction ('approve the amendments and generate the requirements for finding-feedback-loop'). Seven requirements: a dismissal file the developer owns and the tool never writes; a counter-example ledger whose entries are runnable regression cases grouped by shared cause; a model that proposes a cause into a review queue and decides nothing, validated by reverting the three known matcher fixes; dismissals plus recipe vulnerabilities as one split evaluation set with the holdout unread; evolution scoped to the judge and residual questions with the fact tables off limits by any automated means; an adoption that reports what it traded and reverts itself when net-negative; and the loop inheriting the corpus blind spot, so its evidence base is repositories and it says how few of them there are. Not approved. ; 2026-09-09 requirements APPROVED and design generated ('approve the requirements and run the design phase'). The design turns on one asymmetry: two of the three matcher bugs needed no judgement at all, only the fix carried across, so the automation that pays is propagation and memory and the model is confined to naming what a group shares. Two prohibitions are enforced by tests rather than convention -- no module under feedback/ may import a writer for the fact tables or rulesets, and evaluation_set has no code path returning holdout rows during optimisation (the missing 'all' argument IS the design, since the 2026-09-05 leak was possible because reading the holdout was merely discouraged). A dismissal is recorded AT a rung, so dismissing a suspicion does not silence the same site when the graph later entails it. Risk recorded: the evidence base is two repositories, one of which has never produced a true positive, so the ledger and dismissals are useful immediately while the evolution should not be trusted until contributor-scan 2.15 or 5.2 lands a checkout that can."
"approval_note": "2026-09-09 brief drafted. Scope lifted out of contributor-scan, where two task groups (a counter-example ledger and per-repository evolutionary prompting) had been appended directly to tasks.md without passing requirements or design -- a workflow error, and they are a separate feature rather than a refinement of scan integration. Prompted by the maintainer asking for GEPA/SIMBA-style evolution with declarative persistent per-repository state so developers can commit dismissals and evolve the harness. The design boundary is that an optimiser may evolve the QUESTION (judge and residual prompts) and never the FACTS (tables, rulesets, declared policy), because the closed-loop leak measured 2026-09-05 turned a -0.059 holdout Youden into +0.059 by teaching from the pairs it then recovered. Not approved; requirements not generated. ; 2026-09-09 requirements generated at the maintainer's direction ('approve the amendments and generate the requirements for finding-feedback-loop'). Seven requirements: a dismissal file the developer owns and the tool never writes; a counter-example ledger whose entries are runnable regression cases grouped by shared cause; a model that proposes a cause into a review queue and decides nothing, validated by reverting the three known matcher fixes; dismissals plus recipe vulnerabilities as one split evaluation set with the holdout unread; evolution scoped to the judge and residual questions with the fact tables off limits by any automated means; an adoption that reports what it traded and reverts itself when net-negative; and the loop inheriting the corpus blind spot, so its evidence base is repositories and it says how few of them there are. Not approved. ; 2026-09-09 requirements APPROVED and design generated ('approve the requirements and run the design phase'). The design turns on one asymmetry: two of the three matcher bugs needed no judgement at all, only the fix carried across, so the automation that pays is propagation and memory and the model is confined to naming what a group shares. Two prohibitions are enforced by tests rather than convention -- no module under feedback/ may import a writer for the fact tables or rulesets, and evaluation_set has no code path returning holdout rows during optimisation (the missing 'all' argument IS the design, since the 2026-09-05 leak was possible because reading the holdout was merely discouraged). A dismissal is recorded AT a rung, so dismissing a suspicion does not silence the same site when the graph later entails it. Risk recorded: the evidence base is two repositories, one of which has never produced a true positive, so the ledger and dismissals are useful immediately while the evolution should not be trusted until contributor-scan 2.15 or 5.2 lands a checkout that can.",
"phase_before_supersession": "design",
"superseded_on": "2026-11-30",
"superseded_by": [],
"supersession_note": "No task is carried. No code was written for this spec."
}
+3
View File
@@ -1,3 +1,6 @@
> **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. No task is carried. The sentence it owns in `safety-net.md` stays.
# Brief: flow-aware-ranking, spend the expensive query where the cheap evidence is strongest
> **Status 2026-10-02:** dormant. Brief only and unapproved; its 2026-09-12 amendment placed ranking inside the pre-push safety net, where the ranker now lives.
+8 -2
View File
@@ -3,7 +3,7 @@
"language": "en",
"status": "brief",
"approved": false,
"updated_at": "2026-09-12T15:35:00Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"related_specs": [
"pre-push-safety-net"
],
@@ -12,5 +12,11 @@
"depends_on": [
"contributor-scan"
],
"cross_language_note": "2026-09-12: maintainer endorsed the direction and clarified PMPro as core development case, JavaScript/Express Node APIs as required transfer workload, and C/C++ as additional shared-machinery/abstraction-limit evidence. Preserve language-agnostic core decisions; framework facts may differ. Detailed amended requirements/design remain pending review."
"cross_language_note": "2026-09-12: maintainer endorsed the direction and clarified PMPro as core development case, JavaScript/Express Node APIs as required transfer workload, and C/C++ as additional shared-machinery/abstraction-limit evidence. Preserve language-agnostic core decisions; framework facts may differ. Detailed amended requirements/design remain pending review.",
"phase": "superseded",
"phase_before_supersession": null,
"superseded_on": "2026-11-30",
"superseded_by": [],
"ready_for_implementation": false,
"supersession_note": "No task is carried. The sentence it owns in `safety-net.md` stays."
}
+5 -3
View File
@@ -1,7 +1,7 @@
{
"feature_name": "hunter-learning-loop",
"created_at": "2026-10-13T09:05:00+02:00",
"updated_at": "2026-10-13T12:20:00+02:00",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "tasks-generated",
"approvals": {
@@ -19,5 +19,7 @@
"approved": false
}
},
"ready_for_implementation": false
}
"ready_for_implementation": false,
"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"
}
@@ -92,3 +92,11 @@
- Same scorer and metrics as the pilot; before-and-after of search recall, suspicions per push, push-level recall, false alarms per 100 and precision, per family, with intervals; the proof arm's workload per 100 pushes; the gate distance read off the curve; the run recorded next to the pilot's measurement, at most once per accepted program
- 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 open work moves to `dspy-driver`
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.
+3
View File
@@ -1,3 +1,6 @@
> **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. No task is carried.
# Brief: ir-consolidation, stop maintaining an IR we did not need, and adopt one we do
> **Status 2026-10-02:** dormant. Brief only and unapproved. The subtraction it asks for still needs a measured recall comparison before the flat IR goes.
+7 -3
View File
@@ -1,9 +1,9 @@
{
"feature_name": "ir-consolidation",
"created_at": "2026-09-09T17:00:00Z",
"updated_at": "2026-09-09T17:30:00Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "brief",
"phase": "superseded",
"approvals": {
"requirements": {
"generated": false,
@@ -22,5 +22,9 @@
"depends_on": [
"contributor-scan"
],
"approval_note": "2026-09-09 brief drafted after the maintainer raised codebase growth and suggested adopting an existing IR (Vine, or Rolf Rolles' work, or Ghidra's). The brief separates two questions with opposite answers. The SOURCE IR is already carried rather than about to be added: semantic/ is 3218 lines, 16% of the codebase, holding a hand-written IR and flat taint engine measured at 2.2% entailment against the CPG's 41.3%, still running as a proposer -- and Vine and P-Code are binary IRs that do not help, so the work there is subtraction not substitution. The MISSING abstraction is the C arithmetic-overflow class, where GhidraPAL's three-valued-logic abstract interpreter over Ghidra P-Code is exactly the right shape and exists; Vine is dormant since 2009 and is not the candidate. Constraint recorded: question 1 lands before question 2 starts, or the brief makes the growth problem worse. Not approved. ; 2026-09-09 angr added as the strongest candidate for the binary-side question after the maintainer raised it: Python 3 so it fits the extras pattern this codebase already uses for heavyweight capabilities, BSD-2-Clause against Vine's GPL-2.0 which would be a decision about the whole tool, actively maintained, and it names VALUE-SET ANALYSIS as a capability -- which is precisely the abstraction c/memory lacks and is abstract interpretation rather than SMT, matching the architecture decision already taken. GhidraPAL stays as the worked example of a bit-precise TVL domain to read before writing one, not as a platform."
"approval_note": "2026-09-09 brief drafted after the maintainer raised codebase growth and suggested adopting an existing IR (Vine, or Rolf Rolles' work, or Ghidra's). The brief separates two questions with opposite answers. The SOURCE IR is already carried rather than about to be added: semantic/ is 3218 lines, 16% of the codebase, holding a hand-written IR and flat taint engine measured at 2.2% entailment against the CPG's 41.3%, still running as a proposer -- and Vine and P-Code are binary IRs that do not help, so the work there is subtraction not substitution. The MISSING abstraction is the C arithmetic-overflow class, where GhidraPAL's three-valued-logic abstract interpreter over Ghidra P-Code is exactly the right shape and exists; Vine is dormant since 2009 and is not the candidate. Constraint recorded: question 1 lands before question 2 starts, or the brief makes the growth problem worse. Not approved. ; 2026-09-09 angr added as the strongest candidate for the binary-side question after the maintainer raised it: Python 3 so it fits the extras pattern this codebase already uses for heavyweight capabilities, BSD-2-Clause against Vine's GPL-2.0 which would be a decision about the whole tool, actively maintained, and it names VALUE-SET ANALYSIS as a capability -- which is precisely the abstraction c/memory lacks and is abstract interpretation rather than SMT, matching the architecture decision already taken. GhidraPAL stays as the worked example of a bit-precise TVL domain to read before writing one, not as a platform.",
"phase_before_supersession": "brief",
"superseded_on": "2026-11-30",
"superseded_by": [],
"supersession_note": "No task is carried."
}
+12 -4
View File
@@ -1,9 +1,9 @@
{
"feature_name": "learned-decision-engine",
"created_at": "2026-09-30T14:00:00Z",
"updated_at": "2026-10-04T18:00:00Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "implementation",
"phase": "superseded",
"approvals": {
"requirements": {
"generated": true,
@@ -18,6 +18,14 @@
"approved": true
}
},
"ready_for_implementation": true,
"note": "2026-10-01: AI-classifier design approved; 6.1-6.5 (no model spend) authorised; paid steps need go-ahead."
"ready_for_implementation": false,
"note": "2026-10-01: AI-classifier design approved; 6.1-6.5 (no model spend) authorised; paid steps need go-ahead.",
"phase_before_supersession": "implementation",
"superseded_on": "2026-11-30",
"superseded_by": [
"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 `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,3 +1,6 @@
> **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 `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
Order follows the design's commit sequence. Every task is a commit gated on the full suite's own exit code,
@@ -1,3 +1,6 @@
> **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. No task is carried. The MCP server (`src/openultrasast/mcp.py`) is shipped and stays; the ledger's deletion date of 2026-12-01 for it is void.
# Brief: MCP shift-left agent + skills
Status: brief / not yet specced. Proposed 2026-10-07. Delivery surface for the
+21 -4
View File
@@ -1,10 +1,27 @@
{
"feature_name": "mcp-shift-left-agent",
"created_at": "2026-10-07T15:10:00Z",
"updated_at": "2026-10-07T15:10:00Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "brief",
"approvals": {"requirements": {"generated": false, "approved": false}, "design": {"generated": false, "approved": false}, "tasks": {"generated": false, "approved": false}},
"phase": "superseded",
"approvals": {
"requirements": {
"generated": false,
"approved": false
},
"design": {
"generated": false,
"approved": false
},
"tasks": {
"generated": false,
"approved": false
}
},
"ready_for_implementation": false,
"summary": "MCP agent + skills so developers and coding agents get the safety net's feedback early (shift-left, in-editor) and so a coding agent can be required to pass a security check before it ships. Delivery surface after G0-G5 qualification; builds on the existing ousast mcp server."
"summary": "MCP agent + skills so developers and coding agents get the safety net's feedback early (shift-left, in-editor) and so a coding agent can be required to pass a security check before it ships. Delivery surface after G0-G5 qualification; builds on the existing ousast mcp server.",
"phase_before_supersession": "brief",
"superseded_on": "2026-11-30",
"superseded_by": [],
"supersession_note": "No task is carried. The MCP server (`src/openultrasast/mcp.py`) is shipped and stays; the ledger's deletion date of 2026-12-01 for it is void."
}
+8 -3
View File
@@ -1,9 +1,9 @@
{
"feature_name": "plane-on-kubernetes",
"created_at": "2026-10-02T20:00:00Z",
"updated_at": "2026-11-27T10:39:48Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "implementation",
"phase": "superseded",
"approvals": {
"requirements": {
"generated": true,
@@ -18,5 +18,10 @@
"approved": true
}
},
"ready_for_implementation": true
"ready_for_implementation": false,
"roadmap_state_2026_11_30": "retired with the kube and AX plane",
"phase_before_supersession": "implementation",
"superseded_on": "2026-11-30",
"superseded_by": [],
"supersession_note": "No task is carried. The kube and AX plane is retired; its code is removed by the cut (roadmap steps C2 and C3)."
}
+3
View File
@@ -1,3 +1,6 @@
> **SUPERSEDED 2026-11-30** (maintainer decision; `.kiro/steering/roadmap.md`, "Second decision of
> 2026-11-30"). No work lands in this spec. The directory stays as history. No task is carried. The kube and AX plane is retired; its code is removed by the cut (roadmap steps C2 and C3).
# Implementation Plan
> **Status 2026-10-04.** Groups 1-2 are done on kind (records `benchmarks/measurements/2026-10-02-k8s-01-profile/`
+3 -2
View File
@@ -1,7 +1,7 @@
{
"feature_name": "pre-push-safety-net",
"created_at": "2026-09-12T15:35:00Z",
"updated_at": "2026-09-16T17:15:00+00:00",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "implementation",
"approvals": {
@@ -223,5 +223,6 @@
"m1_split_accepted": "2026-09-14: maintainer asked to split M1 into M1a/M1b after review",
"m1a_outcome": "Met inside the one-week box. Corrected the owner diagnosis: all four named vetoes fire, and operation correspondence for an operation on a changed line is the blocker that survives every other repair.",
"m1b_position": "Comparison half verified and recorded on NodeGoat; the consequence and repair rendering (10.10) remains before M1b is verified."
}
},
"roadmap_state_2026_11_30": "active, line 3 (the developer sees it), narrowed; task 18 added; 11.3, 13.2, 13.3 deferred"
}
+14
View File
@@ -677,6 +677,20 @@ Preserve all completed task evidence below.
- _Requirements: 9.1–9.6, 6.3_
- [ ] 18. Show the driver's suspects and the demonstrated findings (roadmap line 3, 2026-11-30)
- Amendment of 2026-11-30 (maintainer decision; `.kiro/steering/roadmap.md`, top section). The hook stops waiting for an admitted static capability before it shows anything: it shows the driver's suspects as advisory, and a demonstration as the only block-grade evidence. The evidence bar for a normal alert in `safety-net.md` is unchanged: a claim, a link to the change, an exact location, a repair direction.
- 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 (`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 (waits for the follow-up proof spec; second decision of 2026-11-30)
- 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
- Done when the packaged vulnerable push shows the demonstration, and the fixed and the benign push show none
- [ ] 18.3 Decide the deadline for the model and the search
- The driver and the search do not fit a 30 second push. Either the hook answers from a background run and says which commit its answer is for, or graph reuse gets an owner here. The maintainer decides; M2 stays unmet until then
- Done when the decision is recorded and the hook's output states the scope and age of what it shows
## Implementation Notes
- Task5.2 measured PMPro timing out after both snapshots were materialized but before change context/graph analysis. Group6 must account for compatible snapshot/discovery reuse as well as graph reuse; identical-tip hits cannot substitute for the later representative changed-code latency gate. No new detector, scope heuristic or incremental CPG mutation is implied.
+17 -3
View File
@@ -1,10 +1,24 @@
{
"feature_name": "proof-arm-opencode",
"created_at": "2026-10-07T14:40:00Z",
"updated_at": "2026-10-07T14:40:00Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "brief",
"approvals": {"requirements": {"generated": false, "approved": false}, "design": {"generated": false, "approved": false}, "tasks": {"generated": false, "approved": false}},
"approvals": {
"requirements": {
"generated": false,
"approved": false
},
"design": {
"generated": false,
"approved": false
},
"tasks": {
"generated": false,
"approved": false
}
},
"ready_for_implementation": false,
"summary": "OpenCode-MCP proof-authoring arm for search-with-proof: abliterated/GLM proof model, DSPy-optimized from OpenObserve traces; trust-domain decision (A scoped-key-in-cluster vs B brain-on-VM) must be resolved first. Creds in .env by name."
"summary": "OpenCode-MCP proof-authoring arm for search-with-proof: abliterated/GLM proof model, DSPy-optimized from OpenObserve traces; trust-domain decision (A scoped-key-in-cluster vs B brain-on-VM) must be resolved first. Creds in .env by name.",
"roadmap_state_2026_11_30": "deferred; a follow-up spec opens once dspy-driver E1 is read; Docker on a dedicated runner, no external sandbox"
}
+10 -3
View File
@@ -1,9 +1,9 @@
{
"feature_name": "reachability-flow-model",
"created_at": "2026-09-04T16:27:33Z",
"updated_at": "2026-09-04T16:27:33Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "tasks-generated",
"phase": "superseded",
"approvals": {
"requirements": {
"generated": true,
@@ -18,5 +18,12 @@
"approved": false
}
},
"ready_for_implementation": false
"ready_for_implementation": false,
"phase_before_supersession": "tasks-generated",
"superseded_on": "2026-11-30",
"superseded_by": [
"dspy-driver",
"access-control-prover"
],
"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,3 +1,6 @@
> **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 `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
- [ ] 1. Foundation: call graph and reachability
+4 -3
View File
@@ -1,7 +1,7 @@
{
"feature_name": "search-with-proof",
"created_at": "2026-10-05T12:00:00Z",
"updated_at": "2026-10-07T13:30:00Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "tasks-generated",
"approvals": {
@@ -25,5 +25,6 @@
"pair": "xiaomusic (path, prefix-bypass)",
"false_proofs": 0,
"exit_remaining": "path family >=5 demonstrations / 0 false proofs (Req 6.2), then >=73-negative BLOCK qualification (Req 6.3)"
}
}
},
"roadmap_state_2026_11_30": "deferred; a follow-up spec opens once dspy-driver E1 is read; Docker on a dedicated runner, no external sandbox"
}
+35
View File
@@ -1,3 +1,11 @@
> **DEFERRED 2026-11-30** (maintainer decision; `.kiro/steering/roadmap.md`, "Second decision of
> 2026-11-30"). No work lands here now. Proof becomes a follow-up spec once the driver's baseline
> (`dspy-driver`, E1) is read. It will run in Docker on a dedicated runner, with no external sandbox: no AX
> task, no gVisor, no cluster. This spec and the code under `src/openultrasast/search/` are its input. Of
> the open tasks, 1.1, 1.2, 3.2, 3.3 and 5.3 name the cluster and are dropped; 3.1, 6.2 to 6.4 and group 7
> are carried to the follow-up. The amendment of the same morning further down ("the proof arm is active")
> is withdrawn by this notice.
# Implementation Plan
Scope: infrastructure probe and feasibility pilot only (Req 6.1-6.2). BLOCK qualification (6.3), the unseen-pool arm
@@ -57,6 +65,33 @@ gates, runs every networked or paid step.
- [ ] 6.4 Exit decision against 6.2 and report to the maintainer; on pass, spec tasks for qualification and the
unseen-pool arm. _Requirements: 6.2_
## Amendment of 2026-11-30: the proof arm is active (roadmap line 2)
Maintainer decision of 2026-11-30 (`.kiro/steering/roadmap.md`, top section): "I find that my search with
proof got somehow benched, but it's important for developers to see that nowadays". The ladder of 2026-11-20
parked this spec "until R4 needs proof-based BLOCK"; that is withdrawn. The scope line at the top of this
file ("infrastructure probe and feasibility pilot only") is widened by group 7. Open tasks 1.1, 1.2, 3.1 to
3.3, 5.3 and 6.2 to 6.4 stay as written; the next of them is the path family of the pilot (five
demonstrations, zero false proofs). The maintainer set its ceiling on 2026-11-30: 15 USD for the path family;
work stops and reports when it is reached. Other paid and networked steps still need the maintainer's
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
`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: 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
evidence; only the verifier's record is. `ousast scan` prints it in its report and the pre-push hook
names it in one bounded block (`pre-push-safety-net` 18).
- [ ] 7.3 One real pair end to end, and the page that shows it (roadmap N5). Push, advisory suspects,
search, demonstration, the developer-facing artifact; `docs/use-case-fix-and-reverify.md` shows the
recorded run and says what is working and what is not.
- [ ] 7.4 Families without an oracle. A family the search cannot demonstrate stays advisory and is listed
as such; no pooled block gate is built for it. _Carried from: learned-decision-engine 17.3_
## Implementation Notes
- Group 2 (2026-10-05): independently reviewed; `tests/test_search_verify.py` has 32 passing tests and one
@@ -1,7 +1,7 @@
{
"feature_name": "valid-detection-benchmark",
"created_at": "2026-10-12T14:38:18Z",
"updated_at": "2026-11-18T06:45:00Z",
"updated_at": "2026-11-30T00:00:00+01:00",
"language": "en",
"phase": "tasks-generated",
"approvals": {
@@ -27,5 +27,6 @@
"pre-push-safety-net",
"search-with-proof"
],
"approval_note": "2026-11-12: the validated detection-core V3 predecessor unblocked task generation. The replacement benchmark task graph covers all 73 acceptance criteria, passed the bounded task-plan and independent sanity reviews, and was auto-approved by explicit -y request; valid-detection-benchmark consumes but does not edit core-owned contracts."
"approval_note": "2026-11-12: the validated detection-core V3 predecessor unblocked task generation. The replacement benchmark task graph covers all 73 acceptance criteria, passed the bounded task-plan and independent sanity reviews, and was auto-approved by explicit -y request; valid-detection-benchmark consumes but does not edit core-owned contracts.",
"roadmap_state_2026_11_30": "frozen as built; 11.6 and 11.7 wait for step N6"
}
+3
View File
@@ -1,3 +1,6 @@
> **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. No task is carried. Its concern, a zero that names its cause, lives in `pre-push-safety-net` task 16.
# Brief: zero-with-a-reason, a finding count is meaningless without a denominator
> **Status 2026-10-02:** dormant. Brief only and unapproved; not touched since 2026-09-10.
+12 -1
View File
@@ -3,5 +3,16 @@
"status": "brief",
"approved": false,
"summary": "A finding count is meaningless without a denominator: make every zero decomposable and let a scan prove it did work.",
"depends_on": ["contributor-scan"]
"depends_on": [
"contributor-scan"
],
"phase": "superseded",
"phase_before_supersession": null,
"superseded_on": "2026-11-30",
"superseded_by": [
"pre-push-safety-net"
],
"ready_for_implementation": false,
"supersession_note": "No task is carried. Its concern, a zero that names its cause, lives in `pre-push-safety-net` task 16.",
"updated_at": "2026-11-30T00:00:00+01:00"
}
+15
View File
@@ -1,5 +1,20 @@
# Detection quality: standing rules (2026-10-30)
## 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 (`dspy-driver`) finds, `search-with-proof` demonstrates, and a
push is blocked only on a demonstration. `search-with-proof` is deferred to a follow-up spec, opened once the driver's
baseline is read (the second decision of that day); BLOCK still needs its demonstration.
- **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
recognition and resolution work is chosen by what the driver's ablation shows missing.
- **Rules 4 and 5 are the training rule.** A development population teaches; an admission
population is untouched and never tunes anything. The wider wording "the pool measures and never
trains" (`overview.md`, 2026-10-14) is replaced by these two rules. A compiled driver program
passes the reversed-pair probe before any admission read.
- Rules 3, 6 to 10 and 12 are unchanged. Rule 12 binds every step of the roadmap of 2026-11-30.
Detection on unseen repositories is the binding constraint of this project. The rules below
extend the 2026-10-28 gate-5 decision and the Req 12 admission workflow to every spec that
touches detection. Where this file disagrees with older spec text, this file wins for
+3
View File
@@ -1,3 +1,6 @@
> **RETIRED 2026-11-30** (maintainer decision; `roadmap.md`, "Second decision of 2026-11-30"). The kube
> and AX plane is retired. No workload of this project runs on the cluster. This file is history.
# kube-ax operator constraints
Verified by the operator on 2026-10-05. These constraints apply across all workloads.
+30 -1
View File
@@ -1,9 +1,38 @@
# Overview — what this is, and what is actually true of it
## Current state, 2026-10-30
## Current state, 2026-11-30
Everything below this section is dated history; where it disagrees with this section, this section wins.
- **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
(`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.
- **Scope cut the same day.** The product is a safety net that produces evidence about a pushed
change. One line of work until it is read: the driver, stage one of `dspy-driver`. The kube and AX
plane is retired and is cut from the tree (`roadmap.md`, steps C1 to C5). `search-with-proof` is
deferred to a follow-up spec in Docker on a dedicated runner, opened once the driver's baseline is
read. The RustFS memory store stays and moves out of the plane package.
- **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
sampled several times per question, and is compiled on training repositories.
- **The decision-strategy correction of 2026-10-14 is narrowed, not withdrawn.** It stays true
that software shape features decide nothing and that anything fitted on them learns the pool.
Two of its rules were wider than their evidence and are replaced: "the pool measures and never
trains" becomes "admission and evaluation populations never train; the training pool teaches",
and "no compiled prompt" becomes "the driver may be compiled on compile folds, on the trace, and
must pass the reversed-pair probe". No threshold is tuned on an admission label.
- **Nothing has been measured since 2026-10-31.** The figures of the section below are still the
latest. No arm meets the gate; every output is advisory; BLOCK needs a demonstrated proof.
- **Superseded on 2026-11-30:** `contributor-scan`, `learned-decision-engine`,
`reachability-flow-model`, `authorization-obligations`, `finding-feedback-loop`,
`flow-aware-ranking`, `zero-with-a-reason`, `ir-consolidation`, `mcp-shift-left-agent`. The open
tasks that the three lines need were carried; the spec map in `roadmap.md` says where.
## Current state, 2026-10-30 (superseded by the section above where they differ)
Below this section is dated history.
- **Detection on unseen repositories is still the open problem, and now measured honestly.**
The valid benchmark pilot (2026-10-12): push hook 0/12, hunter 5-6/12 at 54 FA/100. The
access-control prover: 15/23 on the development pool (2026-10-28, binary vocabulary),
+259 -1
View File
@@ -1,6 +1,264 @@
# Roadmap
## Roadmap -- milestone ladder to a shippable safety net (2026-11-20)
## Roadmap -- back to bug finding: the driver, then proof (2026-11-30)
This section supersedes every section below it, the ladder of 2026-11-20 included. The older
sections stay as history. No bar is lowered: admission populations stay untouched, and a push is
blocked only on a demonstrated proof.
### Decision (maintainer, 2026-11-30)
The maintainer's words, after the project review of that day:
- "for me it's prio that the driver (augmented by abstract interpreation and wrapped into
probablistic dspy loops) finds bugs I want to avoid. it seems the project drifts and bug finding
is not focused"
- "I find that my search with proof got somehow benched, but it's important for developers to see
that nowadays"
- "I would like to supersede the respective specs and the roadmap but take those open tasks needed
with me to steer back to my actual project"
Terms used below. The **driver** is the model-driven hunter (`src/openultrasast/hunt/`, a DSPy
program). **Abstract interpretation** is what the engine and the access-control prover compute
without a model: entries, operations, guards, the ordered trace with argument provenance, taint
paths. **Proof** is `search-with-proof`: a finding demonstrated by execution, on the vulnerable
revision and not on the fixed one.
### What the review found (2026-11-30)
- The last detection measurement is of 2026-10-31 (`benchmarks/measurements/`). November has 235
commits and no new detection number.
- Since 2026-10-14 the work went to contracts and benchmark machinery: 88 feature commits on
`detection-core`, 47 on `valid-detection-benchmark`. `src/openultrasast/core/` holds about 23,000
of 85,000 source lines and `benchmarks/valid` 33,000; the prover and the proof arm hold about
4,500 each.
- The ladder's next step, the governed run 11.6, had no new arm to measure: the only arm that went
through admission is parked after three 0/12 reads. It also waits on four cohorts reviewed by a
second person, and none exist.
- Rule 11 of `detection-quality.md` (a parked arm leads to a narrowed product plus proof-based
BLOCK) fired on 2026-10-31 and was not executed. The ladder parked `search-with-proof` instead.
- The rule "the pool measures and never trains" was written wider than its evidence. The
measurements of 2026-10-13 and 2026-10-14 falsified one thing: a program fitted on software shape
features (callers, diff shape, counts). They did not test a program that reads the trace.
- The breadth ledger of 2026-10-13 (`.kiro/breadth.toml`) already parked `contributor-scan` and
`learned-decision-engine` and marked five specs for deletion. None of it was carried out, and
the ladder of 2026-11-20 put two of them back on the path. Sessions six to twelve
(2026-11-25 to 2026-11-29) were `contributor-scan` packaging and release work.
### The three lines of work
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: `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
from `access-control-prover` (delivered) and `engine-change-scoped-analysis` (the engine work it
still needs).
2. **Proof shows them.** Specs: `search-with-proof`, with `proof-arm-opencode`. The driver's top
suspects go to the search, which builds the application and demonstrates the bug by a
differential. Active again from today; it is the only way to BLOCK.
3. **The developer sees it.** Spec: `pre-push-safety-net`, narrowed. The hook and `ousast scan`
show the driver's suspects as advisory and a demonstrated finding with its evidence: the
request, the effect on the pushed code, the repair direction.
The instrument stands behind the lines and is frozen as built: `valid-detection-benchmark` and
`detection-core`. No machinery task starts there until an arm has moved its number on the
training pool.
### Order of work, each step with its number
Rule 12 of `detection-quality.md` binds every step: the lever and the measurement are named
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. 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
(`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.
(`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.)
- **N5. The developer sees a demonstrated finding.** One real pair end to end: push, advisory
suspects, proof, the evidence shown in the hook output and the scan report, and a docs page
that says what is working and what is not. (`search-with-proof` 7.2, 7.3;
`pre-push-safety-net` 18.)
- **N6. Admission, once.** Only after N3 shows a gain: one read on population v4 (11 cases, frozen
2026-11-23) under its protocol, then the governed run 11.6 if its cohorts exist by then.
Withdrawn the same day: N4 and N5 wait for the follow-up spec of the proof arm, which opens once
N1 is read (see "Second decision of 2026-11-30").
### Rules, as amended
- **Admission and evaluation populations never train.** The training pool and the training set of
N2 teach the driver. This replaces "the pool measures and never trains" of 2026-10-14.
- **The driver may be compiled.** Instructions and demonstrations are chosen on compile folds of
the training repositories. This replaces "no compiled prompt" of 2026-10-14. What stays from
that day: software shape features alone decide nothing, every compiled program passes the
reversed-pair probe, and no threshold is tuned on an admission label.
- **BLOCK only on a demonstrated proof**, never on a score (`detection-quality.md` rule 9,
unchanged).
- Two admission NO-GOs in a row on the same arm still park it. Every zero still proves its
instrument read nonzero input. Spent populations stay spent.
- **One handover page.** A handover names the line, the last number, the next step and its
measurement. Session records go to the spec they belong to.
### Spec map (2026-11-30)
| Spec | State | What happens to its open tasks |
| --- | --- | --- |
| `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` | deferred; a follow-up spec opens once E1 is read | Docker on a dedicated runner; cluster tasks dropped; the rest carried to the follow-up |
| `pre-push-safety-net` | active, line 3, narrowed | 8.3 and 16 stay; 18 added; 11.3, 13.2, 13.3 deferred; 15 provisional |
| `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` | superseded: the kube and AX plane is retired | none carried; its code goes with the cut (C2, C3) |
| `ai-service-plane` | retired with the plane | was complete; its code goes with the cut (C2) |
| `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.
"Dropped" means not carried, not forbidden: a dropped task comes back only through a line above,
with its lever and number named.
### Answers of 2026-11-30 (maintainer, with the question tool)
- **The bugs to avoid (N2):** access control and path traversal first. Injection and secrets or
configuration were offered and not chosen; they are not in the first training set.
- **The repositories:** AI-written web applications, Express/TypeScript and FastAPI/Python. The
training set and the first measurements are drawn from these.
- **Spend:** 25 USD in total for the first paid steps, about 10 for the driver baseline (N1) and
15 for the path family of the proof pilot (N4). Work stops and reports when either is reached.
N3 has no ceiling yet.
- **Commits:** the amendment goes in as two commits, steering with the public roadmap page, then
the specs with the breadth ledger; not pushed without a word.
### Second decision of 2026-11-30: cut the scope (wins over the text above where they differ)
The maintainer, on approving the requirements of `dspy-driver`:
- "spec bugs imho are a) lack of dspy and driver vs abstract interpetation b) not focused on the task at
hand 'find vulerability'; instead some infrastructure and 'cementing' or systems which have not been
prooven c) the kube / ax plane: retire."
- "search with proof in docker, and simplify: we run this in a dedicated runner setup, so no external
sandbox."
- "I would clean cut the scope back to what we need: a safety net that produces evidence and not security
improvements with unclear risks. search with proof becomes a follow up spec once our abstract
interpetation and dspy core is read. and in order to make space for this we have to cut into the ax,
kube, docker"
- "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."
What follows from it:
- **The product, in one sentence:** a safety net that produces evidence about a pushed change. Read as:
the tool reports what it can show (a trace, later a demonstration) and does not claim to improve the
security of a repository or change its code.
- **One line of work until it is read: the driver** (`dspy-driver`, stage one: the example book, the
wiring of the prover's trace and Joern's results, E0, E1). Its requirements are approved.
- **Proof follows; it does not run beside.** `search-with-proof` is deferred, not parked for good: a
follow-up spec opens once E1 is read. It runs in Docker on a dedicated runner, with no external sandbox
(no AX task, no gVisor, no cluster). The existing spec and code stay as its input and take no work
until then. Steps N4 and N5 above wait for that spec, and the sentence "N4 does not wait" is withdrawn.
- **The kube and AX plane is retired.** `plane-on-kubernetes` is superseded, `ai-service-plane` is marked
retired, `kube-ax.md` is history. No work lands on the cluster, on AX tasks or on the local kind
cluster.
- **The cut is a deletion job, not a spec.** It is done when the checks below hold, and it has no
detection number; the maintainer ordered it to make room.
| Step | What | Read on 2026-11-30 |
| --- | --- | --- |
| C1 | Move what the driver needs out of the plane package: the memory store and the spend meter | `plane/memory.py` (1,050 lines) and `plane/budget.py` are imported by `learn/` (7 files) and `hunt/runner.py` |
| C2 | Delete the plane executor, its task manifests and its commands | `src/openultrasast/plane` 23 files, 7,531 lines; `plane/` 57 files; `ousast plane` in `cli.py`; 45 test files name plane, AX or kube |
| C3 | Delete the AX and kube operations code and the lanes that use it | `ops/ax` 13 files, `ops/k8s` 8 files, `benchmarks/ax` 3 files, the AX and k8s engine-trace lanes in `benchmarks/learn` |
| C4 | One image: Joern and `ousast`, for the scan and the driver | today two build stages on a task base image, and three image workflows |
| C5 | Docs and steering say what is left | `docs/plane.md`, `docs/deployment.md`, the README's AX commands |
| C6 | Move the vulnerable sample code to an orphan `samples` branch, forward only | `benchmarks/pairs` 653 files and `benchmarks/fixtures` 32 files of sample code; catalogs, manifests and scripts stay; the CI gate and about eight test files read the samples |
Done when no module outside history imports `openultrasast.plane`, the suite is green on GitHub, and the
removed lines are counted in the commit record. C1 comes first, and before the driver's stage one needs
the store. `src/openultrasast/search/` is not cut: five of its files name AX or the cluster, and the
follow-up spec decides what of it stays.
- **Memory for the driver.** The RustFS store stays (`memory.py` after C1; file and S3 backends). The
driver uses it in three stages, each entered by a result (`dspy-driver`, Requirement 7 and its brief):
first a cache that saves cycles (Joern results by revision and query version, model answers by request);
then a case memory of verified examples the driver retrieves from; then a curator that scores, merges and
prunes cases. DSPy 3.4.1 as installed has the parts for the first two (its cache, `KNNFewShot`, an
embedder, tools in a loop) and none for pruning or for a memory agent; that part is this project's to
build and to measure.
### Answers to the second menu of 2026-11-30 (maintainer, with the question tool)
- **Memory:** "M1 now, M2/M3 by result". The cache is built in stage one of `dspy-driver`; the case
memory and the curator get criteria only after E1 is read.
- **The plane cut:** "C1 now, rest after E1". The memory store and the spend meter move out of the
plane package now; C2 to C5 wait until the baseline is read.
- **Docker:** "One image": Joern and `ousast`, for the scan and the driver. The task base image, its
workflow and the runner image go with C4.
- **The example book:** "I propose, you approve". Candidates come from the development catalogs and
the vibe-code pairs, checked against every admission population; the maintainer sees the list of
thirty before it is frozen.
### Answers to the third menu of 2026-11-30 (maintainer, with the question tool)
- **The example book is mixed:** AI-written cases where a sound one exists, advisory-backed web
applications otherwise (`dspy-driver`, requirements amendment and task 1.1).
- **Clones:** allowed, and not made on this machine, which had 2.1 GB free. The maintainer:
"once we have spec'ed this out, I plan to move this to a new machine". The book is fetched there
with one command.
- **The design of `dspy-driver` is approved;** its tasks are generated and wait for approval.
- **The vulnerable samples go to a branch** ("can you move the vulnerabe repos into a branch?"):
sample code only, forward only (no history rewrite), with the plane cut after E1. It is step C6.
When it runs, a gate that finds the samples absent fails loudly and never skips. The example
book adds no vulnerable code to main: it holds addresses and revisions.
- **What does not travel with git to the new machine:** `.env`; `benchmarks/unseen/private/` and
`benchmarks/search/private/`, which the reserved-repository guard reads; the untracked handover
files; the local results and cache directories; the assistant's memory notes and checkpoints.
### Open for the maintainer
- The spend ceiling of N3.
- The runner of the follow-up proof spec executes repository code and model-written demonstrations
with Docker as its only wall. What that runner may hold (keys, network reach) is the operator's
to state before that spec is written.
- 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.
## Roadmap -- milestone ladder to a shippable safety net (2026-11-20; superseded 2026-11-30)
This section supersedes ordering questions below it. It is the general roadmap the maintainer
asked for: every open work stream led milestone by milestone to the narrow advisory release
+8 -1
View File
@@ -73,7 +73,14 @@ Keep the repeatedly inspected plugins as regression workloads. Evaluate new rank
policies on untouched repositories and benign changes as well. A policy that suppresses all alerts
does not pass: useful recall and coverage are required alongside low noise.
## Specification boundaries
## 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 (`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
superseded (`roadmap.md`, spec map of 2026-11-30); their boundaries below are history.
- `pre-push-safety-net`: immutable pushed snapshots, ranker integration, reusable results, total budget,
change attribution, actionability admission, and concise hook behavior.
+1 -1
View File
@@ -27,7 +27,7 @@ import yaml
from benchmarks.valid.artifact_contract import read_benchmark_artifact, write_benchmark_artifact
from openultrasast.config import load_dotenv
from openultrasast.plane.memory import PRESIGNED_ARCHIVE_SUFFIX, S3Store, open_store
from openultrasast.memory import PRESIGNED_ARCHIVE_SUFFIX, S3Store, open_store
from openultrasast.search.task_storage import diagnostic, exception_reason
@@ -12,7 +12,7 @@ from pathlib import Path
from openultrasast.config import load_dotenv
from openultrasast.learn import experiments as ex
from openultrasast.plane.memory import open_store
from openultrasast.memory import open_store
EXPERIMENT = "exp-004-pooled-block-gate"
UNITS = Path(f"plane/experiments/{EXPERIMENT}.units.jsonl")
+1 -1
View File
@@ -45,6 +45,7 @@ from collections.abc import Mapping
from pathlib import Path
from typing import Any
from openultrasast import memory
from openultrasast.findings import quick_scan_findings
from openultrasast.learn.features import (
NONE,
@@ -71,7 +72,6 @@ from openultrasast.learn.features import (
from openultrasast.learn.labels import Clone
from openultrasast.learn.roles import RoleSet, from_model_roles, infer_for_checkout
from openultrasast.pairs import DEFAULT_CATALOG, _materialize_side, _targets, load_pair_catalog
from openultrasast.plane import memory
from openultrasast.plane.harvest import declares
from openultrasast.plane.tasks.alerts import covers
from openultrasast.plane.tasks.alerts import engine_languages as _engine_languages
+1 -1
View File
@@ -31,11 +31,11 @@ from engine_trace_worker import EXCLUDED_DIRS, safe_path, unit_record, write_jso
from openultrasast.learn.examples import read_jsonl
from openultrasast.learn.labels import load_sources, repo_name
from openultrasast.memory import FileStore
from openultrasast.model.specs import taint_specs
from openultrasast.model.taint import request_params
from openultrasast.pairs import _materialize_side, load_pair_catalog
from openultrasast.plane.engine_alerts import export_pin
from openultrasast.plane.memory import FileStore
from openultrasast.plane.tasks.alerts import engine_languages
from openultrasast.preprocess import detect_language
+1 -1
View File
@@ -17,7 +17,7 @@ from engine_trace_k8s import pack
from benchmarks.ax.batch import AXLane, Item, SandboxFailure, Workload, manifest
from benchmarks.ax.batch import task_state as task_state
from openultrasast.plane.memory import open_store as open_store
from openultrasast.memory import open_store as open_store
def task_manifest(name, args, urls):
+1 -1
View File
@@ -12,7 +12,7 @@ import time
import uuid
from datetime import timedelta
from openultrasast.plane.memory import PRESIGNED_ARCHIVE_SUFFIX, S3Store, open_store
from openultrasast.memory import PRESIGNED_ARCHIVE_SUFFIX, S3Store, open_store
IMAGE = "ghcr.io/norandom/openultrasast:2.0.1"
BOOTSTRAP = r"""
+1 -1
View File
@@ -9,7 +9,7 @@ import uuid
from engine_worker_service import PENDING, client_from_env, pack, put, read, result_key, status
from openultrasast.plane.memory import PRESIGNED_ARCHIVE_SUFFIX
from openultrasast.memory import PRESIGNED_ARCHIVE_SUFFIX
class Dispatcher:
+1 -1
View File
@@ -28,7 +28,7 @@ from pathlib import Path
from engine_trace_worker import unit_record, worker
from openultrasast.plane.memory import S3Client, s3_settings
from openultrasast.memory import S3Client, s3_settings
PENDING = "engine-queue/pending/"
CLAIMED = "engine-queue/claimed/"
+1 -1
View File
@@ -22,7 +22,7 @@ from openultrasast.config import load_dotenv
from openultrasast.learn.examples import load_examples
from openultrasast.learn.labels import load_sources
from openultrasast.learn.slice import function_slice
from openultrasast.plane.memory import MemoryStore, open_store
from openultrasast.memory import MemoryStore, open_store
UNITS = Path("plane/experiments/exp-004-pooled-block-gate.units.jsonl")
OUTPUT = Path("benchmarks/measurements/2026-10-03-graph-slice-leak-audit/record.json")
+2 -2
View File
@@ -21,7 +21,9 @@ from pathlib import Path
from benchmarks.ax.batch import AXLane, ClusterUnavailable, SearchExecutorTask, Workload, validate_image
from benchmarks.ax.search_verify import AXSideDispatcher, validate_result
from benchmarks.search.executor_smoke import CLONE
from openultrasast.budget import BudgetExhausted, SpendBudget
from openultrasast.config import load_dotenv
from openultrasast.memory import FileStore, open_store
from openultrasast.model.endpoint import (
DEEPSEEK_BASE_ENV,
DEEPSEEK_BASE_URL,
@@ -30,8 +32,6 @@ from openultrasast.model.endpoint import (
Prices,
price_of,
)
from openultrasast.plane.budget import BudgetExhausted, SpendBudget
from openultrasast.plane.memory import FileStore, open_store
from openultrasast.provider.openrouter import OpenRouterChatClient
from openultrasast.search import _sandbox
from openultrasast.search.board import Board
+1 -2
View File
@@ -837,8 +837,7 @@ def run(
def main(argv: list[str] | None = None) -> int:
from openultrasast import config
from openultrasast.plane import memory
from openultrasast import config, memory
from openultrasast.plane.reconciler import results_root
parser = argparse.ArgumentParser(description=__doc__)
+2 -3
View File
@@ -18,7 +18,7 @@ from urllib.parse import urlsplit
import yaml
from openultrasast.plane.memory import MemoryStore
from openultrasast.memory import MemoryStore
URL = re.compile(r"github\.com/([\w.-]+/[\w.-]+)", re.I)
NAME = re.compile(r"[\w.-]+/[\w.-]+")
@@ -327,8 +327,7 @@ def verify_tests(root: Path) -> dict:
def main(argv: list[str] | None = None) -> int:
import os
from openultrasast import config
from openultrasast.plane import memory
from openultrasast import config, memory
from openultrasast.plane.reconciler import results_root
parser = argparse.ArgumentParser(description=__doc__)
+1 -1
View File
@@ -12,6 +12,7 @@ from copy import deepcopy
from pathlib import Path
from openultrasast import tool_hunter
from openultrasast.budget import MeteredClient
from openultrasast.complexity.map import Hotspot
from openultrasast.config import load_config
from openultrasast.hunt.runner import _full_checkout as full_checkout
@@ -19,7 +20,6 @@ from openultrasast.hunter_tools import clamp_repo_path
from openultrasast.learn.program import ANSWER_FORMAT, Caller, Prompt, classify
from openultrasast.model.endpoint import resolve_models
from openultrasast.model.taxonomy import FAMILY_IDS, load_families
from openultrasast.plane.budget import MeteredClient
if __package__ in {None, ""}:
sys.path.insert(0, str(Path(__file__).resolve().parents[2]))
+34
View File
@@ -1,5 +1,8 @@
# Roadmap
The order of work changed on 2026-11-30: read [The direction of 2026-11-30](#the-direction-of-2026-11-30)
first. The rest of this page is the state of 2026-11-28.
State on 2026-11-28. The project is at step R3 of its ladder, the first honest number. That is one
governed run (task 11.6 of the valid benchmark) that measures detection on real repositories the tool
was not tuned on. The run has not happened: the independently reviewed cases it needs do not exist
@@ -14,6 +17,37 @@ regression). Work on the engine runs alongside and does not wait for it.
The only detection figures on this page are the two recall counts quoted in the status of 2026-11-06.
Every figure, with its record, is in [Where we stand](where-we-stand.md) and [Evaluation](evaluation.md).
## The direction of 2026-11-30
A project review on 2026-11-30 changed the order of work. The ladder below is kept as the record of
2026-11-20; where the two differ, this section is the plan in force.
The review found that no detection measurement had been taken since 2026-10-31, and that the work of
November had gone into benchmark machinery, packaging and the release. The next step of the ladder,
the governed run, had no new detection arm to measure. So the work returns to finding bugs, on three
lines:
1. **The driver finds the bugs.** The driver is the model-driven hunter. It reads a change together
with what static analysis establishes about it: the entry, the data that reaches a protected
operation, and the checks on the way. It is sampled several times per question and is taught on
training repositories only.
2. **Proof shows them.** The proof arm builds the application and demonstrates a suspect by a
differential: the issue triggers on the vulnerable revision and not on the fixed one. It is a pilot and
it waits: it comes back as its own piece of work once the driver's first measurement has been
read, running in Docker on a dedicated runner.
3. **The developer sees it.** The hook and `ousast scan` show the driver's suspects as advisory, and
a demonstrated finding with its evidence.
What does not change: the repositories used to qualify a release are never used to teach, every
output is advisory until a number on unseen repositories says otherwise, and a push is blocked only
on a demonstrated proof. The benchmark machinery is kept as built, and the governed run waits until
the driver has shown a gain on training repositories. None of the three lines has a new measurement
yet.
The same day the scope was cut back to a safety net that produces evidence about a pushed change.
The plane on Kubernetes and its task runner are retired and will be removed from the tree; the
memory store stays. Until its first measurement is read, the driver is the only line of work.
## Where this is going
On every push, from a hook or CI, OpenUltraSAST answers for the changed code. It stays advisory for
+1 -1
View File
@@ -2,7 +2,7 @@
# OpenRouter serves embeddings only; the chat model stays DeepSeek. `openrouter` is not an ax provider, so the
# annotation declares the extension. `secretKey` names the Kubernetes Secret and key that hold OPENROUTER_API_KEY;
# the key itself is never in a manifest. Prices in USD per million tokens: embeddings bill input only, so the cache
# and output rates are 0 and `plane.budget.MeteredEmbeddingClient` prices the provider's `usage.prompt_tokens`.
# and output rates are 0 and `openultrasast.budget.MeteredEmbeddingClient` prices the provider's `usage.prompt_tokens`.
apiVersion: ax.io/v1alpha1
kind: Model
metadata:
+2 -2
View File
@@ -26,7 +26,7 @@ docs = [
"mkdocs>=1.6,<2",
"mkdocs-material>=9.5,<10",
]
# The plane's memory store on an S3-compatible bucket (OUSAST_MEMORY=s3://<bucket>, plane/memory.py; RustFS is the
# The plane's memory store on an S3-compatible bucket (OUSAST_MEMORY=s3://<bucket>, memory.py; RustFS is the
# tested server). Imported lazily; the core install and the file store need nothing beyond PyYAML.
s3 = [
"boto3>=1.35,<2",
@@ -81,7 +81,7 @@ warn_unused_configs = true
module = "tree_sitter"
ignore_missing_imports = true
# boto3 is an optional extra without inline types, absent in the type-check environment (plane/memory.py imports
# boto3 is an optional extra without inline types, absent in the type-check environment (memory.py imports
# it lazily).
[[tool.mypy.overrides]]
module = ["boto3", "botocore.*"]
@@ -13,8 +13,8 @@ from collections.abc import Mapping
from decimal import Decimal
from typing import Any, Protocol
from ..model.endpoint import Prices
from ..tool_hunter import ChatClient, ChatResponse
from .model.endpoint import Prices
from .tool_hunter import ChatClient, ChatResponse
_ACCOUNT_MARKERS = ("HTTP Error 401", "HTTP Error 402", "Insufficient Balance")
_USAGE_FIELDS = ("prompt_tokens", "prompt_cache_hit_tokens", "completion_tokens")
+4 -3
View File
@@ -1542,7 +1542,7 @@ def _plane(args: argparse.Namespace) -> int:
print(f"plane: {exc}", file=sys.stderr)
return 2
if args.plane_command == "run":
from .plane.memory import MemoryStoreError
from .memory import MemoryStoreError
_plane_memory("seed", args.run_manifest)
try:
@@ -1618,7 +1618,7 @@ def _plane_alerts_engine(args: argparse.Namespace) -> int:
def _plane_memory_normalise(args: argparse.Namespace) -> int:
"""``ousast plane memory-normalise``: one pass over every row object; prints the counts."""
from .plane import memory
from . import memory
try:
store = memory.open_store(args.store)
@@ -1640,7 +1640,8 @@ def _plane_memory(
) -> int:
"""``seed`` before a Run, ``ingest`` after it (and ``ousast plane remember``). A store failure is reported and
never changes the run's result: ingest can be repeated by hand."""
from .plane import memory, reconciler
from . import memory
from .plane import reconciler
from .plane.tasks.remember import UNKNOWN, remember_run
try:
+1 -1
View File
@@ -20,8 +20,8 @@ from pathlib import Path
from typing import Any
from .. import source
from ..budget import cost_of
from ..model.endpoint import _PRICES
from ..plane.budget import cost_of
from ..preprocess import detect_language
from .artifact import RunArtifact, UsageLedger
from .labels import label_rows
+9 -9
View File
@@ -116,8 +116,8 @@ def _experiment(args: argparse.Namespace) -> int:
ceiling stops the run (``unfinished``: a rerun resumes from the outcome rows)."""
from datetime import date
from ..plane.budget import MeteredClient
from ..plane.memory import open_store
from ..budget import MeteredClient
from ..memory import open_store
from . import experiments as ex
from .program import Caller, ReplayMiss
@@ -240,7 +240,7 @@ def _write(report: dict[str, Any], out: Path | None) -> None:
def _caller(args: argparse.Namespace, store: Any, model: str) -> Any:
"""The metered, cached caller; ``None`` client under --replay-only. Exits 2 without a ceiling or a key."""
from ..plane.budget import MeteredClient
from ..budget import MeteredClient
from .program import Caller
parameters = _model_parameters(args.manifest)
@@ -275,8 +275,8 @@ def _program_command(args: argparse.Namespace) -> int:
"""compile | evaluate | curve. Exit 3 when the ceiling stops the run (``unfinished``, no artifact, no number)."""
from datetime import date
from ..plane.budget import BudgetExhausted
from ..plane.memory import open_store
from ..budget import BudgetExhausted
from ..memory import open_store
from .compile import DEFAULT_SPEC, compile_program, load_program, load_spec, spec_of
from .embeddings import EmbeddingCache
from .evaluate import candidate_from_example, evaluate, learning_curve, predict, targets, unevaluable_families
@@ -341,8 +341,8 @@ def _model_parameters(path: Path) -> dict[str, Any]:
def _memory_embed(args: argparse.Namespace) -> int:
"""Exit 2 without a ceiling, 3 when the ceiling stops the run (``unfinished``; a rerun resumes from the cache)."""
from ..plane.budget import BudgetExhausted, MeteredEmbeddingClient
from ..plane.memory import open_store
from ..budget import BudgetExhausted, MeteredEmbeddingClient
from ..memory import open_store
from .embeddings import embed_excerpts
from .examples import EXAMPLE_KIND
@@ -370,7 +370,7 @@ def _memory_embed(args: argparse.Namespace) -> int:
def _memory_build(args: argparse.Namespace) -> int:
"""Exit 2 on a refused label (``origin: user``, a source outside the list) or a source with >10% unread excerpts."""
from ..plane.memory import open_store
from ..memory import open_store
from .examples import ExampleBuildError, SideReader, build_examples, pair_pins, read_jsonl, records_by_key
from .labels import DEFAULT_CACHE, DEFAULT_SOURCES, load_sources
@@ -402,7 +402,7 @@ def _memory_build(args: argparse.Namespace) -> int:
def _audit_leaks(args: argparse.Namespace) -> int:
"""Exit 2 when the store holds no pair to audit (an unread store is not a clean one)."""
from ..plane.memory import open_store
from ..memory import open_store
from .leaks import MIN_PAIRS, THRESHOLD, audit, pair_rows, sides_from_units
store = open_store(args.memory)
+2 -2
View File
@@ -36,8 +36,8 @@ from dataclasses import dataclass, field, replace
from pathlib import Path
from typing import Any
from ..plane.budget import BudgetExhausted
from ..plane.memory import MemoryStore
from ..budget import BudgetExhausted
from ..memory import MemoryStore
from .examples import Example
from .folds import CompileSplit, Fold, assert_disjoint, compile_split, folds_digest, outer_folds
from .labels import _ADVISORY
+3 -3
View File
@@ -2,7 +2,7 @@
OpenRouter serves embeddings only (``openai/text-embedding-3-small``, 1,536 dimensions, $0.02 per million input
tokens; ``plane/models/openrouter-embedding.yaml``). Every call goes through
:class:`..plane.budget.MeteredEmbeddingClient`, so a ceiling stops the next batch and a call reporting no tokens is
:class:`..budget.MeteredEmbeddingClient`, so a ceiling stops the next batch and a call reporting no tokens is
an error, not a free call. The cache key is the excerpt's sha (the content-addressed blob ``excerpts/<sha>.txt``)
per embedding model: ``embeddings/<model-slug>/<excerpt_sha>.json`` holds ``{model, dimensions, vector (float32,
base64, little-endian), tokens, created}``. An excerpt is embedded once; a rerun makes no call.
@@ -20,8 +20,8 @@ from dataclasses import asdict, dataclass
from datetime import date
from typing import Any
from ..plane.budget import EmbeddingClient
from ..plane.memory import MemoryStore
from ..budget import EmbeddingClient
from ..memory import MemoryStore
from .excerpt import excerpt_sha, normalise
DEFAULT_MODEL = "openai/text-embedding-3-small"
+1 -1
View File
@@ -37,7 +37,7 @@ from dataclasses import asdict, dataclass, field
from pathlib import Path
from typing import Any
from ..plane.memory import MemoryStore, repo_key, row_id
from ..memory import MemoryStore, repo_key, row_id
from .excerpt import EXAMPLE, Bounds, delta_diff, excerpt, function_bounds, identities_of
from .labels import Label, Sources
from .schema import features_for
+2 -2
View File
@@ -42,8 +42,8 @@ from typing import Any
import yaml
from ..plane.budget import BudgetExhausted, MeteredClient
from ..plane.memory import MemoryStore, row_id
from ..budget import BudgetExhausted, MeteredClient
from ..memory import MemoryStore, row_id
from .compile import load_program, spec_of
from .evaluate import (
BOUNDS,
+2 -2
View File
@@ -12,9 +12,9 @@ from collections.abc import Callable, Mapping, Sequence
from dataclasses import dataclass
from typing import Any
from ..budget import BudgetExhausted, MeteredClient, cost_of, prices_from
from ..memory import MemoryStore
from ..model.endpoint import DeepSeekChatClient
from ..plane.budget import BudgetExhausted, MeteredClient, cost_of, prices_from
from ..plane.memory import MemoryStore
from ..tool_hunter import ChatClient, ChatResponse
from . import experiments as ex
from .examples import Example
+3 -3
View File
@@ -32,8 +32,8 @@ from collections.abc import Callable, Collection, Mapping, Sequence
from dataclasses import asdict, dataclass, field, replace
from typing import Any
from ..plane.budget import cost_of, prices_from
from ..plane.memory import MemoryStore
from ..budget import cost_of, prices_from
from ..memory import MemoryStore
from .examples import Example
from .folds import Fold
from .retrieve import Retrieval, Target, assert_boundary, demonstrations_for, retrieve
@@ -368,7 +368,7 @@ def params_digest(parameters: Mapping[str, Any] | None) -> str:
@dataclass
class Caller:
"""Every model call of a program run: cached by request in ``responses/<sha>.json`` (and in memory), replayed at
$0. ``client`` is a metered client (``plane.budget.MeteredClient``); ``None`` is replay-only."""
$0. ``client`` is a metered client (``budget.MeteredClient``); ``None`` is replay-only."""
client: Any
model: str
@@ -901,7 +901,7 @@ def s3_settings(environ: Mapping[str, str] | None = None) -> dict[str, Any]:
"""Endpoint, keys, region and session token from ``.env``/the environment; a missing key is named, a value
never is. ``S3_ENDPOINT`` is a full URL (``https://host[:port]``)."""
if environ is None:
from ..config import load_dotenv
from .config import load_dotenv
load_dotenv()
environ = os.environ
@@ -925,7 +925,7 @@ def open_store(spec: str | None = None, environ: Mapping[str, str] | None = None
"""The store ``spec`` (else ``OUSAST_MEMORY``, else ``file://<results_root()>/memory``) names. ``s3://`` with no
bucket uses ``S3_BUCKET``. ``read_only`` skips the S3 write/Select capability probe and refuses S3 mutations;
it is intended for GET/list inventory readers, which do not need Select. Default opening is unchanged."""
from .reconciler import results_root
from .plane.reconciler import results_root
env = environ if environ is not None else os.environ
text = spec or env.get("OUSAST_MEMORY") or ""
@@ -980,7 +980,7 @@ def seed(run_manifest: Path, store: MemoryStore | None = None, *, results_root:
"""Reuse stored facts for a Run's tasks whose ``openultrasast.io/memory-key`` matches (Req 6.1): each such task
without a directory or a state gets ``facts.json`` and a ``done`` summary and is marked done under the run
lock. Returns the seeded task names. A changed pin, candidate set or runner image finds nothing and recomputes."""
from . import reconciler
from .plane import reconciler
run_spec, manifests = reconciler.load_run(Path(run_manifest))
store = store or open_store()
+1 -1
View File
@@ -30,8 +30,8 @@ from pathlib import Path
from typing import Any
from urllib.parse import urlsplit
from ..memory import RUNS_PREFIX, MemoryStore
from .manifests import Run
from .memory import RUNS_PREFIX, MemoryStore
__all__ = ["DONE", "GRACE_SECONDS", "OUTPUT_TAR", "STATE", "Delivery", "DeliveryError", "declared", "expiry", "input_var"]
+1 -1
View File
@@ -108,7 +108,7 @@ def doctor(profile: PlaneProfile | None = None) -> list[tuple[str, bool, str]]:
else:
ok, out = _registry_has(runner)
checks.append((f"runner image in {profile.registry}", ok, out if ok else f"{out}; {hint} and loads it"))
from .memory import MemoryStoreError, open_store # lazy: boto3 only when the profile names an S3 store
from ..memory import MemoryStoreError, open_store # lazy: boto3 only when the profile names an S3 store
try:
store = open_store(profile.memory)
+3 -3
View File
@@ -21,7 +21,7 @@ under ``--plane`` (default ``plane/``), everything a Run over the set needs besi
stems) the memory rows carry.
Each ``repo-facts`` Task carries ``openultrasast.io/memory-key`` (repository, pin, candidates digest, runner image
digest): the key under which stored facts are reused instead of recomputed (``plane/memory.py``, ``seed``).
digest): the key under which stored facts are reused instead of recomputed (``memory.py``, ``seed``).
Why per-case Tasks rather than one Task per step: an ax Task binds its Workspaces by name and a Run entry adds
neither a binding nor env (it names a Task, artifacts and a budget), and ``Run.inputs`` accepts only
@@ -57,10 +57,10 @@ from typing import Any
import yaml
from ..budget import cost_of
from ..memory import MEMORY_KEY_ANNOTATION, POPULATION_ANNOTATION, SPLIT_ANNOTATION, memory_key
from ..model.endpoint import price_of
from .budget import cost_of
from .manifests import GIT_COMMITS_ANNOTATION, RUN_API_VERSION, Task, load_manifests
from .memory import MEMORY_KEY_ANNOTATION, POPULATION_ANNOTATION, SPLIT_ANNOTATION, memory_key
from .reconciler import _ax_name, _doc
from .tasks.repo_facts import _digest
from .tasks.verify import MAX_STEPS, units_of
+1 -1
View File
@@ -42,11 +42,11 @@ from typing import Any
import yaml
from ..memory import open_store
from .delivery import Delivery, DeliveryError, declared
from .doctor import doctor
from .egress import Egress, policy_for
from .manifests import AX_API_VERSION, Manifests, Model, Run, RunTask, Task, Workspace, load_manifests
from .memory import open_store
from .profile import PlaneProfile, load_profile
from .router import Router, credentials, open_router
+1 -1
View File
@@ -40,7 +40,7 @@ from typing import Any
import yaml
from ...learn.schema import validate_record
from ..memory import REMEMBER_OUTPUT, IngestResult, MemoryStore, image_digest, ingest, repo_key, row_id, validate_row
from ...memory import REMEMBER_OUTPUT, IngestResult, MemoryStore, image_digest, ingest, repo_key, row_id, validate_row
from .repo_facts import _digest
PASSES = ("a", "b", "c")
+1 -1
View File
@@ -30,11 +30,11 @@ from collections.abc import Mapping, Sequence
from pathlib import Path
from typing import Any
from ...budget import AccountError, BudgetExhausted, MeteredClient
from ...learn.roles import MODEL_ROLE_KINDS
from ...learn.schema import OPERATIONS, SOURCE_KINDS
from ...source import MODULE_FUNCTION, product_files
from ...tool_hunter import ChatClient
from ..budget import AccountError, BudgetExhausted, MeteredClient
from .verify import build_client
CHUNK_LINES = 400
+1 -1
View File
@@ -26,8 +26,8 @@ from collections.abc import Mapping, Sequence
from pathlib import Path
from typing import Any
from ...budget import AccountError, BudgetExhausted, MeteredClient
from ...tool_hunter import CLIENT_ENV, ChatClient, ChatResponse, resolve_hunter_client, run_tool_hunter, scripted_hunter_client
from ..budget import AccountError, BudgetExhausted, MeteredClient
PER_HUNT = 6
MAX_STEPS = 6
+1 -1
View File
@@ -15,7 +15,7 @@ from typing import Any
import yaml
from ..plane.memory import MemoryStore
from ..memory import MemoryStore
class Board:
+2 -2
View File
@@ -14,7 +14,7 @@ from collections.abc import Callable
from dataclasses import asdict, dataclass, replace
from typing import Any, Protocol
from ..plane.budget import BudgetExhausted, SpendBudget
from ..budget import BudgetExhausted, SpendBudget
from .board import Board
from .budget import SearchBudget
@@ -43,7 +43,7 @@ class Executor(Protocol):
A missing cost on a model task charges its entire reservation. Model
workers must reserve each call against limits.max_call_usd (the task's
total allowance) using plane.budget.SpendBudget. Exceptions are untrusted
total allowance) using openultrasast.budget.SpendBudget. Exceptions are untrusted
diagnostics and must never be copied into the board.
"""
...
+1 -1
View File
@@ -11,8 +11,8 @@ from typing import Any, Protocol, cast
import yaml
from ..budget import BudgetExhausted, SpendBudget, cost_of
from ..model.endpoint import Prices
from ..plane.budget import BudgetExhausted, SpendBudget, cost_of
from ..provider.openrouter import parse_json_content
from . import _sandbox
from .budget import SearchBudget
+1 -1
View File
@@ -10,7 +10,7 @@ from datetime import timedelta
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from urllib.parse import unquote, urlsplit
from openultrasast.plane.memory import MemoryStore
from openultrasast.memory import MemoryStore
class HttpObjectStore(MemoryStore):
+1 -1
View File
@@ -130,7 +130,7 @@ def test_rustfs_page_lists_the_complete_policy_and_no_secret() -> None:
def test_rustfs_page_quotes_the_refusals_verify_bucket_writes() -> None:
"""Each refusal line the page quotes still appears, as a template fragment, in the store's code."""
code = (ROOT / "src" / "openultrasast" / "plane" / "memory.py").read_text(encoding="utf-8")
code = (ROOT / "src" / "openultrasast" / "memory.py").read_text(encoding="utf-8")
for fragment in (
"the bucket is not set up for the store. The store never configures its ",
"it must be Enabled (provenance cites object versions)",
+2 -2
View File
@@ -1238,7 +1238,7 @@ def test_kubernetes_host_pin_success_failure_and_cleanup(tmp_path, monkeypatch,
from engine_trace_k8s import Kubernetes
from openultrasast.plane.memory import S3Store
from openultrasast.memory import S3Store
objects, calls, expiries = {}, [], []
@@ -1372,7 +1372,7 @@ def test_scheduler_bounds_lanes_and_progress(tmp_path, monkeypatch, executor, pa
def test_k8s_check_roundtrip_and_retention(tmp_path, monkeypatch, capsys, keep):
from engine_trace_k8s import Kubernetes
from openultrasast.plane.memory import S3Store
from openultrasast.memory import S3Store
data, manifests_seen, commands = {}, [], []
+2 -2
View File
@@ -13,6 +13,7 @@ import pytest
from learn_fixtures import ScriptedChat, by_id, corpus, default_answer, example
from test_plane_memory import FakeObjects, _real_s3
from openultrasast.budget import MeteredClient
from openultrasast.learn import compile as compile_module
from openultrasast.learn.compile import (
DEFAULT_SPEC,
@@ -33,8 +34,7 @@ from openultrasast.learn.compile import (
from openultrasast.learn.examples import Example
from openultrasast.learn.folds import Fold, FoldError
from openultrasast.learn.program import Caller, Demo
from openultrasast.plane.budget import MeteredClient
from openultrasast.plane.memory import FileStore, MemoryStore, S3Store
from openultrasast.memory import FileStore, MemoryStore, S3Store
PRICES = {"cache_hit_per_m": 0.014, "input_per_m": 0.44, "output_per_m": 1.32}
MEMORY = corpus(groups=24, per_group=4)
+1 -1
View File
@@ -10,6 +10,7 @@ import random
import pytest
from learn_fixtures import ScriptedChat, corpus
from openultrasast.budget import MeteredClient
from openultrasast.learn.evaluate import (
Prediction,
candidate_from_example,
@@ -28,7 +29,6 @@ from openultrasast.learn.evaluate import (
from openultrasast.learn.folds import compile_split, outer_folds
from openultrasast.learn.program import SIGNATURE, Caller, Program, ProgramSpec
from openultrasast.learn.schema import SCHEMA_VERSION, feature_set_digest
from openultrasast.plane.budget import MeteredClient
def _preds(n: int = 300, *, folds: int = 3, seed: int = 0, unsure_every: int = 0) -> list[Prediction]:
+2 -2
View File
@@ -10,6 +10,7 @@ from pathlib import Path
import pytest
from test_plane_memory import FakeObjects
from openultrasast.budget import BudgetExhausted, MeteredEmbeddingClient, UnmeteredUsage
from openultrasast.learn.embeddings import (
EmbeddingCache,
EmbeddingError,
@@ -21,9 +22,8 @@ from openultrasast.learn.embeddings import (
vector_for,
)
from openultrasast.learn.excerpt import excerpt_sha
from openultrasast.plane.budget import BudgetExhausted, MeteredEmbeddingClient, UnmeteredUsage
from openultrasast.memory import FileStore, MemoryStore, S3Store
from openultrasast.plane.manifests import load_manifests
from openultrasast.plane.memory import FileStore, MemoryStore, S3Store
from openultrasast.provider.openrouter import parse_embedding_payload
PRICES = {"cache_hit_per_m": 0, "input_per_m": 0.02, "output_per_m": 0}
+1 -1
View File
@@ -24,7 +24,7 @@ from openultrasast.learn.examples import (
)
from openultrasast.learn.features import Part, quick_part, record
from openultrasast.learn.labels import Source, Sources
from openultrasast.plane.memory import FileStore, MemoryStore, MemoryStoreError, S3Store
from openultrasast.memory import FileStore, MemoryStore, MemoryStoreError, S3Store
PIN = "0123456789abcdef0123456789abcdef01234567"
SOURCES = Sources(
+2 -2
View File
@@ -13,13 +13,13 @@ from unittest.mock import Mock
import pytest
from learn_fixtures import ScriptedChat, corpus, x_record
from openultrasast.budget import MeteredClient
from openultrasast.cli import main
from openultrasast.learn import experiments as ex
from openultrasast.learn.compile import canonical, program_id
from openultrasast.learn.program import TEMPERATURES, Caller, Candidate, Program, ProgramSpec
from openultrasast.learn.retrieve import Target
from openultrasast.plane.budget import MeteredClient
from openultrasast.plane.memory import FileStore, MemoryStore, Record
from openultrasast.memory import FileStore, MemoryStore, Record
ROOT = Path(__file__).resolve().parents[1]
PRICES = {"cache_hit_per_m": 0.014, "input_per_m": 0.44, "output_per_m": 1.32}
+1 -1
View File
@@ -16,7 +16,7 @@ from openultrasast.learn import experiments as ex
from openultrasast.learn.fill import fill_rule
from openultrasast.learn.program import Candidate, Program, Prompt
from openultrasast.learn.retrieve import Target
from openultrasast.plane.memory import FileStore
from openultrasast.memory import FileStore
def snapshot(root: Path) -> dict[str, bytes]:
+1 -1
View File
@@ -12,7 +12,7 @@ from learn_fixtures import x_record
from openultrasast.cli import main
from openultrasast.learn.leaks import Pair, Signal, audit, pair_rows, separation
from openultrasast.learn.schema import BY_NAME
from openultrasast.plane.memory import FileStore
from openultrasast.memory import FileStore
def _pairs(n: int = 20) -> list[Pair]:
+2 -2
View File
@@ -12,6 +12,7 @@ from pathlib import Path
import pytest
from learn_fixtures import ScriptedChat, by_id, corpus, x_record
from openultrasast.budget import BudgetExhausted, MeteredClient
from openultrasast.learn import program as program_module
from openultrasast.learn.folds import outer_folds
from openultrasast.learn.program import (
@@ -34,9 +35,8 @@ from openultrasast.learn.program import (
)
from openultrasast.learn.retrieve import BoundaryViolation, Retrieval, Target
from openultrasast.learn.schema import EXCLUDED_FIELDS, FeatureRecordError
from openultrasast.memory import FileStore
from openultrasast.model.endpoint import DeepSeekChatClient
from openultrasast.plane.budget import BudgetExhausted, MeteredClient
from openultrasast.plane.memory import FileStore
PRICES = {"cache_hit_per_m": 0.014, "input_per_m": 0.44, "output_per_m": 1.32}
EXAMPLES = corpus(groups=10)
+1 -1
View File
@@ -7,6 +7,7 @@ from __future__ import annotations
import json
from pathlib import Path
from openultrasast.budget import MeteredClient
from openultrasast.learn.features import Vocabulary, function_of, model_sinks_part, roles_part
from openultrasast.learn.roles import (
RoleSet,
@@ -19,7 +20,6 @@ from openultrasast.learn.roles import (
vocabulary_overlay,
)
from openultrasast.model.specs import taint_specs
from openultrasast.plane.budget import MeteredClient
from openultrasast.plane.tasks import roles as roles_task
from openultrasast.tool_hunter import ChatResponse, ScriptedChatClient
+1 -1
View File
@@ -24,7 +24,7 @@ from openultrasast.learn.evaluate import (
) # fmt: skip
from openultrasast.learn.program import Candidate, Program
from openultrasast.learn.retrieve import Target
from openultrasast.plane.memory import FileStore
from openultrasast.memory import FileStore
ROOT = Path(__file__).resolve().parents[1]
+1 -1
View File
@@ -4,8 +4,8 @@ from __future__ import annotations
import pytest
from openultrasast.budget import AccountError, BudgetExhausted, MeteredClient, cost_of, prices_from
from openultrasast.model.endpoint import Prices
from openultrasast.plane.budget import AccountError, BudgetExhausted, MeteredClient, cost_of, prices_from
from openultrasast.tool_hunter import ChatResponse
FLASH = {"cache_hit_per_m": 0.014, "input_per_m": 0.44, "output_per_m": 1.32}
+1 -1
View File
@@ -9,7 +9,7 @@ from pathlib import Path
import pytest
from openultrasast.plane.memory import FileStore
from openultrasast.memory import FileStore
from openultrasast.plane.tasks import features
from openultrasast.plane.tasks.remember import remember_run
+2 -2
View File
@@ -14,12 +14,12 @@ import pytest
import yaml
from test_plane_reconciler import AX_FIELDS, non_ax_fields
from openultrasast.budget import prices_from
from openultrasast.memory import MEMORY_KEY_ANNOTATION, POPULATION_ANNOTATION, SPLIT_ANNOTATION, parse_memory_key
from openultrasast.model.endpoint import price_of
from openultrasast.plane import reconciler
from openultrasast.plane.budget import prices_from
from openultrasast.plane.generate import TEMPLATES, fix_ranges, increment, read_cases, render, repin_templates
from openultrasast.plane.manifests import load_manifests
from openultrasast.plane.memory import MEMORY_KEY_ANNOTATION, POPULATION_ANNOTATION, SPLIT_ANNOTATION, parse_memory_key
from openultrasast.source import _digest
PLANE = Path("plane")
+5 -4
View File
@@ -18,8 +18,8 @@ from typing import Any
import pytest
from openultrasast.plane import memory, reconciler
from openultrasast.plane.memory import (
from openultrasast import memory
from openultrasast.memory import (
S3_KEYS,
ExpiryRule,
FileStore,
@@ -34,6 +34,7 @@ from openultrasast.plane.memory import (
seed,
where_sql,
)
from openultrasast.plane import reconciler
from openultrasast.source import _digest
PIN = "0123456789abcdef0123456789abcdef01234567"
@@ -219,7 +220,7 @@ def test_a_malformed_row_fails_naming_it_and_writes_nothing(store: MemoryStore)
def test_facts_that_no_longer_match_their_hash_are_dropped(store: MemoryStore, caplog: pytest.LogCaptureFixture) -> None:
sha = store.put_facts(FACTS)
store._put(f"facts/{sha}.json", b"tampered")
with caplog.at_level(logging.WARNING, logger="openultrasast.plane.memory"):
with caplog.at_level(logging.WARNING, logger="openultrasast.memory"):
assert store.get_facts(sha) is None
assert "no longer matches" in caplog.text and store._get(f"facts/{sha}.json") is None
@@ -347,7 +348,7 @@ def _filled(client: FakeObjects) -> S3Store:
def test_select_is_pushed_down_when_the_probe_answers(caplog: pytest.LogCaptureFixture) -> None:
client = FakeObjects("works")
store = _filled(client)
with caplog.at_level(logging.WARNING, logger="openultrasast.plane.memory"):
with caplog.at_level(logging.WARNING, logger="openultrasast.memory"):
got = [r.row["candidate"] for r in store.rows(kind="verdict", where={"final": "disputed"})]
assert got == ["a.py::x"] and "locally" not in caplog.text
assert client.selects[0] == 'SELECT * FROM S3Object s WHERE s."probe" = 1'
+2 -2
View File
@@ -959,8 +959,8 @@ def test_state_is_mirrored_to_the_store_and_seeds_a_rerun_from_an_empty_results_
def test_a_store_that_cannot_open_stops_the_run_before_ax_and_leaves_no_lock(
fake: Fake, tmp_path: Path, monkeypatch: pytest.MonkeyPatch
) -> None:
from openultrasast.plane import memory
from openultrasast.plane.memory import MemoryStoreError
from openultrasast import memory
from openultrasast.memory import MemoryStoreError
monkeypatch.setattr(reconciler, "open_store", memory.open_store) # the real one, not the fixture's fake
monkeypatch.setenv("OUSAST_MEMORY", "s3://nowhere") # the profile's override; no S3_* in the test environment

Some files were not shown because too many files have changed in this diff Show More