pub struct EngineerCompletionSignal(/* private fields */);Expand description
Run-scoped latch recording that a delegated engineer already reported an
EXPLICIT successful completion (finish_task with status: completed)
during this run (#2683).
Why: The bake-off regression this closes is a PM that, after the engineer
already called finish_task with all tests passing, fires ONE MORE
gratuitous delegate_to_agent “re-verify” round; when that extra round
then runs out of turns / wall-clock time, the run terminated mid-round and
was mislabeled partial/exit-6 even though a complete, correct,
all-tests-passing deliverable already sat on disk — corrupting run
status/telemetry (issue #2683 recurrence comment, 2026-07-15). This shared
latch is the authoritative “the task is genuinely done” signal: once set,
DelegateToAgentTool refuses further re-delegation (part b of the fix)
and run_task::assemble_report reports success rather than partial (the
data-integrity half). Modeled as a cheap Arc<AtomicBool> handle,
mirroring run_task::redelegation::RedelegationCapSignal, so the tool (the
setter) and the report assembler (the reader) observe the SAME state.
What: new() starts un-latched; mark_completed latches it (set only by
DelegateToAgentTool::execute when the delegated runner returns an
AgentOutput whose finish_status is Some(FinishStatus::Completed));
is_completed reads it. Clone shares the same underlying flag.
Test: tools::delegate::tests::completion_signal_latches_on_completed_finish,
tools::delegate::tests::completion_signal_ignores_non_completed_finish,
tools::delegate::tests::delegate_refused_once_engineer_completed.
Implementations§
Source§impl EngineerCompletionSignal
impl EngineerCompletionSignal
Sourcepub fn new() -> Self
pub fn new() -> Self
Build a fresh, un-latched signal for one run.
Why: Each execute_run_task call needs its OWN signal — a prior run’s
completion must never leak into a later run’s report.
What: Self::default().
Test: completion_signal_latches_on_completed_finish.
Sourcepub fn is_completed(&self) -> bool
pub fn is_completed(&self) -> bool
Whether a delegated engineer has already completed successfully.
Why: DelegateToAgentTool::execute reads this to refuse a gratuitous
re-delegation, and run_task::assemble_report reads it to report
success instead of partial.
What: Loads the latched flag.
Test: completion_signal_latches_on_completed_finish.
Trait Implementations§
Source§impl Clone for EngineerCompletionSignal
impl Clone for EngineerCompletionSignal
Source§impl Debug for EngineerCompletionSignal
impl Debug for EngineerCompletionSignal
Auto Trait Implementations§
impl Freeze for EngineerCompletionSignal
impl RefUnwindSafe for EngineerCompletionSignal
impl Send for EngineerCompletionSignal
impl Sync for EngineerCompletionSignal
impl Unpin for EngineerCompletionSignal
impl UnsafeUnpin for EngineerCompletionSignal
impl UnwindSafe for EngineerCompletionSignal
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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