generated from coulomb/repo-seed
Set up daily WSJF closure gates
This commit is contained in:
@@ -126,6 +126,18 @@ def execute_instruction_with_audit(
|
||||
return _empty_result(instr)
|
||||
except Exception as exc:
|
||||
logger.warning("instruction %r failed — %s", instr.id, exc)
|
||||
failure_report = _execution_failure_report(instr, str(exc))
|
||||
if failure_report is not None:
|
||||
return InstructionResult(
|
||||
tasks=[],
|
||||
report=failure_report,
|
||||
prompt_hash=None,
|
||||
model=getattr(instr, "model", None),
|
||||
output_validated=False,
|
||||
review_required=True,
|
||||
condition_matched=getattr(instr, "condition", "") or None,
|
||||
validation_error=str(exc),
|
||||
)
|
||||
return _empty_result(instr)
|
||||
|
||||
|
||||
@@ -267,6 +279,19 @@ def _invalid_output_report(
|
||||
return report
|
||||
|
||||
|
||||
def _execution_failure_report(instr: Any, error: str) -> dict[str, Any] | None:
|
||||
"""Build a durable diagnostic report when a report instruction cannot run."""
|
||||
if not getattr(instr, "report_sinks", None):
|
||||
return None
|
||||
return {
|
||||
"summary": (
|
||||
f"Instruction {instr.id} could not run; operator review is required."
|
||||
),
|
||||
"status": "execution_failed",
|
||||
"validation_error": error,
|
||||
}
|
||||
|
||||
|
||||
def _validate_output(
|
||||
raw_output: Any,
|
||||
instr: Any,
|
||||
|
||||
Reference in New Issue
Block a user