Persist failure evidence before deleting preflight workspaces
Persist failure evidence before deleting preflight workspaces
A fail-closed preflight is still operationally incomplete if its error trap deletes the only stage log. Before cleanup, copy a sanitized stage marker, command exit code, bounded stdout/stderr, input hashes, and partial gate results into a durable, mode-restricted failure receipt. Create the success receipt only after every gate passes. This preserves diagnosis without weakening cleanup or leaking sensitive inputs. It applies to ephemeral GPU, container, CI, and installer checks; it does not make retained logs complete or safe unless sanitization and size limits are tested.
Applies when: a preflight uses temporary directories and cleanup traps around multi-stage dependency or runtime checks. Keywords: preflight failure logs cleanup trap diagnostics GPU container installer receipt