Skip to content

feat(ai-studio): the Refund Review template escalates to a senior reviewer - #214

Open
dawidaksamski wants to merge 3 commits into
feat/WB-683-review-node-decision-uifrom
feat/WB-682-refund-review-flow-update
Open

dawidaksamski wants to merge 3 commits into
feat/WB-683-review-node-decision-uifrom
feat/WB-682-refund-review-flow-update

Conversation

@dawidaksamski

Copy link
Copy Markdown
Contributor

What

The "Refund Review" template shows the several-resume-actions loop end to end. The first reviewer is now a Review node, and Escalate hands the refund to a second person, with an AI brief in between that carries the first reviewer's comment and corrections.

Nine nodes and nine edges, laid out left to right in three lanes: the approved lane on top, the escalation lane in the middle, the two rejections below.

  • Review Refund is a Review node (review-1). Its request is the Review preset with the existing refund form on top, so Approve, Escalate and Reject each have a port.
  • Prepare the Escalation is a new AI node on the Escalated port. It re-proposes the refund in the shared refund review schema: the first reviewer's edits win over the draft, the order date stays, and internalReasoning becomes the escalation note. That note covers why it was escalated, in the reviewer's words, what they changed, and the policy reasoning. Reusing the schema keeps the Response format dropdown on its "refund review" preset.
  • Senior Review is a new Human decision node after the brief, with Approve and Reject. Its form shows the amount as required, the reply as editable, and the order date and the escalation note read-only. The node exists because a deciding node's form fields come from its direct predecessor. Wired straight to Escalated, the senior's form could show only the first decision record, not the refund.
  • Send the Confirmation joins both Approved edges. Its prompt says the context may hold a brief and one or two decision records, and that the latest record's edits win over the brief, and the brief over the draft.
  • Rejected by Senior is a second record node for the senior's rejection. A Visualize node shows only its first incoming edge, so the two rejections cannot share one.

Docs

  • AI Studio README: the sentence naming the template adds that its Review node escalates to a second person through an AI brief.

Not in this PR

  • Any change to the nodes, the form or the backend. This PR is template data and tests only.
  • The open design points listed in the earlier PRs of this stack.

Testing

  • AI Studio: 625 tests in 44 files pass on top of the decider change; tsc, eslint and prettier are clean. The template test grew from nine cases to sixteen and pins:
    • both deciders render with their own templates, and the request objects are the exported ones;
    • the first decider's actions equal the Review preset's, the senior's equal the Human decision preset's;
    • each decider has exactly one predecessor, the senior's being the brief, which is reached only through Escalated;
    • one edge per action port of each decider, and none from a port it does not offer;
    • the brief seeds the shared refund schema, and the senior's form lists its fields under the same titles and types, editable only for amount and reply;
    • the confirmation has exactly the two Approved predecessors, and each rejection node one;
    • the contract test parses the senior's request with the backend's decisionRequestSchema.
  • The properties panel's integration test on this template now exercises the Review node, since the template's first decider changed type.
  • Manual, on the local stack with the published template, decisions sent through the API:
    • Approve straight: the escalation lane and both rejection nodes are skipped, and the confirmation is sent with no outcome.
    • Escalate with the amount edited to 45 and a comment, then a senior approval: the brief carries 45 and opens its note with the comment, and the confirmation names 45 dollars.
    • Escalate, then a senior rejection with a reason: the confirmation is skipped, the senior's record node runs, and the run ends with outcome: 'rejected'.
  • Manual, in the browser: the canvas draws all nine nodes and edges, three handles on Review Refund and two on Senior Review, with no edge crossing a node.
  • The draft, the brief and the confirmation call the model, so runs depend on the configured LLM. On the free model a single node took close to three minutes.

@dawidaksamski dawidaksamski self-assigned this Oct 9, 2026
@dawidaksamski
dawidaksamski added this pull request to stack #199 October 9, 2026 12:15
@dawidaksamski
dawidaksamski force-pushed the feat/WB-682-refund-review-flow-update branch from 0aea947 to 95d3d13 Compare October 9, 2026 13:50
@dawidaksamski
dawidaksamski force-pushed the feat/WB-682-refund-review-flow-update branch from 95d3d13 to 9039414 Compare October 9, 2026 13:57
@dawidaksamski
dawidaksamski force-pushed the feat/WB-682-refund-review-flow-update branch from 9039414 to 5b697cf Compare October 9, 2026 14:06
@dawidaksamski
dawidaksamski marked this pull request as ready for review October 9, 2026 14:11
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