generated from coulomb/repo-seed
Set up daily WSJF closure gates
This commit is contained in:
@@ -52,6 +52,18 @@ class _BadLLM:
|
||||
return "not valid json {"
|
||||
|
||||
|
||||
class _FailingLLM:
|
||||
"""Raises like a missing or unreachable llm-connect endpoint."""
|
||||
|
||||
def complete(
|
||||
self,
|
||||
prompt: str,
|
||||
model: str = "",
|
||||
config: dict | None = None,
|
||||
) -> str:
|
||||
raise RuntimeError("LLM_CONNECT_URL is not configured")
|
||||
|
||||
|
||||
class _CountingLLM:
|
||||
"""Tracks how many times complete() is called; returns bad JSON then good JSON."""
|
||||
|
||||
@@ -429,6 +441,30 @@ def test_execute_instruction_with_audit_preserves_invalid_report_with_sinks(
|
||||
assert llm.call_count == 2
|
||||
|
||||
|
||||
def test_execute_instruction_with_audit_preserves_execution_failure_with_sinks():
|
||||
instr = _instr(
|
||||
id="daily-triage-report",
|
||||
prompt="Report.",
|
||||
trusted_fields=[],
|
||||
report_sinks=[{"type": "working-memory", "path": "/tmp"}],
|
||||
)
|
||||
|
||||
result = execute_instruction_with_audit(instr, _Event(), {}, _FailingLLM())
|
||||
|
||||
assert result.tasks == []
|
||||
assert result.output_validated is False
|
||||
assert result.review_required is True
|
||||
assert result.validation_error == "LLM_CONNECT_URL is not configured"
|
||||
assert result.report == {
|
||||
"summary": (
|
||||
"Instruction daily-triage-report could not run; "
|
||||
"operator review is required."
|
||||
),
|
||||
"status": "execution_failed",
|
||||
"validation_error": "LLM_CONNECT_URL is not configured",
|
||||
}
|
||||
|
||||
|
||||
def test_execute_instruction_with_audit_accepts_report_and_tasks_envelope():
|
||||
envelope = {
|
||||
"report": {"summary": "Review needed."},
|
||||
|
||||
Reference in New Issue
Block a user