Add resumable LLM investigation loop with bounded controller execution
This commit is contained in:
1 parent
c03f70e3e1
commit
c39b5881d1
23 files changed
+2872
-15
No files matched your search
@@ -3,6 +3,35 @@ import pytest
|
||||
from viano_bug_analysis.package import PackageReader, PackageReadError
|
||||
|
||||
|
||||
def test_open_reader_uses_immutable_snapshot(make_package):
|
||||
path=make_package(entries={"data":b"original"})
|
||||
with PackageReader(path) as reader:
|
||||
path.write_bytes(b"damaged after opening")
|
||||
assert reader.read_bytes("data")==b"original"
|
||||
with pytest.raises(PackageReadError):
|
||||
with PackageReader(path):pass
|
||||
|
||||
|
||||
def test_cached_validation_is_detached_and_limits_are_part_of_key(make_package):
|
||||
from viano_bug_analysis.package import PackageLimits
|
||||
path=make_package(entries={"data":b"original"})
|
||||
with PackageReader(path) as reader:
|
||||
reader._result.manifest["case_id"]="mutated-private-result"
|
||||
with PackageReader(path) as reader:assert reader.manifest["case_id"]=="case-A"
|
||||
with pytest.raises(PackageReadError):
|
||||
with PackageReader(path,PackageLimits(max_file_bytes=1)):pass
|
||||
|
||||
|
||||
def test_cached_reader_rejects_changed_bytes_even_when_mtime_and_size_match(make_package):
|
||||
import os
|
||||
path=make_package(entries={"data":b"original"})
|
||||
with PackageReader(path):pass
|
||||
stat=path.stat();path.write_bytes(b"x"*stat.st_size)
|
||||
os.utime(path,ns=(stat.st_atime_ns,stat.st_mtime_ns))
|
||||
with pytest.raises(PackageReadError):
|
||||
with PackageReader(path):pass
|
||||
|
||||
|
||||
def test_read_only_and_filename_independent(make_package):
|
||||
path = make_package(entries={"unknown/data.bin": b"\x00\xff"})
|
||||
before = path.read_bytes()
|
||||
|
||||
Reference in new issue
Block a user