Repository navigation
refactor(vt): make leaf reporting and summary outcomes exhaustive - #1019
Merged
Merged
Conversation
fspy benchmarklinuxmacoswindows |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f552e47. Configure here.
Replace the flattened 3-argument LeafExecutionReporter::finish signature, CacheUpdateStatus/Option<ExecutionError> tuple, and 6 coupled fields on summary::SpawnOutcome::Success with exhaustive enums (LeafOutcome, CacheUpdateOutcome, and SavedCacheOutcome) so invalid pairings are unrepresentable. Co-authored-by: Gemini 4 Neon <noreply@google.com>
…utcome
- Borrow `&CacheStatus` in `LeafExecutionReporter::start` and make
`LeafOutcome` self-contained (`CacheHit`, `RestoreFailed`, `InProcess`,
`Spawned { cache_status, outcome }`, `FailedBeforeStart`, `Cancelled`),
removing `SummaryLeafReporter.cache_status` and the `CacheStatus` x
`LeafOutcome` cross-product `unreachable!`s in `summary.rs`.
- Keep a private `SpawnReport` in `execute/mod.rs` (excluding `InProcess`)
so `execute_spawn` has no `unreachable!` arm.
- Add `LeafOutcome::into_error` to deduplicate error extraction across
five reporters.
- Align naming (`SavedCacheOutcome::NotUpdated(SavedCacheNotUpdatedReason)`,
`execute::SpawnOutcome::InfraError`), preserve IPC-error rendering parity
in `format_full_summary`, update doc comments, and add round-trip and
non-spawn outcome tests.
Co-authored-by: gemini-4-neon <noreply@google.com>
wan9chi
force-pushed
the
t3/vt-leaf-outcome-refactor
branch
from
November 26, 2026 01:25
f552e47 to
c0c73b1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
The leaf execution reporting pipeline and persisted run summary flattened mutually exclusive states into loosely coupled tuples and flags, allowing invalid combinations to be constructed and forcing downstream code to reconstruct intent:
execute_spawnbuilt a typed privateReportenum and immediately flattened it into(Option<ExitStatus>, CacheUpdateStatus, Option<ExecutionError>)atLeafExecutionReporter::finish.LeafExecutionReportersplit a single leaf lifecycle across uncorrelatedstart(CacheStatus)andfinish(...)calls, requiringSummaryLeafReporterto stashOption<CacheStatus>and pair it back up with the finish outcome.cache_update::update_cachereturned(CacheUpdateStatus, Option<ExecutionError>)and fabricatedCacheNotUpdatedReason::CacheDisabledon all four error paths (as didReport::failed), even when caching was enabled.summary::SpawnOutcome::Successcarried six independentbool/Option<SavedError>fields (infra_error,fspy_unsupported,ipc_server_error,tracking_incomplete,tool_disabled_cache,upload_error), allowing mutually exclusive skip/error states to coexist and allowingupload_errorto be attached even when no local cache update happened.TaskResult::from_executionunpacked four flags fromCacheUpdateStatusintospawn_outcome_from_execution, which relied on a(None, None)fallback for dry-runWouldSpawnleaves, while summary rendering depended on implicitif letprecedence.Changes
event.rs,execute/cache_update.rs,execute/mod.rs,execute/scheduler.rs,session/mod.rs):(CacheUpdateStatus, Option<ExecutionError>)withCacheUpdateOutcome(Updated { upload_error },NotUpdated(CacheNotUpdatedReason),Failed(ExecutionError)) so error paths never fabricateCacheDisabled.CacheNotUpdatedReasonto post-exit-0 reasons only (CacheDisabled,Cancelled,FspyUnsupported,IpcServerError,ToolRequested,TrackingIncomplete).&CacheStatusinLeafExecutionReporter::startand replace the 3-argumentfinishsignature with a self-containedLeafOutcome(CacheHit,RestoreFailed,InProcess,Spawned { cache_status, outcome },FailedBeforeStart,Cancelled) plusLeafOutcome::into_error, eliminatingSummaryLeafReporter.cache_statusand any cross-productunreachable!branches.SpawnReportinexecute/mod.rs(excludingInProcess) and renameexecute::SpawnOutcome::FailedtoInfraErrorto avoid ambiguity withsummary::SpawnOutcome::Failed.LeafExecutionReporterimplementations (PlainReporter,InterleavedLeafReporter,LabeledLeafReporter,GroupedLeafReporter,JsonLeafReporter,SummaryLeafReporter) to consumeLeafOutcomecleanly while preserving existing output, JSON, and exit-status behavior.summary.rs,summary_reporter.rs):summary::SpawnOutcome::SuccesswithSavedCacheOutcome(Updated { upload_error },NotUpdated(SavedCacheNotUpdatedReason),Failed(SavedError)) and addSpawnOutcome::WouldSpawnfor dry runs.LeafOutcomedirectly toLeafSummaryOutcomewith zerounreachable!arms, removing flag unpacking and the(None, None)fallback.TaskResult::set_upload_errortoSavedCacheOutcome::Updated, preserve IPC-error summary formatting parity, and keep existingReadSummaryError::IncompatibleVersionhandling for olderlast-summary.jsonfiles.LeafSummaryOutcome::from_leaf_outcome,set_upload_error, and summary formatting.Note
Medium Risk
Touches the core task execution, caching, and reporting path, but changes are mostly structural typing with explicit parity for exit status, fast-fail, and summary output.
Overview
Replaces the loosely coupled leaf reporting pipeline (
start(CacheStatus)plusfinish(exit_status, cache_update, error)) with a singleLeafOutcomethat bundles cache context and result so invalid pairings are unrepresentable. Post-run caching now returnsCacheUpdateOutcome(Updated/NotUpdated/Failed) instead of(CacheUpdateStatus, Option<ExecutionError>), so infrastructure failures no longer masquerade asCacheDisabled.The spawn path maps through
SpawnReportinto narrowerSpawnOutcomevariants (SpawnedSuccess,SpawnedFailed,InfraError), andupdate_cacheis only invoked for exit-0 runs. AllLeafExecutionReporterimplementations and the summary layer consumeLeafOutcomedirectly; persisted summaries useSavedCacheOutcome/SavedCacheNotUpdatedReasonandLeafSummaryOutcome::from_leaf_outcome, with legacylast-summary.jsonshapes rejected as incompatible.Reviewed by Cursor Bugbot for commit c0c73b1. Bugbot is set up for automated code reviews on this repo. Configure here.