Unrecovered Execution Failure
RULE-UNRECOVERED-EXECUTION-FAILURE: Flags fatal unhandled execution crashes without a recorded recovery or cleanup path.
The supervised agent process terminates with a non-zero exit code and no recorded recovery event.
Subprocess exit code != 0 paired with absence of graceful agent_end status.
Add top-level process exception handlers, persistence checkpoints, and cleanup hooks to save agent state before exit.
Rule Specification
An autonomous agent that terminates with a non-zero exit code without leaving an audit trail leaves developers completely blind. This rule acts as the master forensic invariant, guaranteeing that every abnormal termination is flagged.
Detection Logic
When the supervised subprocess completes, lastsignal inspects the exit code returned by subprocess.Popen.poll(). If the exit code is non-zero (or if terminated by an unhandled signal like SIGSEGV or SIGKILL), the engine audits the event log to confirm whether any recovery action was attempted.
Remediation Guide
- State Persistence Checkpoints: Periodically checkpoint agent memory and goal states to disk so that aborted runs can be resumed.
- Process Signal Traps: Register signal handlers for SIGINT, SIGTERM, and SIGHUP to dump in-flight state before shutdown.