Files
DCCONSTRUCTIONS d0e5f90952 Preserve installed operator workspace before consolidation
Local preservation snapshot, not a new deployment or simulation acceptance.
2026-10-08 09:59:51 +03:00

21 lines
849 B
Python

"""Transfer a latched pipeline failure to its native episode lifecycle owner."""
from local_state import write_json
def consume_pipeline_failure(pipeline, directory, stop_command):
accessor = getattr(pipeline, "terminal_failure", None)
failure = accessor() if accessor is not None else None
if failure is None:
return None
# This stops actuator intent only. It neither rewrites measured velocity
# nor claims that the physical body has already stopped.
stop_command(0.0, 0.0)
write_json(directory / "pipeline-failure.json", failure)
return {
"outcome": "failed",
"mission_outcome": "error",
"message": "Симуляция завершена после ошибки обработки наблюдений. Журнал сохранён.",
"pipeline_failure": failure,
}