Skip to content

feat(execution-core): emit node_skipped events - #95

Open
dawidaksamski wants to merge 1 commit into
feat/WB-430-require-start-nodefrom
feat/WB-430-emit-node-skipped-events
Open

feat(execution-core): emit node_skipped events#95
dawidaksamski wants to merge 1 commit into
feat/WB-430-require-start-nodefrom
feat/WB-430-emit-node-skipped-events

Conversation

@dawidaksamski

Copy link
Copy Markdown
Contributor

What

A pruned branch previously left no trace: the runner marked the node 'skipped'
internally and moved on, so a node that never ran was indistinguishable from one the
run hadn't reached yet — in the event stream, in the log panel, and on the canvas.

runGraph now emits a node_skipped event for every node whose incoming edges all
resolved without a live route, carrying a reason:

reason Meaning
branch_not_taken A predecessor ran and routed elsewhere — the head of the dead branch
upstream_skipped Every predecessor was itself skipped — deeper inside an already-dead branch

'errorRoute' is covered too: a node that fails and routes to its error handle prunes
the success branch, which reports branch_not_taken.

Notable decisions

  • Emitted after the whole wave has propagated, so skips land after that wave's
    node_completed and before the next wave's node_started. Order is a pure function
    of the definition, so replay reproduces it.
  • Reason is order-independent. One live-but-pruned incoming edge is enough to make a
    node branch_not_taken, tracked in a set rather than read off the last edge to
    resolve — otherwise a join fed by both a dead branch and a live node that routed
    elsewhere would report differently depending on which predecessor resolved last.
  • Emit failures are not swallowed — an exhausted emitEvent fails the run, same as
    execution_started/execution_completed. Unlike node_started there's no node
    execution to route through an error policy. Flagging in case we'd rather a lost skip
    notice never fail an otherwise-good run.
  • pathId deliberately left unpopulated — it belongs to the separate
    declared-but-never-emitted contract members question.

AI Studio

Log panel gets a grey badge with the reason inline. Two fixes beyond the planned scope,
both regressions the new status would otherwise have caused: the canvas marker rendered
an empty box for a status none of its branches matched, and highlighting counted skipped
nodes as non-idle, drawing the edge into a pruned branch as if the run had travelled it.

image

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.

2 participants