1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! `pitboss rebuy` — buy back into a halted run from `.pitboss/play/state.json`.
//!
//! Rebuy reuses the runner driver from [`crate::cli::play::execute`] with
//! [`StartMode::Resume`], so the only behavioral delta from `pitboss play`
//! is that a missing or empty `state.json` is an error: there is nothing to
//! rebuy into. The per-run branch is checked out, [`crate::runner::Runner`]
//! is constructed against the loaded plan / deferred / state, and execution
//! continues from `plan.current_phase`, which the runner advanced to the
//! next phase the last time it persisted state.
//!
//! `pitboss resume` is kept as a clap alias of `pitboss rebuy` so existing
//! scripts and muscle memory continue to work.
use PathBuf;
use Result;
use ;
/// Top-level entry point for the `rebuy` subcommand. `tui` toggles the
/// `ratatui` dashboard the same way [`crate::cli::play::run`] does. `pr` opts
/// the resumed run into the post-run `gh pr create` step (see
/// [`crate::cli::play::run`]). `dry_run` mirrors `pitboss play --dry-run`:
/// the configured agent is swapped for a no-op so the resumed run can be
/// exercised end-to-end without spending tokens. `no_sweep` and
/// `force_sweep` mirror `pitboss play --no-sweep` / `--sweep`.
pub async