//! Crash reports: enough to reproduce a crash and fix it, without slowing the app down or //! filling the disk (docs/crash-reports.md). //! //! - **Panics** are caught by a hook. One inside a command becomes a report with the model as it //! was before the command and the command itself, so `fieldcraft-cli crashes replay ` //! reproduces it. A panic something inside the command caught and turned into an error is //! reported the same way, marked recovered. //! - **Crashes no hook sees** (an abort, a stack overflow, a segfault, a crash inside a graphics //! driver, the process being killed) are found at the next start: every running app keeps a //! small, locked command journal; a journal nobody holds any more belongs to an app that died. //! Its report carries the model the journal starts from (the last autosave, the model's file, //! or a copy taken when the model was opened) and the commands run since, ending with the one //! in flight, plus the app's last control request and the dead run's lines of the log file //! ([`crate::logfile`]). //! - **Cost**: nothing until [`install`] is called (tests, the CLI and the web build never do); //! after that, two small unbuffered appends per top-level command of the app's own model //! ([`Session::crash_journal`]), and work only when something panics. //! - **Bounded**: the same crash (its signature: place + message, digits ignored) is counted, not //! written again; at most [`MAX_NEW_PER_SESSION`] new reports per run, [`MAX_REPORTS`] //! reports, [`MAX_TOTAL_BYTES`] on disk, nothing older than [`MAX_AGE_DAYS`] days. //! //! Reports are folders `crashes/