Add automation status surface

This commit is contained in:
2026-07-01 20:12:04 +02:00
parent 3f85274916
commit ffe10f098e
20 changed files with 1732 additions and 11 deletions

View File

@@ -573,6 +573,47 @@ def test_resilient_recovery_against_real_2026_06_26_fixture():
assert all("rank" in rec and "candidate" in rec for rec in result.report["recommendations"])
class _MetadataBadLLM:
def __init__(self) -> None:
self.call_count = 0
self.last_response_metadata: dict[str, Any] | None = None
def complete(
self,
prompt: str,
model: str = "",
config: dict | None = None,
) -> str:
self.call_count += 1
self.last_response_metadata = {
"finish_reason": "length",
"usage": {"input_tokens": 1100, "output_tokens": 1200},
}
return ("x" * 9000) + "{"
def test_invalid_report_preserves_response_metadata_and_long_preview():
llm = _MetadataBadLLM()
instr = _instr(
id="daily-triage-report",
prompt="Report.",
trusted_fields=[],
report_sinks=[{"type": "working-memory", "path": "/tmp"}],
)
result = execute_instruction_with_audit(instr, _Event(), {}, llm)
assert llm.call_count == 2
assert result.output_validated is False
assert result.llm_response_metadata == {
"finish_reason": "length",
"usage": {"input_tokens": 1100, "output_tokens": 1200},
}
assert result.report["llm_response_metadata"] == result.llm_response_metadata
assert len(result.report["raw_output_preview"]) > 4000
def test_execute_instruction_with_audit_preserves_invalid_report_with_sinks(
tmp_path,
monkeypatch,