Reduce verbose investigation and final phase prompt overhead

This commit is contained in:
Nico committed 2026-10-19 16:19:24 +02:00
1 parent 2fe1e478a5
commit 061f82e6f1
24 files changed
+279 -42

No files matched your search

+6 -5
View File
@@ -13,9 +13,9 @@ from viano_bug_analysis.analysis import InvestigationConfig,InvestigationError
from viano_bug_analysis.llm.gemini import GeminiProvider,bootstrap_shape
def nested_request():
def nested_request(version=2):
from test_investigation_lean import lean_context
c=lean_context();c.pop('lean_session');c.update(bootstrap_json_framing=True,bootstrap_framing_version=2)
c=lean_context();c.pop('lean_session');c.update(bootstrap_json_framing=True,bootstrap_framing_version=version)
return build_prompt(c)
@@ -42,8 +42,9 @@ def test_native_shape_covers_nested_finding_fields(field,value):
assert not Draft202012Validator(bootstrap_shape(nested_request()['output_schema'])).is_valid(r)
def test_new_native_contract_sent_with_cache_and_full_schema_retained(monkeypatch):
request=nested_request();assert request['prompt_version']=='investigation_bootstrap_v22'
@pytest.mark.parametrize('version',[2,3])
def test_new_native_contract_sent_with_cache_and_full_schema_retained(monkeypatch,version):
request=nested_request(version);assert request['prompt_version']==f'investigation_bootstrap_v{20+version}'
response=native();response['candidates'][0]['content']['parts'][0]['text']=json.dumps(nonempty_reply())
adapter=GeminiProvider();seen=scripted(adapter,monkeypatch,[CACHE,response,response])
settings=replace(config(),cache_min_prefix_chars=10**9,response_format='json_object')
@@ -66,6 +67,6 @@ def test_legacy_request_remains_v21_and_schema_identical():
assert new['output_schema']==old['output_schema']
@pytest.mark.parametrize('version',[0,3,True,'2'])
@pytest.mark.parametrize('version',[0,4,True,'2'])
def test_invalid_bootstrap_version_rejected(version):
with pytest.raises(InvestigationError):InvestigationConfig(bootstrap_framing_version=version)