Skip to content

feat(workflow-engine): Track tainted workflow evaluations#107311

Merged
kcons merged 5 commits intomasterfrom
kcons/fastwf
Feb 20, 2026
Merged

feat(workflow-engine): Track tainted workflow evaluations#107311
kcons merged 5 commits intomasterfrom
kcons/fastwf

Conversation

@kcons
Copy link
Copy Markdown
Member

@kcons kcons commented Jan 30, 2026

Report metrics for workflow evaluations that may have produced incorrect results due to errors during condition evaluation ("tainted" results).

This helps monitor evaluation reliability by emitting a single metric process_workflows.workflows_evaluated with a tainted tag, allowing us to track the ratio and number of tainted workflows.
This doesn't yet propagate taintedness to delayed evaluation; that's a planned follow-up.

Updates ISWF-1960.

@kcons kcons requested a review from a team as a code owner January 30, 2026 00:31
@github-actions github-actions bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 30, 2026
Copy link
Copy Markdown
Contributor

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link
Copy Markdown
Contributor

@saponifi3d saponifi3d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generally lgtm, mostly just nitpicks / thoughts.


def test_workflow_trigger(self) -> None:
triggered_workflows, _ = evaluate_workflow_triggers(
triggered_workflows, _, _ = evaluate_workflow_triggers(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 since the tuple is growing, should we return a typed dict instead? that way it's a little easier to reason through the returned result.

return TriggerResult(triggered=self.triggered, error=error)

@staticmethod
def choose_tainted(a: "TriggerResult", b: "TriggerResult") -> "TriggerResult":
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we just make this a list of TriggerResults and return the first tainted? might be a little more reusable that way.

Comment on lines +247 to +250
if evaluation.is_tainted():
tainted_untriggered += 1
else:
untainted_untriggered += 1
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it kinda feels like the tainted / untainted stuff could be encapsulated a little more. could we just add the evaluation result to a list and have it determine this information? That way we don't need to independently track this then rebuild it for the results


@sentry_sdk.trace
@scopedstats.timer()
def evaluate_workflows_action_filters(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated: we might want to look at decomposing this method and the trigger condition methods. it seems like we could probably compose these two a bit more and reduce code replication

@kcons kcons merged commit 1525d6a into master Feb 20, 2026
93 checks passed
@kcons kcons deleted the kcons/fastwf branch February 20, 2026 23:34
priscilawebdev pushed a commit that referenced this pull request Feb 24, 2026
Report metrics for workflow evaluations that may have produced incorrect
results due to errors during condition evaluation ("tainted" results).

This helps monitor evaluation reliability by emitting a single metric
`process_workflows.workflows_evaluated` with a `tainted` tag, allowing
us to track the ratio and number of tainted workflows.
This doesn't yet propagate taintedness to delayed evaluation; that's a
planned follow-up.

Updates ISWF-1960.
mchen-sentry pushed a commit that referenced this pull request Feb 24, 2026
Report metrics for workflow evaluations that may have produced incorrect
results due to errors during condition evaluation ("tainted" results).

This helps monitor evaluation reliability by emitting a single metric
`process_workflows.workflows_evaluated` with a `tainted` tag, allowing
us to track the ratio and number of tainted workflows.
This doesn't yet propagate taintedness to delayed evaluation; that's a
planned follow-up.

Updates ISWF-1960.
@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

claude-code-assisted Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants