Skip to main content

Run History CLI

Every recipe run is recorded automatically. Use recipe runs to see what happened, then feed a Run ID into recipe judge.

Quick Start

Commands

runs

List recipe run history.
Options: The table shows Recipe · Version · Status · When · Session · Run ID, with color-coded status (success green, failed red, policy_denied/timeout yellow). Examples:
Copy a Run ID from the table and pass it to praisonai recipe judge <run-id> to evaluate that execution.
If the history module can’t be imported, the command prints Run history unavailable: <error> and exits with code 1.

runs stats

Get storage statistics.
Output:

runs cleanup

Clean up old runs based on retention policy.

export

Export a run for replay or debugging.
Options: Examples:

replay

Replay a run from an export bundle.
Options: Examples:

Export Format

Automatic History Persistence

Every praisonai recipe run (and every run_stream() execution) is recorded to history automatically. You don’t need --save for a run to appear in recipe runs. History is independent of the recipe registry: runs for a deleted or unknown recipe are still listed. Disable persistence:
Re-enable (default):

Storage Location

Run history is stored at ~/.praison/runs/.

Data Policy

Runs respect the recipe’s data policy:

Python API

Thread- and process-safety

RunHistory is safe under concurrent use. Every read-modify-write of index.json in store(), delete(), and cleanup() is wrapped in:
  • A per-instance threading.RLock (in-process serialisation).
  • A POSIX fcntl advisory lock on a sidecar lock file (cross-process serialisation). On Windows this degrades to a no-op; the RLock still serialises threads in the same interpreter.
  • An atomic _save_index — writes go to a temp file in the same directory and os.replace over index.json, so a SIGKILL mid-write cannot leave a truncated index.
This matches the concurrency posture of recipe.arun_background() (default max_concurrent=5) and of multiple praisonai run invocations sharing ~/.praison/runs/. get_history(path) returns the same RunHistory instance for the same resolved path across repeated calls, so multi-threaded stores that pass a path share the in-process lock — important on Windows where the advisory lock is a no-op. The default no-path singleton is unchanged.

Next Steps