mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-10-19 13:10:03 +00:00
feat(model-grounded-detection): group 1, subtract the noise architecture
99 source modules -> 81. 832 tests -> 646. The whole learning/ package (16 modules, ~4,100 lines) and six semantic/ modules removed, with the three gates byte-identical to 2026-09-06-gate-baseline.txt at every step. The sequence is what made it safe: vocabularies ported first (1.1), importers detached second (1.2-1.3), deletion third (1.4). Every import break during the deletion was therefore a detachment miss in the importer and was fixed there -- no module was restored to satisfy one. Both misses were the same shape and were fixed as a class: operations.py and shapes.py each imported trailing_name from the deleted variants.py, so it moved to semantic/ir.py, its natural home, and both importers changed in one edit. Ported before deleting: the closed guard vocabulary (verbatim, nothing else holds it) into model/specs.py, which derives TaintSpec and DominanceSpec from the retained ruleset facts rather than copying them. Re-homed: families -> model/taxonomy, candidates -> model/candidates, endpoint -> model/endpoint, plus Region, labeled_family and labeled_spans. labeled_family no longer falls back to the LLM classifier -- an unlabeled pair is honestly unknown. Four deviations, each recorded in the spec notes with its reason. improve/ evolve.py and validator.py were stripped, not deleted: each mixes the mechanism lever (gone) with the deterministic rule-status loop `ousast improve` still runs, which has no LLM in it; a test now asserts the lever's absence by symbol so it cannot creep back. The learning CLI group became `model candidates`, because deleting it outright would have orphaned the retained enumerator by removing its only entry point. thinking moved from [learning] to [models]. A gap named rather than papered over: no retained sink fact routes by CWE to path, output_encoding, untrusted_destination or prototype -- the same hole the entailment ceiling diagnosed. The test asserts the seeded set and the gap set exactly, so task 4.2 must update it when it authors those sinks. The audit found exactly one genuine orphan: vectorstore.py, a bakeoff harness with no production caller and no CLI, alive only through its own test. The five named subsystems each carry an explicit decision. Manifest committed, with a test asserting the tree still matches it. Group 2 (the Joern go/no-go) has not started. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01T7XD7x5KonMdmGRkp63EQG
This commit is contained in:
co-authored by
Claude Opus 5
parent
fc4dab97fb
commit
9ed0e45c5f
@@ -22,7 +22,6 @@ def write_markdown_report(
|
||||
mechanisms: Mapping[str, Mapping[str, object]] | None = None,
|
||||
obligations: Mapping[str, Mapping[str, object]] | None = None,
|
||||
obligations_summary: Mapping[str, object] | None = None,
|
||||
learning: Mapping[str, Mapping[str, object]] | None = None,
|
||||
) -> None:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
verification_by_id = _verification_by_id(verifications or [])
|
||||
@@ -73,8 +72,6 @@ def write_markdown_report(
|
||||
_append_mechanisms(lines, cited)
|
||||
if cited_obligations:
|
||||
_append_obligations(lines, cited_obligations, obligations_summary)
|
||||
if learning:
|
||||
_append_learning(lines, learning)
|
||||
if overlay:
|
||||
_append_overlay(lines, overlay)
|
||||
if complexity_map is not None:
|
||||
@@ -158,7 +155,6 @@ def write_sarif_report(
|
||||
overlay: Sequence[object] | None = None,
|
||||
mechanisms: Mapping[str, Mapping[str, object]] | None = None,
|
||||
obligations: Mapping[str, Mapping[str, object]] | None = None,
|
||||
learning: Mapping[str, Mapping[str, object]] | None = None,
|
||||
) -> None:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
verification_by_id = _verification_by_id(verifications)
|
||||
@@ -183,7 +179,6 @@ def write_sarif_report(
|
||||
overlay_by_id.get(finding.finding_id),
|
||||
mechanisms=mechanisms,
|
||||
obligation=(obligations or {}).get(finding.finding_id),
|
||||
learning=(learning or {}).get(finding.finding_id),
|
||||
)
|
||||
for finding in findings
|
||||
],
|
||||
@@ -209,7 +204,6 @@ def write_manifest(
|
||||
provenance: dict[str, object] | None = None,
|
||||
variants: dict[str, object] | None = None,
|
||||
obligations: dict[str, object] | None = None,
|
||||
learning: dict[str, object] | None = None,
|
||||
) -> None:
|
||||
path.parent.mkdir(parents=True, exist_ok=True)
|
||||
verification_by_id = _verification_by_id(verifications)
|
||||
@@ -250,8 +244,6 @@ def write_manifest(
|
||||
payload["variants"] = variants
|
||||
if obligations is not None:
|
||||
payload["obligations"] = obligations
|
||||
if learning:
|
||||
payload["learning"] = learning
|
||||
path.write_text(json.dumps(payload, indent=2, sort_keys=True) + "\n")
|
||||
|
||||
|
||||
@@ -295,7 +287,6 @@ def _sarif_result(
|
||||
*,
|
||||
mechanisms: Mapping[str, Mapping[str, object]] | None = None,
|
||||
obligation: Mapping[str, object] | None = None,
|
||||
learning: Mapping[str, object] | None = None,
|
||||
) -> dict[str, object]:
|
||||
properties: dict[str, object] = {
|
||||
"finding_id": finding.finding_id,
|
||||
@@ -327,10 +318,6 @@ def _sarif_result(
|
||||
properties["obligation_evidence"] = _strings_of(obligation, "evidence")
|
||||
properties["obligation_known_fix"] = obligation.get("known_fix")
|
||||
properties["obligation_intent"] = obligation.get("intent")
|
||||
if learning is not None:
|
||||
properties["family"] = str(learning.get("family", ""))
|
||||
properties["detector"] = str(learning.get("detector", ""))
|
||||
properties["verifier"] = str(learning.get("verifier", ""))
|
||||
return {
|
||||
"ruleId": _rule_id(finding),
|
||||
"level": _sarif_level(finding.severity),
|
||||
@@ -486,16 +473,6 @@ def _append_obligations(lines: list[str], cited: Mapping[str, Mapping[str, objec
|
||||
lines.append("")
|
||||
|
||||
|
||||
def _append_learning(lines: list[str], cited: Mapping[str, Mapping[str, object]]) -> None:
|
||||
"""Which family found a claim, which detector version produced it, and what a verifier said about it."""
|
||||
lines.extend(["## Classified detectors", "", "Findings from the per-family detectors, with what confirmed them.", ""])
|
||||
for finding_id, info in sorted(cited.items()):
|
||||
lines.append(
|
||||
f"- `{finding_id}`: family `{info.get('family')}`, detector `{info.get('detector')}`, verifier `{info.get('verifier')}`"
|
||||
)
|
||||
lines.append("")
|
||||
|
||||
|
||||
def _strings_of(info: Mapping[str, object], key: str) -> list[str]:
|
||||
value = info.get(key)
|
||||
return [str(item) for item in value] if isinstance(value, list | tuple) else []
|
||||
|
||||
Reference in New Issue
Block a user