fabro/docs/public/changelog/2026-08-26.mdx
Bryan Helmkamp a049f94042
Add on_failure="succeed" as an explicit failure policy
A failed node with an effective `succeed` policy and no explicit recovery
route now finishes as `succeeded` and follows normal success routing. The
original failure stays on the outcome so the stage.completed event and the
checkpoint keep the diagnostic, and the outcome notes record which scope
promoted it.

- OnFailure gains a Succeed variant; Node::on_failure resolves the
  deprecated auto_status=true attribute as an alias, with an explicit
  on_failure winning
- The core executor applies the policy before the lifecycle observes the
  result, so the recorded outcome, context keys, goal gates, events, and
  routing all see the effective outcome; this replaces AutoStatusLifecycle
- Explicit routes take priority: a matching condition, preferred label,
  suggested next node, or handler jump keeps the outcome failed. A failed
  outcome takes an unconditional edge only under route, so under succeed
  any edge selection is an explicit route
- succeed applies only to failed, matching exit; the auto_status alias no
  longer promotes partially_succeeded
- Parallel branches promote after their retry loop, so a failed succeed
  branch counts as succeeded in the parent aggregate
- Validation accepts succeed and adds an auto_status_deprecated warning
  that suggests on_failure="succeed"
- Document the policy table, semantics, and deprecation; add a changelog
  entry

Closes #807

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-26 07:34:24 -04:00

34 lines
1.3 KiB
Text

---
title: "Explicit succeed failure policy"
date: "2026-08-26"
---
`on_failure` now accepts a third policy, `succeed`, alongside `route` and
`exit`. A failed node with an effective `succeed` policy and no explicit
recovery route finishes as `succeeded` and follows normal success routing.
The original failure details stay on the `stage.completed` event and in the
checkpoint, and the outcome's notes record the promotion.
Set it on a node to mark a best-effort step inside a strict graph, or on the
graph to apply it everywhere:
```dot
digraph Review {
graph [on_failure="exit"]
start [shape=Mdiamond]
exit [shape=Msquare]
required_check [script="./required-check"]
optional_scan [script="./optional-scan" on_failure="succeed"]
start -> required_check -> optional_scan -> exit
}
```
An explicit `condition="outcome=failed"` edge still takes priority over the
promotion. A promoted outcome satisfies goal gates, and a failed parallel
branch with a `succeed` policy counts as succeeded in its parent's result.
`auto_status=true` is now a deprecated alias for `on_failure="succeed"`.
Existing workflows keep working, and validation reports a new
`auto_status_deprecated` warning with the replacement. The alias no longer
promotes `partially_succeeded` outcomes; only `failed` outcomes are affected.