Skip to content

feat: new reporter implementation#154

Merged
branchseer merged 11 commits intomainfrom
02-13-feat_new_reporter_implementation
Feb 15, 2026
Merged

feat: new reporter implementation#154
branchseer merged 11 commits intomainfrom
02-13-feat_new_reporter_implementation

Conversation

@branchseer
Copy link
Copy Markdown
Member

@branchseer branchseer commented Feb 13, 2026

No description provided.

Copy link
Copy Markdown
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@branchseer branchseer changed the title refactor: extract ExecutionPlan::plan_query returning ExecutionGraph feat: new reporter implementation Feb 13, 2026
@branchseer branchseer force-pushed the 02-13-feat_new_reporter_implementation branch 2 times, most recently from 153ff9b to 0340b6c Compare February 13, 2026 10:53
@branchseer branchseer marked this pull request as ready for review February 14, 2026 08:02
Extract the query planning logic from ExecutionPlan::plan into a new
plan_query method that accepts QueryPlanRequest and returns
Result<ExecutionGraph, Error> directly. Session::plan_from_cli now
returns ExecutionGraph instead of ExecutionPlan, and callers wrap it
via the new ExecutionPlan::from_execution_graph constructor.

Also narrows RunCommand::into_plan_request to into_query_plan_request,
since it always produced a Query variant.
Replace the flat Reporter trait with ExecutionEvent/ExecutionId dispatch
with a three-phase typestate hierarchy: GraphExecutionReporterBuilder →
GraphExecutionReporter → LeafExecutionReporter.

Split into PlainReporter (standalone, for single-leaf synthetic execution)
and LabeledReporter family (graph-aware, with summary aggregation and
shared state via Rc<RefCell>).

Extract execute_spawn as a free function reusable from both graph
execution and execute_synthetic. Simplify plan_synthetic to return
SpawnExecution directly.

Remove ExecutionEvent, ExecutionEventKind, ExecutionId, and the
CycleDetected cache variant (cycles are now graph-level errors via
ExecutionAborted).
Add StdinSuggestion enum to LeafExecutionReporter trait so reporters can
suggest whether child processes should inherit stdin or use /dev/null.

PlainReporter always suggests inherited stdin (single synthetic execution).
LabeledReporter suggests inherited only when the graph has exactly one
spawn leaf (computed via count_spawn_leaves at build time).

The actual stdin is inherited only when BOTH conditions hold:
- Reporter suggests Inherited
- Task has no cache metadata (caching disabled)

This prevents non-deterministic user input from corrupting cached output
while allowing interactive stdin for single uncached tasks.

Includes 15 unit tests for stdin suggestion logic and 3 E2E snapshot
tests verifying stdin inheritance/null behavior end-to-end.
MSYS cat from Git for Windows crashes with MapViewOfFileEx errors when
stdin is set to Stdio::null(), causing CI failures on Windows. Replace
with a Node.js read-stdin tool that handles null stdin gracefully.
Executions no longer abort the entire graph on infrastructure errors
(cache lookup, spawn, or cache update failures). All tasks run to
completion; failures are tracked by the reporter and reflected in the
final exit code.

- Replace ExecutionAborted with SpawnOutcome { CacheHit, Spawned, Failed }
- Make execute_leaf infallible (returns ())
- execute_expanded_graph returns Option<Str> for cycle errors only
- Remove first_error abort banner from labeled reporter
- Update exit code logic to account for infrastructure errors
- Update cycle dependency snapshot for new error format
Use petgraph::acyclic::Acyclic<DiGraph> for the ExecutionGraph type alias,
providing type-level acyclicity guarantees. Cycles are now detected when
building the execution plan rather than during graph execution.

- Add CycleDependencyDetected variant to TaskPlanErrorKind
- Replace StableGraph + toposort with Acyclic::nodes_iter() for execution order
- Simplify ExecutionAborted to a unit struct (no error message field)
- Remove error parameter from GraphExecutionReporter::finish()
- Move cache initialization before reporter construction in execute_graph
- Add plan snapshot test for cycle dependency errors
- Update E2E snapshots for new error format and execution order
…ruct

Replace the petgraph::acyclic::Acyclic type alias with a custom
ExecutionGraph struct that owns a DiGraph and a pre-computed toposort.
This eliminates the RefCell-based !Sync issue that required
arc_with_non_send_sync suppressions.

- Add try_from_graph() for validated construction with CycleError
- Add inner() for access to the underlying DiGraph
- Add toposort() returning cached &[ExecutionNodeIndex]
- Add from_node_list() for building edge-free test graphs
- Implement Deref<Target = DiGraph> for transparent read access
- Remove petgraph::data::Build import and arc_with_non_send_sync expects
- Replace Index<ExecutionPathItem> impl with ExecutionPathItem::resolve()
Move PlainReporter and LabeledReporter family from reporter.rs into
reporter/plain.rs and reporter/labeled.rs. Shared types, traits, and
display helpers remain in reporter/mod.rs with pub use re-exports.
@branchseer branchseer force-pushed the 02-13-feat_new_reporter_implementation branch from 4a9dc5c to ccee3b7 Compare February 15, 2026 04:13
@branchseer branchseer merged commit 663351e into main Feb 15, 2026
7 checks passed
@branchseer branchseer deleted the 02-13-feat_new_reporter_implementation branch February 15, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant