Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
8d6993f
test(plugin-approvals): pin a failed fan-out as abandoned on the door…
claude Dec 1, 2026
77db9cf
fix(plugin-approvals): a fan-out where one branch fails is abandoned,…
claude Dec 1, 2026
89be400
fix(plugin-approvals): the fan-out judge's step type carries complete…
claude Dec 1, 2026
b744b4e
Merge remote-tracking branch 'origin/main' into claude/issue-38988-fa…
claude Dec 1, 2026
b0311d8
test(plugin-approvals): pin the two-deep open branch, the shared-targ…
claude Dec 2, 2026
7787060
fix(plugin-approvals): the fan-out judge reads each branch to its fro…
claude Dec 2, 2026
0be5313
fix(plugin-approvals): a refusal after the latest request was rejecte…
claude Dec 2, 2026
b326d32
docs(changeset): the fan-out judge's changeset says what the frontier…
claude Dec 2, 2026
51ecf07
Merge remote-tracking branch 'origin/main' into claude/issue-38988-fa…
claude Dec 2, 2026
beec364
test(plugin-approvals): pin a decision on the open branch and an appr…
claude Dec 2, 2026
006c6f6
fix(plugin-approvals): the fan-out judge reads conditional targets an…
claude Dec 2, 2026
24adca7
docs(plugin-approvals): the rejected guard says it is on the refused …
claude Dec 2, 2026
c877439
Merge remote-tracking branch 'origin/main' into claude/issue-38988-fa…
claude Dec 2, 2026
d91d5c6
test(plugin-approvals): pin a fan-out whose node carries labels it ne…
claude Dec 2, 2026
40b23f4
fix(plugin-approvals): the fan-out judge reads target ownership only …
claude Dec 2, 2026
40b7251
test(plugin-approvals): pin a decision's sibling-run target and an un…
claude Dec 2, 2026
491eff0
fix(plugin-approvals): the fan-out judge takes no sibling's step as a…
claude Dec 2, 2026
410f407
test(plugin-approvals): pin a decision that runs every edge and its o…
claude Dec 2, 2026
8b6d580
fix(plugin-approvals): the fan-out judge reads every group of a node …
claude Dec 2, 2026
b7ecc14
Merge remote-tracking branch 'origin/main' into claude/issue-38988-fa…
claude Dec 2, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions .changeset/38988-fanout-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
'@objectstack/plugin-approvals': patch
---

fix(plugin-approvals): an approval whose flow fans out and one branch fails is abandoned, never approved

Clause-②: no
Metadata-protocol: none

When a flow's node fans out to branches that run together and one branch fails, or reaches an `end` that refuses, the run ends while the other branches keep going. The approval plugin could judge such an approval approved. The judgement after the decision ran as the run ended, while a branch that could still lead to the next approval step had not finished. It placed the run at the failed branch, which leads to no later step, so the record took `approved` and the next approver was never asked. The reconciler, reading the stored log later, could put the record back to `recalled`, so the two judgements could disagree.

The maintainer ruled that when the run ends, an approval step on another branch that has not finished counts as not done, and the approval is abandoned. The judgement after the decision and the reconciler now read every case pinned here the same way. The record is put back (`recalled`, or the value at submit where the object closes on `recalled`), and the request's timeline names the node where the unfinished branch stood.

How a branch is read as unfinished:

- The judge reads the flow's out-edges that run together, and the steps the run logged by its end. It follows each branch of a fan-out past the nodes it had already logged, to the first node it had not reached. A branch counts where a step can still follow that node.
- An approval step's branch is the one its request's decision took (`approve`, `reject` or `revise`), so the branch a decision did not take is not read as open, even where two labels share a target. Where the label a node took is not recorded (a `decision` that declares `conditions`, or an approval step with no request row), every branch of it counts, whatever the run logged: which targets logged cannot tell the label, and a label no edge carries makes the engine run every edge. This can put a record back after a branch the flow did not take, also in a flow with no parallel branches. The seat accepted that cost in writing, the direction ADR-0162 tolerates as a resubmission. It never reads as finished a branch the engine ran. A node that chooses no label runs all its out-edges, even where they carry labels, so every branch of it counts.
- On a branch, a target of a conditional or default edge counts as decided only once the run logged a step for it, or a `skipped` step that passed it over. Otherwise it is undecided or still running, and counts as unfinished.
- A step logged as `skipped` (a gate that did not open) does not count as the node having run.
- Where the flow's body cannot be read when the run is judged, a branch that has logged nothing cannot be seen. The approval is then not judged until the reconciler's age bound has passed. After that it is put back where a step can follow the step last decided, the same rule as for a run that cannot be read.

A run that ends `refused` after the approval's latest request was rejected keeps `rejected`, even with another branch still open. The ruling concerns a record marked approved with an approver missing, and a rejection is an approver's decision. This applies to a refused run only. A run that failed, was cancelled or timed out was already put back before this change when it stopped between two steps, whatever the latest decision, and it still is.

A failure another branch logged after the run ended is also no longer read as a failure the flow went on from. The outcome was abandoned before as well; the timeline now names the branch that was still open instead.
Loading
Loading