pub struct Runner {
pub state: RunState,
/* private fields */
}Expand description
Drives one run.
Fields§
§state: RunStateRun state; public so the CLI can report on it.
Implementations§
Source§impl Runner
impl Runner
Sourcepub async fn start(
repo: &Path,
instruction: String,
config: Config,
) -> Result<Self>
pub async fn start( repo: &Path, instruction: String, config: Config, ) -> Result<Self>
Start a fresh run against repo.
Sourcepub async fn review(repo: &Path, branch: &str, config: Config) -> Result<Self>
pub async fn review(repo: &Path, branch: &str, config: Config) -> Result<Self>
Open a review-only run against work that already exists on branch.
The expensive half of the graph is the implement wave — measured at 111 and 134 internal tool-loop turns on this repository, against a handful for a judge or a reviewer. The cheap half is worth running on hand-written work too, and there was no way to reach it.
No new state and no schema change are needed: a run with one viable
candidate and a tally already decided degrades execute to exactly
review → gate → merge, because judge skips a single-candidate field,
deliberate has fewer than two first choices to reconcile, vote
returns early, tally is already present and fold_losers has no
losers. Resuming such a run therefore does the right thing as well.
Sourcepub async fn execute(&mut self) -> Result<()>
pub async fn execute(&mut self) -> Result<()>
Walk the graph to a terminal state, skipping nodes already recorded.
Sourcepub fn on_pause(&mut self, pause: Pause)
pub fn on_pause(&mut self, pause: Pause)
Hand the runner the pause magi serve’s own shutdown watches.
Sourcepub fn watch_interrupt(&mut self, pause: Pause)
pub fn watch_interrupt(&mut self, pause: Pause)
Hand the runner a second, independent pause: magi serve’s interrupt
scheduler asking this one run - and no other - to park so a task
marked crate::queue::Task::interrupt can run alone. See
Pause’s own doc for why this is never Runner::on_pause’s
handle.
Sourcepub async fn fix_selected(
&mut self,
ids: &[String],
reason: &str,
allow_stale: bool,
) -> Result<()>
pub async fn fix_selected( &mut self, ids: &[String], reason: &str, allow_stale: bool, ) -> Result<()>
Route specific, already-recorded review findings to a fixer for a
targeted, out-of-band fix on the winning branch — magi fix’s own
entry point.
Distinct from review_loop’s own fix step in three ways: it never
runs a reviewer wave, it never spends review-round budget, and what
happened is recorded as an OperatorFixRequest appended to
RunState::operator_fixes, never folded into a ReviewRound —
see run::SCHEMA’s doc for schema 9 on why a reviewer’s own severity
and vote must never be rewritten to look like a manufactured blocking
verdict.
Only meaningful once review has actually concluded: Ready (handed
off with findings still open, or simply concluded clean while minor
findings sat unaddressed) or Blocked (round budget spent, or the
gate failed). Everything else is refused: a run still in progress
should simply be resumed, and a Merged run’s branch has already
landed — reopening this run’s own record cannot change that, so the
answer there is a fresh magi review <branch>.
A real commit here re-verifies through a fresh, ordinary review-only
run on the same branch (Self::review) rather than reopening this
run’s own review_loop: once any round in this run’s history went
clean, review_conclusion treats that as permanent by design (the
same purity gate/merge rely on for safe reentry), so there is no
way to force one more genuine reviewer wave out of this run without
either rewriting history or weakening that guarantee for every other
caller. A review-only run costs nothing extra — no implementation, no
judging, no vote — and exercises the exact same review → verify →
gate → (human) merge path, unmodified.
Auto Trait Implementations§
impl !RefUnwindSafe for Runner
impl !UnwindSafe for Runner
impl Freeze for Runner
impl Send for Runner
impl Sync for Runner
impl Unpin for Runner
impl UnsafeUnpin for Runner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more