mirror of
https://github.com/norandom/OpenUltraSAST.git
synced 2026-12-03 10:18:18 +00:00
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]>
This commit is contained in:
co-authored by
Claude Fable 5.2
parent
e22bd420d9
commit
b975acb7e0
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user